:root {
    /* Core Palette */
    --bg-dark: #0a0a14;
    --bg-sidebar: #0f0f1a;
    --card-bg: rgba(26, 26, 46, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --text-primary: #e0e7ff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Accents */
    --accent-primary: #0055ff;
    --accent-secondary: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.4);
    --danger: #ef4565;
    
    /* Layout */
    --sidebar-width: 280px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 10% 20%, rgba(0, 85, 255, 0.05) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 20%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* Scrollbar Premium */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.app-layout { display: flex; height: 100%; position: relative; }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    display: flex; flex-direction: column;
    padding: 24px;
    z-index: 20;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
    display: flex; align-items: center; gap: 12px;
    font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em;
    margin-bottom: 32px; color: white;
}

.brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px rgba(0, 85, 255, 0.3);
}

.btn-sidebar-primary {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 500; font-size: 0.9rem;
}

.btn-sidebar-primary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-label {
    font-size: 0.7rem; color: var(--text-muted); font-weight: 600;
    margin: 24px 0 12px 0; letter-spacing: 0.05em;
}

.projects-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }

.project-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.project-item:hover { background: rgba(255, 255, 255, 0.03); color: white; }

.project-item.active {
    background: linear-gradient(90deg, rgba(0, 85, 255, 0.1), transparent);
    color: var(--accent-secondary);
    border-left-color: var(--accent-secondary);
}

.mini-progress { font-size: 0.75rem; font-weight: 600; opacity: 0.7; }

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 40px 60px;
    overflow-y: auto;
    position: relative;
}

/* Header & Progress */
.project-header { margin-bottom: 40px; animation: fadeIn 0.5s ease-out; }

.header-top { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }

#project-title {
    font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-badge {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 85, 255, 0.1);
    color: var(--accent-secondary);
    padding: 4px 12px; border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 0.9rem; font-weight: 600;
}

.progress-track {
    width: 100%; height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px; overflow: visible;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.progress-glow {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 100%; height: 12px;
    background: inherit; filter: blur(8px); opacity: 0.6;
}

/* --- Tasks Grid --- */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 80px;
}

.task-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.4s ease-out forwards;
}

.task-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 85, 255, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 85, 255, 0.1);
}

.task-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 12px;
}

.task-title { font-weight: 600; font-size: 1.1rem; color: white; }

.btn-delete {
    color: var(--text-muted); opacity: 0; transition: 0.2s;
    cursor: pointer; padding: 4px;
}
.task-card:hover .btn-delete { opacity: 1; }
.btn-delete:hover { color: var(--danger); transform: scale(1.1); }

.task-notes {
    font-size: 0.85rem; color: var(--text-muted); line-height: 1.4;
    margin-bottom: 20px; white-space: pre-line;
}

/* Steps */
.steps-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.step-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px; border-radius: var(--radius-sm);
    cursor: pointer; transition: 0.2s;
}

.step-item:hover { background: rgba(255, 255, 255, 0.03); }

/* Custom Checkbox */
.step-check {
    width: 20px; height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}

.step-item.done .step-check {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: scale(1.1);
}

.step-item.done span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.add-step-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: 0.3s;
}

.add-step-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    color: white;
}

/* --- Floating Action Button --- */
.fab {
    position: fixed; bottom: 40px; right: 40px;
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none; border-radius: 50%;
    color: white; font-size: 2rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 85, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 50;
}

.fab:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 15px 35px rgba(0, 212, 255, 0.5); }
.fab.hidden { transform: scale(0); opacity: 0; }

/* --- Modal --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; opacity: 0; pointer-events: none; transition: 0.3s;
}

.modal-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }

.modal-card {
    background: #141422;
    border: 1px solid var(--card-border);
    padding: 32px; width: 480px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(20px); transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay:not(.hidden) .modal-card { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-body { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.modal-body input, .modal-body textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 16px; border-radius: 12px;
    color: white; font-family: inherit;
    transition: 0.3s;
}

.modal-body input:focus, .modal-body textarea:focus {
    border-color: var(--accent-primary);
    background: rgba(0, 85, 255, 0.05);
    outline: none;
}

.btn-primary-glow {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border: none; padding: 12px 24px;
    border-radius: 12px; color: white; font-weight: 600;
    width: 100%; cursor: pointer; transition: 0.2s;
}
.btn-primary-glow:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3); }
.btn-icon { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.btn-icon:hover { color: white; }

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

/* --- Empty State Redesign (Mascot Version) --- */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; 
    animation: fadeIn 0.8s ease-out;
}

.empty-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.mascot-wrapper {
    position: relative;
    width: 200px; 
    height: 200px;
    margin: 0 auto 32px auto;
    display: flex; align-items: center; justify-content: center;
}

.mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 0 25px rgba(0, 85, 255, 0.3)); 
    animation: float 6s ease-in-out infinite;
}

.mascot-glow {
    position: absolute;
    width: 120%; height: 120%;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.15;
    z-index: 1;
    animation: pulse-glow 4s infinite alternate;
}

.welcome-title {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 24px;
    font-weight: 800;
    background: linear-gradient(to bottom, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboarding-text {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 32px;
    text-align: left;
}

.onboarding-text p {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 16px;
    text-align: center;
}

.steps-guide {
    list-style: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex; flex-direction: column; gap: 8px;
}

.steps-guide li {
    display: flex; align-items: center; gap: 8px;
}

.steps-guide strong {
    color: var(--accent-secondary);
}

/* Botão Grande para o Empty State */
.btn-primary-glow.large {
    padding: 18px 48px;
    font-size: 1.1rem;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 10px 30px rgba(0, 85, 255, 0.2);
    border-radius: 50px;
}

.btn-primary-glow.large:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 212, 255, 0.3);
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse-glow {
    from { opacity: 0.1; transform: scale(0.9); }
    to { opacity: 0.25; transform: scale(1.1); }
}

/* -----------------------------------
   MOBILE ADAPTATION (OVERRIDE ONLY)
   -----------------------------------
   Aqui começa a adaptação. Tudo acima se mantém igual no Desktop.
*/

/* Elementos Mobile escondidos por padrão */
.btn-mobile-menu, .sidebar-mobile-header, .mobile-overlay { 
    display: none; 
}

@media (max-width: 768px) {
    /* Layout */
    .main-content { 
        padding: 80px 20px 100px 20px; /* Mais espaço no topo */
        width: 100%;
    }
    
    /* Botão Menu Hambúrguer (Aparece só aqui) */
    .btn-mobile-menu {
        display: flex; position: fixed; top: 20px; left: 20px;
        background: rgba(20, 20, 34, 0.8); backdrop-filter: blur(10px);
        border: 1px solid var(--card-border); color: white;
        width: 44px; height: 44px; border-radius: 12px;
        align-items: center; justify-content: center; font-size: 1.5rem;
        z-index: 90; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

    /* Sidebar vira Off-Canvas */
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100%;
        width: 85%; max-width: 300px;
        transform: translateX(-100%); /* Escondida */
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
        border-right: 1px solid var(--accent-primary); /* Borda sutil */
    }
    
    .sidebar.open { transform: translateX(0); }

    /* Cabeçalho interno da Sidebar Mobile */
    .sidebar-mobile-header {
        display: flex; justify-content: space-between; align-items: center;
        margin-bottom: 24px;
        border-bottom: 1px solid var(--card-border);
        padding-bottom: 16px;
    }
    
    .brand-text-mobile { font-weight: 700; color: white; font-size: 1.2rem; }

    .btn-close-sidebar {
        background: none; border: none; color: var(--text-muted);
        font-size: 1.8rem; padding: 5px; cursor: pointer;
    }

    /* Overlay Escuro */
    .mobile-overlay {
        display: block;
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.6); z-index: 15;
        opacity: 0; pointer-events: none; transition: 0.3s;
    }
    .mobile-overlay.visible { opacity: 1; pointer-events: auto; }

    /* Ajustes de Conteúdo */
    #project-title { font-size: 1.8rem; }
    .tasks-grid { grid-template-columns: 1fr; } /* 1 coluna apenas */
    
    .empty-content { padding: 60px 20px; }
    .mascot-wrapper { width: 150px; height: 150px; }
    
    .modal-card { width: 90%; padding: 24px; }
}