:root {
    --bg-dark: #09090b;
    --panel-bg: rgba(24, 24, 27, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;
    
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Fondos dinámicos */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99,102,241,0.4) 0%, rgba(99,102,241,0) 70%);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(168,85,247,0.4) 0%, rgba(168,85,247,0) 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.05); }
}

/* Vistas / Pantallas */
.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    animation: fadeIn 0.4s ease-out forwards;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Paneles Glassmorphism */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Tipografía */
.gradient-text {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Botones y Controles */
.upload-zone {
    margin-top: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

input[type="file"] {
    display: none;
}

.premium-btn, .upload-btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-body);
}

.upload-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border-color);
}
.upload-btn:hover { background-color: rgba(255, 255, 255, 0.15); }

.premium-btn.primary {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}
.premium-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -3px rgba(99, 102, 241, 0.5);
}

.premium-btn.secondary {
    background-color: var(--text-primary);
    color: var(--bg-dark);
}
.premium-btn.secondary:hover { background-color: #e2e8f0; }

.hidden { display: none !important; }

.file-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 1rem;
    text-align: center;
}

.start-actions { margin-top: 1.5rem; }

/* Test Screen */
.test-header {
    margin-bottom: 2rem;
}

.progress-container { margin-bottom: 1rem; }
.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #c084fc);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    line-height: 1.4;
    text-align: justify;
    hyphens: auto;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.op-letter {
    font-weight: 800;
    margin-right: 1.25rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.op-text {
    flex: 1;
    text-align: justify;
    hyphens: auto;
    line-height: 1.4;
}

/* Respuestas Modificadores */
.option-btn.selected {
    background-color: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}
.option-btn.selected .op-letter {
    background-color: var(--accent);
    color: white;
}

.option-btn.correct {
    background-color: var(--success-bg);
    border-color: var(--success);
}
.option-btn.correct .op-letter {
    background-color: var(--success);
    color: white;
}

.option-btn.incorrect {
    background-color: var(--error-bg);
    border-color: var(--error);
}
.option-btn.incorrect .op-letter {
    background-color: var(--error);
    color: white;
}

.actions {
    margin-top: 2rem;
    text-align: right;
}

/* Result Screen */
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }

.score-display {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, rgba(99,102,241,0.3) 100%);
    border: 4px solid var(--accent);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.score-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.score-max {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.feedback-msg {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Flashcards 3D Flip */
.scene {
    width: 100%;
    perspective: 1000px;
    margin-top: 1rem;
}

.scene--card {
    height: 350px;
}

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

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

.card__face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow-y: auto;
}

.card__face--back {
    transform: rotateY(180deg);
}

/* History Screen */
.history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .glass-panel {
        padding: 1.5rem;
    }
    .history-grid {
        grid-template-columns: 1fr;
    }
    .gradient-text {
        font-size: 2rem;
    }
    .test-header h2.gradient-text {
        font-size: 1.5rem !important;
    }
    .score-circle {
        width: 150px;
        height: 150px;
    }
    .score-number {
        font-size: 3rem;
    }
}
