/*
 * -----------------------------------------------------
 * VARIÁVEIS DE CORES
 * -----------------------------------------------------
 */
:root {
    /* TEMA CLARO */
    --bg: #f5f8fa;
    --text: #2c3e50;
    --card: #ffffff;
    --accent: #007bff;
    --accent-light: #3498db;
    --done: #EAF3FF;
    --done-text: #6c7a89;
    --hover-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --progress-bg: #dde8f0;
    --focus-ring: #007bff80;
    --hover-shadow: rgba(0, 0, 0, 0.15);
    --bg-gradient: linear-gradient(135deg, #F8F9FA 0%, #E0F2FF 100%);
    /* 💡 CORES DO SCROLLBAR LIGHT */
    --scroll-track: #f5f5f5;
    --scroll-thumb: #c4d7e6;
    --scroll-thumb-hover: #b0c2d3;
}

.dark {
    /* TEMA ESCURO */
    --bg: #1e2730;
    --text: #eef1f4;
    --card: #2c3e50;
    --accent: #5dade2;
    --accent-dark: #3498db;
    --done: #151b20;
    --done-text: #6c7a89;
    --hover-bg: #2c3e50;
    --shadow: rgba(0, 0, 0, 0.6);
    --progress-bg: #374758;
    --focus-ring: #5dade280;
    --hover-shadow: rgba(0, 0, 0, 0.8);
    --bg-gradient: linear-gradient(135deg, #212b36 0%, #171d24 100%);
    /* 💡 CORES DO SCROLLBAR DARK */
    --scroll-track: #212b36;
    --scroll-thumb: #4a5c70;
    --scroll-thumb-hover: #5d7085;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    margin: 0;
    padding: 0px 45px;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

/* ---------------- HEADER & ICONS ---------------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--progress-bg);
}

header h2 {
    font-size: 1.8em;
    font-weight: 700;
}

.icons {
    display: flex;
    gap: 20px;
    align-items: center;
    /* Garantir alinhamento vertical */
}

.icon {
    width: 26px;
    height: 26px;
    cursor: pointer;
    opacity: 0.9;
    transition: 0.3s transform, 0.3s opacity;
}

.icon:hover {
    opacity: 1;
    transform: rotate(-20deg);
}

/* ---------------- PROGRESSO GERAL ---------------- */

#progress-container {
    width: 100%;
    background: var(--progress-bg);
    height: 28px;
    border-radius: 14px;
    margin: 30px 0;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px var(--shadow);
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    border-radius: 14px;
    transition: width 0.8s cubic-bezier(0.25, 0.8, 0.5, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark #progress-bar {
    background: linear-gradient(to right, var(--accent-dark), var(--accent));
}

#progressText {
    color: white;
    font-weight: 800;
    font-size: 15px;
    user-select: none;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

/* ---------------- COLUNAS ---------------- */
.columns {
    display: flex;
    gap: 25px;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    flex-wrap: nowrap;
}

.column {
    flex: 1;
    background: var(--card);
    border-radius: 16px;
    max-height: 73vh;
    overflow-y: auto;
    padding: 25px;
    box-sizing: border-box;
    box-shadow: 0 10px 30px -5px var(--shadow);
    transition: box-shadow 0.3s ease;
}

.column h3 {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--progress-bg);
}

/* ---------------- TAREFAS ---------------- */

/* ---------------- TAREFAS (PADRONIZAÇÃO) ---------------- */

.task {
    padding: 14px;
    margin-bottom: 12px;
    background: var(--card);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s background-color ease, 0.3s transform ease, 0.3s box-shadow ease;
    border: 1px solid var(--progress-bg);
    position: relative;

    /* Altura mais compacta */
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.task.done {
    background: var(--done);
    border-left: 6px solid var(--accent);
    color: var(--done-text);
    min-height: 70px;
    /* igual para concluído */
}

.task:hover {
    background: var(--hover-bg);
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -3px var(--hover-shadow);
}

.task:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.task.done:hover {
    background: var(--done);
    box-shadow: 0 2px 4px var(--shadow);
    transform: none;
}

.task div:first-child {
    font-weight: 600;
    color: inherit;
}

.deadline {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 6px;
    font-weight: 400;
    transition: 0.3s color;
}

.deadline:contains("expirado") {
    color: #e74c3c;
    font-weight: 700;
    opacity: 1;
}

/* ---------------- MODAL DE PARABÉNS ---------------- */
.congrats-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 9999;
}

.congrats-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.congrats-content {
    background: var(--card);
    color: var(--text);
    padding: 40px;
    border-radius: 18px;
    width: 90%;
    max-width: 480px;
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    border: 4px solid var(--accent);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.typing {
    border-right: 4px solid var(--accent);
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 25px;
    font-weight: 800;
    font-size: 1.6em;
}

.certificate {
    background: var(--bg);
    border: 2px dashed var(--accent);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    color: var(--text);
}

#closeCongrats {
    margin-top: 30px;
    padding: 12px 25px;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s background-color, 0.3s transform;
}

#closeCongrats:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

@keyframes pop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    80% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* -----------------------------------------------------
 * CUSTOMIZAÇÃO DA BARRA DE ROLAGEM (SCROLLBAR)
 * -----------------------------------------------------
 */

/* 1. Largura da barra */
.column::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* 2. Fundo (Track) */
.column::-webkit-scrollbar-track {
    background: var(--scroll-track);
    border-radius: 10px;
}

/* 3. Thumb (a parte que se move) */
.column::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

/* 4. Hover no Thumb */
.column::-webkit-scrollbar-thumb:hover {
    background-color: var(--scroll-thumb-hover);
}

/* ------------- RESPONSIVIDADE ------------- */
@media (max-width: 992px) {
    body {
        padding: 20px 30px;
    }

    .columns {
        gap: 15px;
        flex-wrap: wrap;
    }

    .column {
        flex: 1 1 45%;
        padding: 20px;
        max-height: none;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 10px;
    }

    .header-main {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 20px;
    }

    header h2 {
        font-size: 1.5em;
        margin: 0;
        color: var(--accent);
    }

    @supports (background-clip: text) or (-webkit-background-clip: text) {
        header h2 {
            background: linear-gradient(135deg, var(--accent), var(--accent-light));
            background-clip: text;
            /* padrão */
            -webkit-background-clip: text;
            /* webkit */
            color: transparent;
            -webkit-text-fill-color: transparent;
        }
    }


    .mobile-nav {
        display: none;
        /* Mais visível no tema claro */
        gap: 8px;
        justify-content: center;
        padding: 8px;
        background: var(--card);
        border-radius: 12px;
        border: 1px solid var(--progress-bg);
        margin-bottom: 20px;
        animation: slideDown 0.3s ease-out;
        box-shadow: 0 8px 20px var(--shadow);
    }

    /* Mantém o estilo translúcido/blur no tema escuro para contraste */
    .dark .mobile-nav {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }

    .mobile-nav.open {
        display: flex;
        /* Mostra quando aberto */
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-btn {
        flex: 1;
        padding: 12px 5px;
        border: none;
        background: transparent;
        color: var(--text);
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-size: 0.85em;
        opacity: 0.7;
    }

    .nav-btn.active {
        background: var(--card);
        color: var(--accent);
        box-shadow: 0 4px 15px var(--shadow);
        opacity: 1;
        transform: translateY(-2px);
    }

    .columns {
        flex-direction: column;
        display: block;
    }

    .column {
        width: 100%;
        display: none;
        margin-bottom: 0;
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 10px 0;
    }

    .column h3 {
        display: none;
    }

    .column.active-mobile {
        display: block;
        animation: slideIn 0.4s ease-out;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(20px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* Caso o usuário queira esconder os ícones de vez no Mobile e usar só hambúrguer, 
   mas aqui vamos manter os botões de tema/reset visíveis ao lado do hambúrguer se necessário.
   O hambúrguer aqui é mais conceitual para o menu de tabs. */

@media (max-width: 600px) {
    body {
        padding: 15px;
    }

    header h2 {
        font-size: 1.2em;
    }

    .nav-btn {
        padding: 8px 5px;
        font-size: 0.8em;
    }
}

/* --- ICON BUTTONS --- */
.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    background: transparent;
    /* Invisível conforme solicitado */
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--text);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: 0.3s;
    opacity: 0.8;
}

.icon-btn:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

/* Ocultar elementos novos no desktop */
.mobile-nav {
    display: none;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* --- MENU TOGGLE (HAMBURGER) --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    z-index: 1000;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}