/* ============================================
   MATHBOOST AI - ESTILOS PRINCIPAIS
   ============================================ */

:root {
    --mb-primary: #2563eb;
    --mb-primary-light: #3b82f6;
    --mb-success: #10b981;
    --mb-danger: #ef4444;
    --mb-warning: #f59e0b;
    --mb-bg: #0f172a;
    --mb-card: #1e293b;
    --mb-card-hover: #273548;
    --mb-text: #f1f5f9;
    --mb-text-secondary: #94a3b8;
    --mb-border: #334155;
    --mb-radius: 16px;
    --mb-radius-sm: 10px;
    --mb-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --mb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.mathboost-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--mb-bg);
    color: var(--mb-text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */
.mathboost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--mb-card);
    border-radius: var(--mb-radius);
    margin-bottom: 30px;
    box-shadow: var(--mb-shadow);
    border: 1px solid var(--mb-border);
    backdrop-filter: blur(10px);
}

.mathboost-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mathboost-logo-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.mathboost-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.mathboost-tagline {
    font-size: 0.85rem;
    color: var(--mb-text-secondary);
    display: block;
}

.mathboost-nav {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: var(--mb-radius-sm);
}

.mathboost-nav-item {
    background: transparent;
    border: none;
    color: var(--mb-text-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--mb-transition);
}

.mathboost-nav-item:hover {
    color: var(--mb-text);
    background: rgba(255, 255, 255, 0.05);
}

.mathboost-nav-item.active {
    background: var(--mb-primary);
    color: white;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
}

.mathboost-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mathboost-user-name {
    font-weight: 500;
}

.mathboost-logout-btn {
    color: var(--mb-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--mb-transition);
}

.mathboost-logout-btn:hover {
    color: var(--mb-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   CARDS
   ============================================ */
.mathboost-card {
    background: var(--mb-card);
    border-radius: var(--mb-radius);
    padding: 30px;
    box-shadow: var(--mb-shadow);
    border: 1px solid var(--mb-border);
    margin-bottom: 20px;
    transition: var(--mb-transition);
}

.mathboost-card:hover {
    border-color: var(--mb-primary-light);
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.1);
}

.mathboost-card h2 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   BOTÕES
   ============================================ */
.mathboost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--mb-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--mb-transition);
    text-decoration: none;
}

.mathboost-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mathboost-btn-primary {
    background: linear-gradient(135deg, var(--mb-primary), var(--mb-primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.mathboost-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.mathboost-btn-secondary {
    background: transparent;
    border: 2px solid var(--mb-border);
    color: var(--mb-text);
}

.mathboost-btn-secondary:hover:not(:disabled) {
    border-color: var(--mb-primary-light);
    color: var(--mb-primary-light);
}

.mathboost-btn-danger {
    background: transparent;
    border: 2px solid var(--mb-danger);
    color: var(--mb-danger);
}

.mathboost-btn-danger:hover:not(:disabled) {
    background: var(--mb-danger);
    color: white;
}

/* ============================================
   MODE BUTTONS
   ============================================ */
.mathboost-mode-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* ============================================
   PROGRESSO
   ============================================ */
.mathboost-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.mathboost-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--mb-border);
    border-radius: 10px;
    overflow: hidden;
}

.mathboost-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mb-primary), #8b5cf6);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.mathboost-progress-text {
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* ============================================
   TIMER
   ============================================ */
.mathboost-timer {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 20px 0;
    color: var(--mb-warning);
    font-family: 'Courier New', monospace;
}

/* ============================================
   QUESTÃO
   ============================================ */
.mathboost-question-box {
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: var(--mb-bg);
    border-radius: var(--mb-radius-sm);
    border: 2px solid var(--mb-border);
}

.mathboost-question {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   INPUT DE RESPOSTA
   ============================================ */
.mathboost-answer-row {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.mathboost-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--mb-border);
    border-radius: var(--mb-radius-sm);
    background: var(--mb-bg);
    color: var(--mb-text);
    font-size: 1.3rem;
    text-align: center;
    transition: var(--mb-transition);
}

.mathboost-input:focus {
    outline: none;
    border-color: var(--mb-primary-light);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

.mathboost-input::placeholder {
    color: var(--mb-text-secondary);
}

/* ============================================
   FEEDBACK
   ============================================ */
.mathboost-feedback {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    padding: 10px;
    border-radius: var(--mb-radius-sm);
    transition: var(--mb-transition);
}

.mathboost-feedback-success {
    color: var(--mb-success);
    background: rgba(16, 185, 129, 0.1);
    animation: pulse 0.5s ease;
}

.mathboost-feedback-error {
    color: var(--mb-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   AÇÕES
   ============================================ */
.mathboost-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* ============================================
   RESULTADO
   ============================================ */
.mathboost-result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.mathboost-result-stat {
    text-align: center;
    padding: 20px;
    background: var(--mb-bg);
    border-radius: var(--mb-radius-sm);
    border: 1px solid var(--mb-border);
}

.mathboost-result-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.mathboost-result-label {
    font-size: 0.85rem;
    color: var(--mb-text-secondary);
}

.mathboost-result-medal {
    font-size: 4rem;
    text-align: center;
    margin: 20px 0;
}

.mathboost-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* ============================================
   STATS GRID
   ============================================ */
.mathboost-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.mathboost-stat-card {
    text-align: center;
    padding: 25px 20px;
    background: var(--mb-bg);
    border-radius: var(--mb-radius-sm);
    border: 1px solid var(--mb-border);
    transition: var(--mb-transition);
}

.mathboost-stat-card:hover {
    border-color: var(--mb-primary-light);
    transform: translateY(-3px);
}

.mathboost-stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 10px;
}

.mathboost-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--mb-primary-light), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.mathboost-stat-label {
    font-size: 0.85rem;
    color: var(--mb-text-secondary);
}

/* ============================================
   RANKING TABLE
   ============================================ */
.mathboost-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.mathboost-table th,
.mathboost-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--mb-border);
}

.mathboost-table th {
    background: var(--mb-primary);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mathboost-table tr:hover td {
    background: rgba(37, 99, 235, 0.05);
}

.mathboost-table .mathboost-medal {
    font-size: 1.5rem;
}

/* ============================================
   LOADING
   ============================================ */
.mathboost-loading {
    text-align: center;
    padding: 40px;
    color: var(--mb-text-secondary);
}

.mathboost-loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

/* ============================================
   FOOTER
   ============================================ */
.mathboost-footer {
    text-align: center;
    padding: 30px;
    color: var(--mb-text-secondary);
    font-size: 0.9rem;
    margin-top: 40px;
    border-top: 1px solid var(--mb-border);
}

/* ============================================
   TELA DE LOGIN
   ============================================ */
.mathboost-auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.mathboost-auth-card {
    background: var(--mb-card);
    border-radius: var(--mb-radius);
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--mb-shadow);
    border: 1px solid var(--mb-border);
    text-align: center;
}

.mathboost-auth-card .mathboost-logo {
    flex-direction: column;
    margin-bottom: 30px;
}

.mathboost-auth-card .mathboost-logo-icon {
    font-size: 3rem;
}

.mathboost-auth-card h1 {
    font-size: 2rem;
    margin: 10px 0;
}

.mathboost-auth-card form {
    text-align: left;
}

.mathboost-auth-card label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
}

.mathboost-auth-card input[type="text"],
.mathboost-auth-card input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--mb-border);
    border-radius: var(--mb-radius-sm);
    background: var(--mb-bg);
    color: var(--mb-text);
    font-size: 1rem;
    margin-bottom: 15px;
    transition: var(--mb-transition);
}

.mathboost-auth-card input:focus {
    outline: none;
    border-color: var(--mb-primary-light);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.mathboost-auth-card input[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--mb-primary), var(--mb-primary-light));
    color: white;
    border: none;
    border-radius: var(--mb-radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--mb-transition);
    margin-top: 10px;
}

.mathboost-auth-card input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.mathboost-auth-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.mathboost-auth-links a {
    color: var(--mb-primary-light);
    text-decoration: none;
}

.mathboost-auth-links a:hover {
    text-decoration: underline;
}

/* ============================================
   HIDDEN
   ============================================ */
.mathboost-hidden {
    display: none !important;
}

/* ============================================
   ANIMAÇÕES
   ============================================ */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .mathboost-container {
        padding: 10px;
    }
    
    .mathboost-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .mathboost-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .mathboost-nav-item {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .mathboost-card {
        padding: 20px;
    }
    
    .mathboost-question {
        font-size: 2.2rem;
    }
    
    .mathboost-answer-row {
        flex-direction: column;
    }
    
    .mathboost-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mathboost-result-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mathboost-actions {
        flex-wrap: wrap;
    }
    
    .mathboost-auth-card {
        padding: 25px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .mathboost-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .mathboost-result-stats {
        grid-template-columns: 1fr;
    }
    
    .mathboost-logo h1 {
        font-size: 1.2rem;
    }
}