/* =====================================================
   FOCO - Task Management App
   Estilo Principal
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    /* Cores principais - Tema Cyberpunk/Neon */
    --primary: #00f5d4;
    --primary-dark: #00b89c;
    --secondary: #7b2cbf;
    --accent: #ff006e;
    --accent-light: #ff4d94;
    --warning: #ffd60a;
    --danger: #ef233c;
    --success: #06d6a0;
    
    /* Background */
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-input: #1a1a25;
    
    /* Texto */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    /* Bordas */
    --border-color: #2a2a3a;
    --border-glow: rgba(0, 245, 212, 0.3);
    
    /* Sombras */
    --shadow-glow: 0 0 20px rgba(0, 245, 212, 0.2);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #00f5d4 0%, #7b2cbf 100%);
    --gradient-accent: linear-gradient(135deg, #ff006e 0%, #7b2cbf 100%);
    --gradient-success: linear-gradient(135deg, #06d6a0 0%, #00f5d4 100%);
    --gradient-bg: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 50%, #000000 100%);
    
    /* Espaçamento */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset e Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background animado */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 245, 212, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(123, 44, 191, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 0, 110, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 10s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Seleção de texto */
::selection {
    background: var(--primary);
    color: var(--bg-dark);
}

/* Container principal */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
}

/* =====================================================
   TELA DE LOGIN/REGISTRO
   ===================================================== */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.3em;
    text-shadow: 0 0 30px rgba(0, 245, 212, 0.3);
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: var(--spacing-sm);
    letter-spacing: 0.1em;
}

.auth-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.auth-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   FORMULÁRIOS
   ===================================================== */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

/* Checkboxes de dias da semana */
.days-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: space-between;
}

.day-checkbox {
    position: relative;
    cursor: pointer;
}

.day-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.day-checkbox .day-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.day-checkbox input[type="checkbox"]:checked + .day-label {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--background);
    box-shadow: 0 0 15px rgba(0, 245, 212, 0.4);
}

.day-checkbox:hover .day-label {
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .day-checkbox .day-label {
        width: 40px;
        height: 40px;
        font-size: 0.75rem;
    }
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(0, 245, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 245, 212, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #d90429;
}

.btn-success {
    background: var(--gradient-success);
    color: var(--bg-dark);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* =====================================================
   HEADER
   ===================================================== */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.2em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.user-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* XP Bar Desktop */
.xp-stat-item {
    min-width: 120px;
}

.xp-desktop-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.xp-desktop-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 190, 11, 0.5);
}

.xp-bar-desktop {
    width: 100%;
    height: 8px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 80px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--bg-dark);
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
}

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-xl);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Countdown Timer */
.next-task-timer {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
}

.timer-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-md);
}

.timer-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 245, 212, 0.5);
    margin-bottom: var(--spacing-sm);
    transition: color 1s ease, text-shadow 1s ease;
}

.timer-task-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Progress Cards */
.progress-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.progress-section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.progress-item {
    margin-bottom: var(--spacing-lg);
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.progress-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-value {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.5s ease, 
                box-shadow 0.5s ease;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #ef233c 0%, #ff4d4d 100%);
}

/* Efeito de brilho animado na barra */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Animação de celebração quando 100% */
@keyframes progressComplete {
    0%, 100% {
        box-shadow: 0 0 10px rgba(6, 214, 160, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(6, 214, 160, 0.8), 0 0 30px rgba(0, 245, 212, 0.4);
    }
}

.progress-fill.complete {
    animation: progressComplete 1.5s ease-in-out infinite;
}

/* Classes de cor por tipo (fallback) */
.progress-fill.daily {
    background: var(--gradient-primary);
}

.progress-fill.weekly {
    background: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
}

.progress-fill.monthly {
    background: linear-gradient(135deg, #ff006e 0%, #ff4d94 100%);
}

.progress-fill.yearly {
    background: linear-gradient(135deg, #ffd60a 0%, #ffea00 100%);
}

.progress-fill.single {
    background: linear-gradient(135deg, #06d6a0 0%, #00f5d4 100%);
}

/* Animação de oscilação vermelho/verde */
.progress-fill.warning {
    animation: warningPulse 1s ease-in-out infinite;
}

.progress-fill.urgent {
    animation: warningPulse 0.5s ease-in-out infinite;
}

.progress-fill.critical {
    animation: warningPulse 0.2s ease-in-out infinite;
}

.progress-fill.overdue {
    background: var(--danger) !important;
    animation: none;
}

@keyframes warningPulse {
    0%, 100% { 
        background: linear-gradient(135deg, #06d6a0 0%, #00f5d4 100%);
        box-shadow: 0 0 10px rgba(6, 214, 160, 0.5);
    }
    50% { 
        background: linear-gradient(135deg, #ef233c 0%, #ff4d4d 100%);
        box-shadow: 0 0 10px rgba(239, 35, 60, 0.5);
    }
}

/* =====================================================
   ÁREA DE TAREFAS
   ===================================================== */

.tasks-area {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.tasks-tabs {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.task-tab {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.task-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.add-task-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Lista de Tarefas */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.task-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.task-card:hover::before {
    opacity: 1;
}

.task-card.completed {
    opacity: 0.6;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-main {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.task-checkbox {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    background: transparent;
}

.task-checkbox:hover {
    border-color: var(--primary);
}

.task-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
    animation: checkPop 0.4s ease;
}

.task-checkbox.checked::after {
    content: '✓';
    color: var(--bg-dark);
    font-weight: bold;
}

@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.task-content {
    flex: 1;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.task-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.task-type-badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.task-type-badge.daily {
    background: rgba(0, 245, 212, 0.2);
    color: var(--primary);
}

.task-type-badge.custom_daily {
    background: rgba(255, 190, 11, 0.2);
    color: var(--accent);
}

.task-type-badge.weekly {
    background: rgba(123, 44, 191, 0.2);
    color: #9d4edd;
}

.task-type-badge.monthly {
    background: rgba(255, 0, 110, 0.2);
    color: var(--accent);
}

.task-type-badge.yearly {
    background: rgba(255, 214, 10, 0.2);
    color: var(--warning);
}

.task-type-badge.single {
    background: rgba(6, 214, 160, 0.2);
    color: var(--success);
}

.task-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.task-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.task-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-left: var(--spacing-md);
}

.task-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
}

.task-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.task-action-btn.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Subtarefas */
.subtasks-container {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.subtasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.subtasks-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.add-subtask-btn {
    font-size: 0.8rem;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.subtask-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.subtask-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.subtask-checkbox.checked::after {
    content: '✓';
    color: var(--bg-dark);
}

.subtask-title {
    flex: 1;
    font-size: 0.9rem;
}

.subtask-item.completed .subtask-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.subtask-delete {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.subtask-delete:hover {
    color: var(--danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-title {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}

.empty-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =====================================================
   MODAIS
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--spacing-lg);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
    position: relative;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-normal);
}

.modal-close:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* =====================================================
   NOTIFICAÇÕES TOAST
   ===================================================== */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--shadow-card);
    transform: translateX(120%);
    transition: transform var(--transition-normal);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

/* =====================================================
   ANIMAÇÕES DE CELEBRAÇÃO
   ===================================================== */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Glow effect para tarefas completadas */
.task-completed-glow {
    animation: completedGlow 0.6s ease;
}

@keyframes completedGlow {
    0% {
        box-shadow: 0 0 0 rgba(6, 214, 160, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(6, 214, 160, 0.6);
    }
    100% {
        box-shadow: 0 0 0 rgba(6, 214, 160, 0);
    }
}

/* XP Animation */
.xp-popup {
    position: fixed;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warning);
    text-shadow: 0 0 20px rgba(255, 214, 10, 0.8);
    pointer-events: none;
    z-index: 3000;
    animation: xpFloat 1.5s ease-out forwards;
}

@keyframes xpFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

/* Timer Pulse Animation */
@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

/* Level Up Animation */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    animation: levelUpAppear 0.5s ease;
}

@keyframes levelUpAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.level-up-content {
    text-align: center;
    animation: levelUpPulse 1s ease infinite;
}

@keyframes levelUpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.level-up-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
}

.level-up-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 6rem;
    font-weight: 900;
    color: var(--warning);
    text-shadow: 0 0 50px rgba(255, 214, 10, 0.8);
}

/* =====================================================
   LOADING STATES
   ===================================================== */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   RESPONSIVIDADE
   ===================================================== */

/* Stats Mobile - Escondido por padrão no desktop */
.stats-mobile {
    display: none;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .sidebar {
        order: 0; /* Sidebar (contador + progresso) aparece primeiro no mobile */
    }
    
    .tasks-area {
        order: 1; /* Lista de tarefas aparece depois */
    }
    
    .user-stats {
        display: none;
    }
    
    /* Mostrar stats mobile */
    .stats-mobile {
        display: block;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-sm);
    }
    
    .stats-mobile-row {
        display: flex;
        justify-content: space-around;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .stat-mobile-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: var(--spacing-xs) var(--spacing-sm);
        background: var(--background);
        border-radius: var(--radius-sm);
        min-width: 70px;
    }
    
    .stat-mobile-value {
        font-family: 'Orbitron', sans-serif;
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--primary);
        text-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
    }
    
    .stat-mobile-label {
        font-size: 0.65rem;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 2px;
    }
    
    /* Timer compacto no mobile */
    .next-task-timer {
        padding: var(--spacing-sm) var(--spacing-md);
        margin-bottom: var(--spacing-sm);
    }
    
    .timer-display {
        font-size: 1.8rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .timer-title {
        font-size: 0.7rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .timer-task-name {
        font-size: 0.85rem;
    }
    
    /* Progress section compacto no mobile */
    .progress-section {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .progress-section h3 {
        font-size: 0.8rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .progress-item {
        margin-bottom: var(--spacing-sm);
    }
    
    .progress-label {
        font-size: 0.8rem;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    /* XP bar compacto */
    .xp-bar-container {
        margin-top: var(--spacing-xs);
    }
    
    .xp-bar {
        height: 8px;
    }
    
    /* Sidebar spacing */
    .sidebar {
        gap: var(--spacing-sm);
    }
}

/* Barra de XP */
.xp-bar-container {
    margin-top: var(--spacing-sm);
}

.xp-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.xp-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.xp-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.xp-bar {
    height: 12px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.xp-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.5s ease, background 0.5s ease;
    position: relative;
    overflow: hidden;
}

.xp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: xpShine 2s infinite;
}

@keyframes xpShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .header-left {
        flex-shrink: 0;
    }
    
    .header-left .logo {
        font-size: 1.2rem;
    }
    
    .header-right {
        justify-content: flex-end;
    }
    
    .user-info {
        gap: var(--spacing-xs);
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .user-name {
        font-size: 0.85rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    #logout-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }
    
    .tasks-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: var(--spacing-sm);
    }
    
    .task-tab {
        white-space: nowrap;
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .tasks-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
    
    .auth-box {
        padding: var(--spacing-lg);
    }
    
    .auth-logo h1 {
        font-size: 2.5rem;
    }
    
    .modal {
        margin: var(--spacing-md);
        max-height: calc(100vh - 2rem);
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Fade classes */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Slide animations */
.slide-in-right {
    animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-up {
    animation: slideInUp 0.3s ease forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

