* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --secondary-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --success-gradient: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
    --blue-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --dark-bg: #1a1a2e;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --shadow-sm: 0 2px 8px rgba(16, 185, 129, 0.1);
    --shadow-md: 0 4px 12px rgba(16, 185, 129, 0.15);
    --shadow-lg: 0 10px 40px rgba(16, 185, 129, 0.2);
    --shadow-xl: 0 20px 60px rgba(16, 185, 129, 0.25);
    --green-light: #d1fae5;
    --green-dark: #065f46;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 25px;
    animation: fadeInDown 0.6s ease-out;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.card-with-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.stats-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 500px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border: 2px solid rgba(16, 185, 129, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.stat-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(16, 185, 129, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.progress-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 14px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

#progressBar {
    background: var(--blue-gradient);
    height: 100%;
    width: 0;
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

.flashcard-container {
    perspective: 1500px;
}

.flashcard {
    width: 100%;
    height: 500px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.flashcard:hover {
    transform: translateY(-8px);
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: var(--card-bg);
    border-radius: 25px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    border: 3px solid rgba(16, 185, 129, 0.1);
}

.flashcard-front:hover,
.flashcard-back:hover {
    box-shadow: 0 25px 70px rgba(16, 185, 129, 0.35);
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-label {
    position: absolute;
    top: 25px;
    left: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    padding: 8px 20px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 25px;
    box-shadow: var(--shadow-sm);
}

.flashcard-back .card-label {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.card-content {
    font-size: 1.75rem;
    line-height: 1.7;
    text-align: center;
    color: var(--text-primary);
    font-weight: 500;
}

.flashcard-back .card-content {
    color: white;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.flip-hint {
    position: absolute;
    bottom: 25px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 500;
}

.flashcard-back .flip-hint {
    color: rgba(255, 255, 255, 0.9);
}

.controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
}

.btn-secondary {
    background: white;
    color: var(--green-dark);
    border: 2px solid rgba(16, 185, 129, 0.2);
}

.btn-secondary:hover {
    background: var(--green-light);
    border-color: rgba(16, 185, 129, 0.4);
}

.btn-icon {
    font-size: 1.3rem;
}

.keyboard-hints {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    animation: fadeInUp 0.6s ease-out 0.5s both;
    font-weight: 500;
}

kbd {
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: monospace;
    font-weight: 700;
    margin: 0 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stats-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1;
        min-width: 150px;
    }

    .progress-bar-container {
        flex-basis: 100%;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .flashcard {
        height: 400px;
    }

    .flashcard-front,
    .flashcard-back {
        padding: 35px;
    }

    .card-content {
        font-size: 1.25rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-sidebar {
        flex-direction: column;
    }

    .stat-card {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .flashcard {
        height: 350px;
    }

    .card-content {
        font-size: 1.1rem;
    }

    .card-label {
        left: 30px;
        top: 20px;
        font-size: 0.65rem;
        padding: 6px 15px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Scrollbar customizada */
.flashcard-front::-webkit-scrollbar,
.flashcard-back::-webkit-scrollbar {
    width: 10px;
}

.flashcard-front::-webkit-scrollbar-track {
    background: rgba(16, 185, 129, 0.05);
    border-radius: 10px;
}

.flashcard-back::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.flashcard-front::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 10px;
}

.flashcard-back::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
}

.flashcard-front::-webkit-scrollbar-thumb:hover,
.flashcard-back::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

.flashcard-back::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}
