/* ==========================================================================
   Memory: Mujeres en la Ciencia - Estilos principales
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables CSS (Custom Properties)
   -------------------------------------------------------------------------- */
:root {
    --primary: #7C3AED;
    --primary-light: #A78BFA;
    --secondary: #EC4899;
    --accent: #06B6D4;
    --success: #10B981;
    --warning: #F59E0B;
    --bg-gradient-1: #FDF4FF;
    --bg-gradient-2: #EDE9FE;
    --bg-gradient-3: #DBEAFE;
    --card-back: linear-gradient(135deg, #7C3AED 0%, #EC4899 50%, #06B6D4 100%);
    --text-dark: #1E1B4B;
    --text-light: #6B7280;
    --shadow-soft: 0 4px 20px rgba(124, 58, 237, 0.15);
    --shadow-card: 0 8px 32px rgba(124, 58, 237, 0.2);
    --radius: 16px;
}

/* --------------------------------------------------------------------------
   Reset y estilos base
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --------------------------------------------------------------------------
   Contenedor principal
   -------------------------------------------------------------------------- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease-out;
}

h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

/* Gradiente solo en pantallas grandes donde funciona bien */
@media (min-width: 768px) {
    h1 {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Barra de estadísticas
   -------------------------------------------------------------------------- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: var(--shadow-soft);
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 1.1rem;
}

.stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Tablero de juego
   -------------------------------------------------------------------------- */
.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 700px;
    margin: 0 auto 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    animation: scaleIn 0.5s ease-out 0.3s both;
}

@media (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 10px;
    }
}

@media (max-width: 400px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Cartas
   -------------------------------------------------------------------------- */
.card {
    aspect-ratio: 3/4;
    perspective: 1000px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.matched .card-inner {
    animation: matchPulse 0.5s ease-out;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.card-back {
    background: var(--card-back);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
}

.card-back::before {
    content: '🔬';
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
}

.card-front {
    background: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    border: 3px solid var(--primary-light);
}

.card-image {
    flex: 1;
    background-size: cover;
    background-position: center top;
    background-color: #f0f0f0;
}

.card-name {
    padding: 4px 2px;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(0.5rem, 1.8vw, 0.7rem);
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
    background: white;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card.matched .card-front {
    border-color: var(--success);
}

.card.matched .card-name {
    color: var(--success);
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-soft);
    touch-action: manipulation;
   text-decoration: none; 
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover,
.btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary-light);
}

.btn-secondary:hover,
.btn-secondary:active {
    background: var(--bg-gradient-1);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Modales
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    position: relative;
    padding: 24px 24px 16px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-gradient-1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-light);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--secondary);
    color: white;
}

.modal-image {
    width: 140px;
    height: 180px;
    border-radius: 16px;
    margin: 0 auto 16px;
    background-size: cover;
    background-position: center top;
    border: 4px solid var(--primary-light);
    box-shadow: var(--shadow-card);
}

.modal-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.modal-dates {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.modal-body {
    padding: 0 24px 24px;
}

.modal-field {
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.modal-bio {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.modal-achievement {
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    padding: 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
}

.modal-achievement-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-achievement-text {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* --------------------------------------------------------------------------
   Modal de victoria
   -------------------------------------------------------------------------- */
.victory-content {
    text-align: center;
    padding: 40px 24px;
}

.victory-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 1s ease infinite;
}

.victory-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.victory-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.victory-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.victory-stat {
    text-align: center;
}

.victory-stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.victory-stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.victory-message {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-gradient-1);
    border-radius: var(--radius);
}

.victory-explore {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 24px;
    font-weight: 600;
}

.victory-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    text-align: center;
    padding: 16px;
    color: var(--text-light);
    font-size: 0.8rem;
}

footer strong {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Animaciones
   -------------------------------------------------------------------------- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes matchPulse {
    0%, 100% {
        transform: rotateY(180deg) scale(1);
    }
    50% {
        transform: rotateY(180deg) scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* --------------------------------------------------------------------------
   About Page
   -------------------------------------------------------------------------- */

        .about-container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }

        .about-card {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 24px;
            padding: 32px;
            margin-bottom: 24px;
            box-shadow: var(--shadow-soft);
            backdrop-filter: blur(10px);
        }

        .about-card h2 {
            font-family: 'Fredoka', sans-serif;
            font-size: 1.5rem;
            color: var(--primary);
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .about-card p {
            font-size: 1rem;
            line-height: 1.8;
            color: var(--text-dark);
            margin-bottom: 12px;
        }

        .about-card ul {
            list-style: none;
            padding: 0;
            margin: 16px 0;
        }

        .about-card ul li {
            padding: 8px 0;
            padding-left: 24px;
            position: relative;
            color: var(--text-dark);
        }

        .about-card ul li::before {
            content: '✨';
            position: absolute;
            left: 0;
        }

        .author-info {
            display: flex;
            align-items: center;
            gap: 20px;
            padding: 20px;
            background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
            border-radius: var(--radius);
            margin: 16px 0;
        }

        .author-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: var(--card-back);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            flex-shrink: 0;
        }

        .author-details h3 {
            font-family: 'Fredoka', sans-serif;
            color: var(--primary);
            margin-bottom: 4px;
        }

        .author-details p {
            margin: 0;
            font-size: 0.95rem;
        }

        .author-details a {
            color: var(--secondary);
            text-decoration: none;
            font-weight: 600;
        }

        .author-details a:hover {
            text-decoration: underline;
        }

        .license-box {
            background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
            padding: 20px;
            border-radius: var(--radius);
            border-left: 4px solid var(--accent);
            margin: 16px 0;
        }

        .license-box h3 {
            font-family: 'Fredoka', sans-serif;
            color: var(--accent);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .license-box p {
            margin: 0;
            font-size: 0.95rem;
        }

        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 20px;
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            font-family: 'Fredoka', sans-serif;
            transition: all 0.2s;
        }

        .back-link:hover {
            color: var(--secondary);
            transform: translateX(-4px);
        }

        .org-logo {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px;
            background: white;
            border-radius: var(--radius);
            margin-top: 16px;
        }

        .org-logo img {
            width: 60px;
            height: auto;
        }

        .org-logo span {
            font-weight: 600;
            color: var(--text-dark);
        }

/* --------------------------------------------------------------------------
   Language Switcher
   -------------------------------------------------------------------------- */
.lang-switcher {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid var(--primary-light);
    color: var(--primary);
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: var(--primary-light);
    color: white;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.lang-separator {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.85rem;
    user-select: none;
}
