/* ===== GAUCHO COLOR PALETTE ===== */
:root {
    --cuero: #8B4513;
    --cuero-claro: #A0522D;
    --cuero-oscuro: #5D2E0C;
    --pampa: #C4A484;
    --trigo: #DAA520;
    --crema: #F5E6D3;
    --poncho-rojo: #8B0000;
    --poncho-borde: #B22222;
    --noche: #1a0f07;
    --humo: #2d1810;
    --plata: #C0C0C0;
    --oro: #FFD700;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lora', Georgia, serif;
    background: linear-gradient(135deg, var(--noche) 0%, var(--humo) 50%, var(--cuero-oscuro) 100%);
    color: var(--crema);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== LEATHER TEXTURE BACKGROUND ===== */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(139, 69, 19, 0.3) 2px,
            rgba(139, 69, 19, 0.3) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 2px,
            rgba(139, 69, 19, 0.2) 2px,
            rgba(139, 69, 19, 0.2) 4px
        );
    z-index: -1;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(180deg, rgba(139, 69, 19, 0.4) 0%, transparent 100%);
    border-bottom: 3px solid var(--trigo);
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cuero);
}

.header-decoration {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--trigo);
    opacity: 0.7;
}

.header-decoration.left { left: 2rem; }
.header-decoration.right { right: 2rem; }

h1 {
    font-family: 'Rye', cursive;
    font-size: clamp(2rem, 8vw, 4rem);
    color: var(--trigo);
    text-shadow:
        3px 3px 0 var(--cuero-oscuro),
        -1px -1px 0 var(--noche);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-style: italic;
    color: var(--pampa);
    font-size: 1.1rem;
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 300px);
}

/* ===== MODE SELECTION ===== */
.mode-selection h2 {
    text-align: center;
    font-family: 'Rye', cursive;
    color: var(--trigo);
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.mode-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.mode-btn {
    background: linear-gradient(145deg, var(--cuero) 0%, var(--cuero-oscuro) 100%);
    border: 3px solid var(--trigo);
    border-radius: 15px;
    padding: 2rem;
    width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.mode-btn:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.15);
    border-color: var(--oro);
}

.mode-icon {
    font-size: 3rem;
}

.mode-title {
    font-family: 'Rye', cursive;
    font-size: 1.3rem;
    color: var(--trigo);
}

.mode-desc {
    font-size: 0.9rem;
    color: var(--pampa);
}

/* ===== BACK BUTTON ===== */
.back-btn {
    background: transparent;
    border: 2px solid var(--pampa);
    color: var(--pampa);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Lora', serif;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--pampa);
    color: var(--noche);
}

/* ===== LEARN MODE - GRID ===== */
.learn-mode h2 {
    text-align: center;
    font-family: 'Rye', cursive;
    color: var(--trigo);
    margin-bottom: 2rem;
}

.senas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.sena-card {
    background: linear-gradient(145deg, var(--cuero) 0%, var(--cuero-oscuro) 100%);
    border: 3px solid var(--trigo);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.sena-card:hover {
    transform: scale(1.02);
}

.sena-card .graphic {
    margin-bottom: 1rem;
}

.sena-card .name {
    font-family: 'Rye', cursive;
    font-size: 1.3rem;
    color: var(--trigo);
    margin-bottom: 0.5rem;
}

.sena-card .description {
    color: var(--crema);
    font-size: 1rem;
    line-height: 1.4;
}

/* ===== FLASHCARD MODE ===== */
.flashcard-mode {
    text-align: center;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 12px;
    background: var(--cuero-oscuro);
    border-radius: 6px;
    margin: 0 auto 0.5rem;
    border: 2px solid var(--trigo);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--poncho-rojo), var(--poncho-borde));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--pampa);
    margin-bottom: 2rem;
}

.flashcard-container {
    perspective: 1000px;
    margin-bottom: 2rem;
}

.flashcard {
    width: 320px;
    height: 420px;
    margin: 0 auto;
    cursor: pointer;
    position: relative;
}

.flashcard-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    border: 4px solid var(--trigo);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.flashcard-front {
    background: linear-gradient(145deg, var(--cuero) 0%, var(--cuero-oscuro) 100%);
}

.flashcard-back {
    background: linear-gradient(145deg, var(--poncho-rojo) 0%, var(--poncho-borde) 100%);
    transform: rotateY(180deg);
}

.card-graphic {
    margin-bottom: 1rem;
}

.card-hint {
    color: var(--pampa);
    font-style: italic;
    font-size: 0.9rem;
}

.card-name {
    font-family: 'Rye', cursive;
    font-size: 1.8rem;
    color: var(--oro);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.card-description {
    font-size: 1.1rem;
    color: var(--crema);
    line-height: 1.5;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(145deg, var(--cuero) 0%, var(--cuero-oscuro) 100%);
    border: 2px solid var(--trigo);
    color: var(--crema);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Lora', serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn:hover {
    background: var(--trigo);
    color: var(--noche);
}

.control-btn.shuffle {
    background: linear-gradient(145deg, var(--poncho-rojo), var(--poncho-borde));
}

/* ===== QUIZ MODE ===== */
.quiz-mode {
    text-align: center;
}

.quiz-score {
    background: linear-gradient(145deg, var(--cuero) 0%, var(--cuero-oscuro) 100%);
    border: 3px solid var(--trigo);
    border-radius: 15px;
    padding: 1rem 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 1.3rem;
}

.score-label {
    color: var(--pampa);
}

.score-value {
    font-family: 'Rye', cursive;
    color: var(--oro);
    font-size: 1.5rem;
}

.score-separator {
    color: var(--pampa);
}

.score-total {
    color: var(--crema);
}

.quiz-card {
    background: linear-gradient(145deg, var(--cuero) 0%, var(--cuero-oscuro) 100%);
    border: 4px solid var(--trigo);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.quiz-card h3 {
    font-family: 'Rye', cursive;
    color: var(--trigo);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.quiz-graphic {
    margin-bottom: 1.5rem;
}

.quiz-options {
    display: grid;
    gap: 0.8rem;
}

.quiz-option {
    background: var(--cuero-oscuro);
    border: 2px solid var(--pampa);
    color: var(--crema);
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Lora', serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.quiz-option:hover:not(:disabled) {
    background: var(--pampa);
    color: var(--noche);
}

.quiz-option.correct {
    background: #2e7d32;
    border-color: #4caf50;
    color: white;
}

.quiz-option.wrong {
    background: var(--poncho-rojo);
    border-color: var(--poncho-borde);
    color: white;
}

.quiz-feedback {
    background: linear-gradient(145deg, var(--cuero) 0%, var(--cuero-oscuro) 100%);
    border: 3px solid var(--trigo);
    border-radius: 15px;
    padding: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.feedback-content {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feedback-content.correct {
    color: #4caf50;
}

.feedback-content.wrong {
    color: var(--poncho-borde);
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(0deg, rgba(139, 69, 19, 0.4) 0%, transparent 100%);
    border-top: 3px solid var(--trigo);
    margin-top: 2rem;
}

footer::before {
    content: '';
    display: block;
    height: 3px;
    background: var(--cuero);
    margin-bottom: -3px;
    position: relative;
    top: -2rem;
    left: 0;
    right: 0;
}

.mate-decoration {
    font-size: 3rem;
    margin-bottom: 1rem;
}

footer p {
    font-style: italic;
    color: var(--pampa);
    font-size: 1.1rem;
}

.footer-small {
    font-size: 0.9rem !important;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

/* ===== FACE SVG STYLES ===== */
.face-svg {
    width: 150px;
    height: 150px;
}

.face-circle {
    fill: var(--pampa);
    stroke: var(--cuero-oscuro);
    stroke-width: 3;
}

.face-feature {
    fill: var(--cuero-oscuro);
}

.face-feature-stroke {
    stroke: var(--cuero-oscuro);
    stroke-width: 3;
    stroke-linecap: round;
    fill: none;
}

.face-highlight {
    fill: var(--poncho-rojo);
}

.face-white {
    fill: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-decoration {
        display: none;
    }

    .mode-btn {
        width: 100%;
        max-width: 280px;
    }

    .flashcard {
        width: 280px;
        height: 380px;
    }

    .flashcard-controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 200px;
        justify-content: center;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.sena-card:hover .graphic {
    animation: pulse 0.5s ease;
}
