:root {
    --bg-dark: #1C1E27;
    --bg-sidebar: #14151C;
    --bg-panel: #111217;
    --bg-input: #14151C;
    --border: #203656;
    /* Cores de Identidade do NEXUS */
    --primary: #4A6382;
    --accent: #22d3ee;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;

    /* Textos otimizados para leitura neste fundo */
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- LOGIN SCREEN --- */
/* --- LOGIN SCREEN (Com Imagem Local) --- */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-color: #111;

    /* AQUI ESTÁ O SEGREDO DA CLARIDADE */
    background-image:
        /* Camada Escura Suave (0.2 até 0.4) - Deixa passar muito mais luz */
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.4)),

        /* Sua imagem salva na pasta */
        url('fundo-studio.jpg');

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.logo-container {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
    z-index: 2;
    text-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
    animation: float 3s infinite ease-in-out;
}

.tech-c-logo-svg {
    width: 130px;
    height: 130px;


    animation: pulseGlow 3s infinite ease-in-out;

    overflow: visible;
}

/* Nova animação: O chip acende e apaga suavemente */
@keyframes pulseGlow {

    0%,
    100% {
        opacity: 1;
        /* Totalmente visível */
        transform: scale(1);
        /* Tamanho normal */
        filter: drop-shadow(0 0 25px #22d3ee);
        /* Brilho estourado (Neon forte) */
    }

    50% {
        opacity: 0.2;
        /* Quase sumindo (20% visível) */
        transform: scale(0.92);
        /* Encolhe um pouco */
        filter: drop-shadow(0 0 5px #22d3ee);
        /* Brilho fraco */
    }
}

.login-box {
    width: 405px;
    padding: 50px 40px;
    border-radius: 16px;
    background: rgba(232, 220, 220, 0.0);
    /* O 0.6 é a transparência (vai de 0.0 até 1.0) */
    backdrop-filter: blur(10px);
    /* Adiciona o efeito de "vidro embaçado" no fundo */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Borda mais sutil para combinar */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 2;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-title {
    margin-bottom: 30px;
    font-family: 'Fira Code';
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 2rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

.input-group-login {
    position: relative;
    margin-bottom: 25px;
    text-align: left;
}

.login-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    color: white;
    font-family: 'Fira Code';
    font-size: 0.95rem;
    transition: 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-panel);
}

.login-input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-highlight {
    display: none;
}

.btn-login {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Inter';
    letter-spacing: 1px;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
}

.btn-login:hover {
    transform: translateY(-2px);
    background: #4f46e5;
}

#login-error {
    margin-top: 15px;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(248, 113, 113, 0.1);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(248, 113, 113, 0.2);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* --- APP LAYOUT --- */
#app-container {
    display: none;
    flex: 1;
    height: 100%;
    display: flex;
}

/* --- SIDEBAR CUSTOMIZADA COM IMAGEM MAIS VISÍVEL --- */
.sidebar {
    width: 340px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
    transition: width 0.3s ease, padding 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;

    background-image: 
        linear-gradient(rgba(20, 21, 28, 0.70), rgba(20, 21, 28, 0.70)),
        url('fundo-studio.jpg');
    
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Estilizando a barra de rolagem da própria Sidebar (para ficar discreta) */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    /* Usa a cor azul escura da sua paleta */
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.nav-list {
    flex: 1;
    min-height: 150px;
    overflow-y: auto;
    /* Mantém a rolagem interna dos projetos */
    overflow-x: hidden;
    margin-bottom: 10px;
    padding-right: 5px;
}

.nav-list::-webkit-scrollbar {
    width: 4px;
}

.nav-list::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}

.nav-list::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .btn-ghost[onclick="logout()"] {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Uma linha sutil separando o rodapé */
}

.sidebar.closed {
    width: 0;
    padding: 0;
    border: none;
}

/* A sidebar continua com overflow-y: auto */

.nav-item {
    padding: 12px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-muted);
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-new-materia {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 0.9rem;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-new-materia:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* --- ORGANIZAÇÃO POR SEMESTRES NA SIDEBAR --- */
.semester-group {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.semester-header {
    padding: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.semester-header:hover {
    color: white;
    background: rgba(255, 255, 255, 0.02);
}

.semester-header i {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.semester-header.active {
    color: var(--primary);
}

.semester-header.active i {
    transform: rotate(90deg);
}

.semester-content {
    display: none;
    padding-left: 10px;
    background: rgba(0, 0, 0, 0.2); /* Um pouco mais transparente */
    border-radius: 6px;
    margin-top: 5px;
}

.semester-content.open {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* BARRA DE PESQUISA */
.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 15px;
}

.search-wrapper:focus-within {
    border-color: var(--primary);
}

.search-wrapper i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-wrapper input {
    background: transparent;
    border: none;
    color: white;
    margin-left: 10px;
    width: 100%;
    outline: none;
    font-family: 'Inter';
    font-size: 0.9rem;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    background: var(--bg-dark);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.title-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Inter';
    width: 100%;
    text-transform: uppercase;
}

.title-input:focus {
    outline: none;
    border-bottom: 1px solid var(--primary);
}

.title-input:hover {
    opacity: 0.8;
}

.btn-delete-materia {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    margin-left: 15px;
}

.btn-delete-materia:hover {
    background: var(--danger);
    color: white;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-val {
    font-family: 'Fira Code';
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 5px;
}

/* --- MINI GRÁFICO DO DASHBOARD --- */
.mini-chart-container {
    display: flex;
    gap: 15px;
    height: 70px;
    align-items: flex-end;
    margin-right: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    width: 25px;
}

.chart-bar-fill {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 3px; /* Garante que nunca suma totalmente */
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.chart-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-family: 'Fira Code';
    font-weight: bold;
}

/* --- GRID DE SEMANAS (DASHBOARD) --- */
.weeks-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.week-square-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.week-square-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: var(--bg-panel);
}

.week-number {
    font-family: 'Fira Code';
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.4;
    transition: 0.3s;
}

.week-square-card:hover .week-number {
    color: var(--accent);
    opacity: 1;
}

.week-info {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-dot {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3f3f46;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

/* CARD GERAL (ESPECIAL) */
.card-general-highlight {
    border: 2px dashed var(--accent) !important;
}

.card-general-highlight i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.card-general-highlight:hover {
    background: rgba(34, 211, 238, 0.1) !important;
}

/* --- WEEK DETAIL (FOCUSED) --- */
.week-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.btn-back {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    background: var(--text-main);
    color: var(--bg-dark);
    transform: translateX(-3px);
}

/* --- GRID DE TAREFAS (GIGANTE) --- */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.task-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px; /* DIMINUÍDO (antes era 25px) */
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    min-height: 120px; /* DIMINUÍDO (antes era 180px) */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.type-info {
    border-left: 4px solid #bababa;
}

.type-video {
    border-left: 4px solid var(--accent);
}

.type-exercicio {
    border-left: 4px solid var(--success);
}

.type-extra {
    border-left: 4px solid var(--warning);
}

.type-avaliativa {
    border-left: 4px solid var(--danger);
}

/* Tipos Gerais */
.type-link {
    border-left: 4px solid var(--accent);
}

.type-file {
    border-left: 4px solid var(--warning);
}

.type-note {
    border-left: 4px solid #999;
}

.type-map {
    border-left: 4px solid #d946ef;
}

.task-card:hover {
    transform: translateY(-5px);
    border-color: #555;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Status Concluído */
.task-card.done {
    opacity: 0.7;
    border: 2px solid var(--success);
    background: rgba(47, 244, 8, 0.2);
}

.task-card.done .task-title {
    color: var(--success);
    font-weight: 700;
}

.type-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #000000;
    font-weight: 800;
}

.task-title {
    font-size: 1.05rem; /* DIMINUÍDO (antes era 1.2rem) */
    font-weight: 600;
    margin-bottom: 8px; /* DIMINUÍDO */
    word-break: break-word;
    line-height: 1.4;
    color: var(--text-main);
}

.task-objective {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 10px;
    margin-bottom: 10px;
    line-height: 1.4;
    display: none !important;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-add-card {
    width: 100%;
    padding: 15px;
    border: 1px dashed var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    margin-top: 10px;
    transition: 0.2s;
    font-size: 1rem;
}

.btn-add-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* --- TELA DE LINKS ÚTEIS --- */
.links-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.link-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.link-card:hover {
    border-color: var(--success);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.15);
}

.link-abbr {
    font-family: 'Fira Code';
    font-size: 2.1rem;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
}

.link-url-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-delete-link {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.link-card:hover .btn-delete-link {
    color: var(--danger);
}

.link-card-add {
    border: 2px dashed var(--border);
    border-radius: 12px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    width: 200px;
}

.link-card-add:hover {
    border-color: var(--success);
    color: var(--success);
}

/* --- CALENDÁRIO VISUAL --- */
.calendar-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    height: calc(100% - 100px);
    grid-auto-rows: minmax(100px, 1fr);
}

.calendar-day {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
    min-height: 100px;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    pointer-events: none;
}

.calendar-day.today {
    border: 1px solid var(--accent);
    background: rgba(34, 211, 238, 0.05);
}

.day-number {
    font-weight: bold;
    font-size: 1.1rem;
    position: absolute;
    top: 10px;
    right: 10px;
}

.calendar-day.today .day-number {
    color: var(--accent);
}

.calendar-event-chip {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 4px;
    display: block;
    font-weight: bold;
    /* Adicionado para os textos longos não quebrarem o calendário */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Novas classes de cores para os eventos */
.chip-blue {
    background-color: #07337b;
    /* Seu azul original */
    color: #ffffff;
}

.chip-green {
    background-color: var(--success);
    color: #000000;
}

.chip-yellow {
    background-color: var(--warning);
    color: #000000;
}

.chip-red {
    background-color: var(--danger);
    color: #ffffff;
}

.event-item-list {
    background: var(--bg-input);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-window {
    background: var(--bg-panel);
    width: 80vw;
    max-width: 95vw;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 var(--bg-panel);
}

/* --- LAYOUT GRID DO MODAL (NOVO) --- */
.modal-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px !important;
}

.modal-col {
    display: flex;
    flex-direction: column;
}

#task-modal .form-group {
    margin-bottom: 15px !important;
}

/* ---------------------------------- */

.modal-title-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 3px solid var(--primary);
    font-size: 1.5rem;
    color: white;
    margin-bottom: 20px;
    padding-bottom: 10px;
    font-weight: 800;
}

.modal-title-input:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.modal-input,
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-family: 'Inter';
    font-size: 1rem;
    transition: 0.2s;
}

.modal-input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: #1e1e20;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
}

.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: #22d3ee;
    transform: scale(1.02);
}

.modal-actions label {
    font-size: 1.2rem;
}

.modal-actions input[type="checkbox"] {
    transform: scale(1.5);
    margin-right: 10px;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-ghost:hover {
    background: transparent;
    transform: scale(1.1);
    color: var(--danger);
}

.btn-ghost:focus {
    outline: none;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

/* Adicione isso ao seu arquivo style.css */
.link-card {
    cursor: grab;
    /* Mostra a mãozinha */
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.link-card:active {
    cursor: grabbing;
}

/* Classe que será aplicada ao elemento enquanto ele é arrastado */
.link-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--accent);
    transform: scale(0.95);
}

/* Classe para o alvo onde o card vai cair (opcional, para feedback visual) */
.link-card.drag-over {
    border: 2px solid var(--success);
}

/* Logo reduzido para a Barra Lateral */
.sidebar-logo-size {
    width: 50px;
    /* Tamanho ideal para o menu */
    height: 50px;

    /* Usa a mesma animação de pulso da tela de login */
    animation: pulseGlow 3s infinite ease-in-out;

    overflow: visible;
    flex-shrink: 0;
    /* Garante que o logo não seja "esmagado" se o texto for grande */
}

/* --- DRAG AND DROP VISUAL --- */

/* Adicionado .task-card aqui para funcionar nos cards de matéria e geral */
.link-card,
.task-card {
    cursor: grab;
    /* Mãozinha aberta */
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.link-card:active,
.task-card:active {
    cursor: grabbing;
    /* Mãozinha fechada */
}

/* Quando está sendo arrastado */
.link-card.dragging,
.task-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--accent);
    transform: scale(0.95);
}

/* Quando passa por cima de outro (alvo) */
.link-card.drag-over,
.task-card.drag-over {
    border: 2px solid var(--success);
    transform: scale(1.02);
}

/* --- GRADE HORÁRIA --- */
.schedule-grid {
    display: grid;
    /* MUDANÇA AQUI: de repeat(5, 1fr) para repeat(7, 1fr) */
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 50px;
    /* Um espaço extra no final ajuda a visualizar */
}

.schedule-header {
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
    padding: 10px;
    background: var(--bg-panel);
    border-radius: 6px;
}

.schedule-cell {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-height: 80px;
    padding: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.schedule-cell:hover {
    border-color: var(--accent);
    background: var(--bg-panel);
}

/* --- ESTILOS DOS GRUPOS DA GRADE --- */

/* Cabeçalho dos Dias (Fixo no topo) */
.schedule-days-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
}

/* O container de cada período (Manhã/Tarde/Noite) */
.period-container {
    margin-bottom: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

/* O Botão/Barra do Título do Período */
.period-header {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Fira Code';
    font-weight: bold;
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: 0.2s;
}

.period-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Ícone da seta */
.period-header i {
    transition: transform 0.3s;
}

/* Classe para quando estiver fechado */
.period-container.collapsed .period-content {
    display: none;
}

.period-container.collapsed .period-header {
    border-bottom: none;
    opacity: 0.7;
}

.period-container.collapsed .period-header i {
    transform: rotate(-90deg);
}

/* O Grid interno de cada período */
.period-content {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    /* Mesma medida dos dias */
    gap: 10px;
    padding: 10px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

/* --- KANBAN --- */
.kanban-board {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
}

.kanban-column {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    text-align: center;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 10px;
    font-family: 'Fira Code';
}

.kanban-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.kanban-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    /* Muda de 'grab' para 'pointer' (mãozinha) */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: 0.2s;
    /* Animação suave */
}

.kanban-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    /* Dá um pequeno pulinho para cima */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.kanban-card:hover i.fa-arrow-up-right-from-square {
    opacity: 1 !important;
    color: var(--accent) !important;
}

.kanban-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
    display: inline-block;
}

/* --- MARKDOWN PREVIEW --- */
.markdown-preview {
    background: var(--bg-panel);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
    min-height: 150px;
    margin-top: 10px;
    display: none;
    /* Oculto por padrão */
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.markdown-preview h1,
.markdown-preview h2 {
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    margin-top: 10px;
}

.markdown-preview code {
    background: #333;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Fira Code';
}

.markdown-preview ul {
    margin-left: 20px;
}

/* Etiqueta da Matéria no Kanban */
.card-subject-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bg-dark);
    /* Texto escuro para contraste */
    background: var(--primary);
    /* Fundo claro */
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botão de Excluir Semana (No canto do card) */
.btn-delete-week {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--danger);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    /* Escondido por padrão */
    transition: 0.2s;
    z-index: 10;
}

.week-square-card:hover .btn-delete-week {
    opacity: 1;
    /* Aparece ao passar o mouse no card */
}

.btn-delete-week:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

/* Card de Adicionar Nova Semana */
.week-add-card {
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-muted);
}

.week-add-card:hover {
    border-color: var(--success);
    color: var(--success);
    background: rgba(52, 211, 153, 0.05);
    transform: translateY(-5px);
}

.week-add-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* --- ANIMAÇÃO ESTILO LOGO --- */
.footer-animation {
    /* Reutiliza a lógica da animação do chip do login/sidebar */
    animation: pulseGlowFooter 3s infinite ease-in-out;
    text-shadow: 0 0 5px var(--accent);
}

/* Criamos uma variação específica para o texto não sumir tanto quanto o ícone */
@keyframes pulseGlowFooter {

    0%,
    100% {
        opacity: 0.8;
        filter: drop-shadow(0 0 8px var(--accent));
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        filter: drop-shadow(0 0 2px var(--accent));
        transform: scale(0.98);
    }
}

/* Ajuste na classe base para garantir visibilidade */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 4px;
    text-align: center;
    font-size: 0.75rem;
    font-family: 'Fira Code', monospace;
    color: var(--accent);
    /* Usando o ciano do projeto */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    letter-spacing: 1px;
    pointer-events: none;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
}

/* --- BOTÕES DE LINK INTELIGENTES (SMART LINKS) --- */

.smart-link-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.btn-smart-link {
    flex: 1;
    /* Ocupa o espaço todo */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    border: 1px dashed var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Inter';
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.5;
    /* Opaco por padrão (vazio) */
}

.btn-smart-link:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* Estado PREENCHIDO (Ativado via JS) */
.btn-smart-link.filled {
    border-style: solid;
    border-color: var(--accent);
    /* Ciano do tema */
    background: rgba(34, 211, 238, 0.15);
    color: white;
    opacity: 1;
    /* Totalmente visível */
    box-shadow: 0 4px 10px rgba(34, 211, 238, 0.2);
}

.btn-smart-link.filled:hover {
    transform: translateY(-2px);
    background: rgba(34, 211, 238, 0.25);
}

/* Botão de Edição (Lápis) */
.btn-smart-edit {
    width: 45px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
}

.btn-smart-edit:hover {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
}

/* --- CSS DO MODAL DE LEMBRETES DIÁRIOS --- */
.daily-reminder-item {
    background: var(--bg-input);
    padding: 12px;
    border-left: 3px solid var(--accent);
    margin-bottom: 8px;
    color: white;
    font-size: 0.95rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.daily-reminder-item i {
    color: inherit;
    font-size: 0.8rem;
}

/* Badge de horário */
.event-time-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    margin-right: 8px;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Logo animado */
.daily-modal-logo {
    width: 80px;
    height: 80px;
    animation: pulseGlow 3s infinite ease-in-out;
}

/* Borda Sincronizada */
@keyframes borderPulse {

    0%,
    100% {
        border-color: rgba(34, 211, 238, 1);
        box-shadow: 0 0 25px rgba(34, 211, 238, 0.6), inset 0 0 10px rgba(34, 211, 238, 0.2);
    }

    50% {
        border-color: rgba(34, 211, 238, 0.3);
        box-shadow: 0 0 5px rgba(34, 211, 238, 0.1), inset 0 0 0 transparent;
    }
}

.daily-reminder-glow {
    border: 1.5px solid var(--accent);
    animation: borderPulse 3s infinite ease-in-out;
}

/* Remove as setinhas (spinners) dos inputs de número */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    /* Para funcionar no Firefox */
    appearance: textfield;
}

/* Força a quebra de palavras longas também no modal para manter a leitura fluida */
#note-content-input {
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
    /* Evita scroll horizontal indesejado */
}

/* Feedback visual para imagens editáveis dentro da nota */
#note-content-input img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
    cursor: pointer;
    /* Muda o mouse para a "mãozinha" */
    transition: all 0.2s;
    border: 2px solid transparent;
}

/* Quando passar o mouse por cima da imagem, ela ganha uma borda ciano */
#note-content-input img:hover {
    border-color: var(--accent);
    opacity: 0.8;
}

/* Botão de PDF dentro do Bloco/Semana */
.btn-print-week {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--accent);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: 0.2s;
    z-index: 10;
}

.week-square-card:hover .btn-print-week {
    opacity: 1;
}

.btn-print-week:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

/* Customização dos itens na lista do Modal */
.print-task-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-input);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.print-task-item:hover {
    border-color: var(--accent);
}

.print-task-item input[type="checkbox"] {
    transform: scale(1.3);
    cursor: pointer;
}

/* ==========================================
   CSS DA LISTA DE TAREFAS GLOBAL 
   ========================================== */

.g-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel);
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.g-task-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Estado Pendente (Amarelo) */
.g-task-item.pending {
    border-left: 5px solid var(--warning);
}

/* Estado Concluído (Verde) - Sem texto riscado */
.g-task-item.completed {
    border-left: 5px solid var(--success);
    background: rgba(52, 211, 153, 0.03);
    opacity: 0.8;
}

.g-task-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    transition: 0.3s;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}

.g-task-item.completed .g-task-title {
    color: var(--success);
    /* Fica verde ao invés de riscar */
}

.g-task-date {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Checkbox Customizado com vibe Nexus */
.g-task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--warning);
    /* Borda amarela por padrão */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
}

.g-task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    transform: scale(1.1);
}

.g-task-checkbox.checked::after {
    content: '\f00c';
    /* Ícone de check do FontAwesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #000;
    font-size: 14px;
}

/* Botão de excluir */
.g-task-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.g-task-delete-btn:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

.type-lista_tarefas {
    border-left: 4px solid #f97316;
    /* Laranja estilo "alerta/tarefa" */
}
/* --- BOTÃO DE FIXAR (PIN) --- */
.btn-pin {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0px 5px;
    transition: 0.2s;
    opacity: 0.3;
}

.btn-pin:hover {
    color: var(--warning);
    opacity: 1;
}

.btn-pin.pinned {
    color: var(--warning);
    opacity: 1;
    transform: rotate(-45deg); /* Dá um charmezinho de tachinha inclinada */
}