/* Valorant-inspired CSS styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f1923 0%, #1a242d 100%);
    color: #ece8e1;
    min-height: 100vh;
    padding: 20px;
}

.invisible {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff4655, #23140f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.subtitle {
    color: #8b978f;
    font-size: 1.2rem;
    margin-top: 10px;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px;
}

.buttons-flex {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 25px;
    padding: 20px;
}

#all {
    background: linear-gradient(145deg, #ffcc00, #ffb300);
    color: #ffffff;
    border: 2px solid #ffcc00;
    padding: 16px 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

#all:hover {
    background: linear-gradient(145deg, #ffb300, #ffcc00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.4);
}

.buttons-flex button {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.buttons-flex button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.buttons-flex button:hover::before {
    left: 100%;
}

#randomChoose {
    background: linear-gradient(145deg, #ff4655, #d43a4a);
    color: #ffffff;
    border-color: #ff4655;
}

#randomChoose:hover {
    background: linear-gradient(145deg, #d43a4a, #ff4655);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 70, 85, 0.4);
}

#duelist {
    background: linear-gradient(145deg, #ff4655, #d43a4a);
    color: #ffffff;
    border-color: #ff4655;
}

#duelist:hover {
    background: linear-gradient(145deg, #d43a4a, #ff4655);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 70, 85, 0.4);
}

#sentinel {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: #ffffff;
    border-color: #4CAF50;
}

#sentinel:hover {
    background: linear-gradient(145deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

#initiator {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: #ffffff;
    border-color: #2196F3;
}

#initiator:hover {
    background: linear-gradient(145deg, #1976D2, #2196F3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

#controller {
    background: linear-gradient(145deg, #9C27B0, #7B1FA2);
    color: #ffffff;
    border-color: #9C27B0;
}

#controller:hover {
    background: linear-gradient(145deg, #7B1FA2, #9C27B0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
}

.button-flex button:active,
.buttons-flex button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.modal.active {
    display: flex;
    opacity: 1;
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    padding: 20px;
}

.modal-content {
    background: linear-gradient(145deg, #1a242d, #0f1923);
    margin: 5% auto;
    padding: 30px;
    border: 2px solid #ff4655;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto; /* Ensure content is scrollable */
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close {
    color: #ff4655;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
}

#modal-title {
    color: #ff4655;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modal-description {
    color: #ece8e1;
    line-height: 1.6;
    margin-bottom: 20px;
}

#abilities-container {
    margin-top: 15px;
}

#abilities-container div {
    background: rgba(255, 70, 85, 0.1);
    border-left: 3px solid #ff4655;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    color: #ece8e1;
    line-height: 1.5;
}

#abilities-container div strong {
    color: #ff4655;
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
}

/* Scrollbar styling for modal content */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #1a242d;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ff4655;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #d43a4a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .buttons-flex {
        flex-direction: column;
        align-items: center;
    }
    
    .buttons-flex button {
        width: 100%;
        max-width: 250px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .button-flex h1 {
        font-size: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .button-flex button,
    .buttons-flex button {
        padding: 14px 24px;
        font-size: 1rem;
        min-width: 120px;
    }
    
    .title {
        font-size: 1.8rem;
    }
}

.card {
    background: linear-gradient(145deg, #1a242d, #0f1923);
    border: 2px solid #ff4655;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(255, 70, 85, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff4655, #0f1923);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 70, 85, 0.3);
    border-color: #ff4655;
}
