/* ===============================
   CALENDÁRIO ALFISCONTA - CSS
   =============================== */

/* Container principal */
.calendar-container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(0,0,0,0.25);
    padding: 15px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

/* Cabeçalho */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header button {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.calendar-header button:hover {
    background: rgba(255,255,255,0.3);
}

#calendarTitle {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

/* Dias da semana */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    margin-bottom: 5px;
    padding: 5px 0;
}

.calendar-weekdays div {
    color: #fff;
}

.calendar-weekdays .weekend {
    color: #c00;
}

/* Grelha */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

/* Cada dia */
.calendar-day {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    min-height: 90px;
    padding: 6px;
    cursor: pointer;
    position: relative;
    border-radius: 4px;
    transition: background 0.2s;
    color: white;
}

.calendar-day:hover {
    background: rgba(255,255,255,0.12);
}

.calendar-day.empty {
    background: rgba(255,255,255,0.03);
    border: none;
    cursor: default;
}

/* Número do dia */
.calendar-day-number {
    font-weight: bold;
    margin-bottom: 6px;
}

/* Badges */
.badge {
    display: block;
    margin-bottom: 3px;
    padding: 2px 4px;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
}

/* Cores por categoria */
.badge-fiscal { background: #d9534f; }          /* Vermelho */
.badge-laboral { background: #0275d8; }         /* Azul escuro */
.badge-contabilistico { background: #5cb85c; }  /* Verde */
.badge-feriado { background: #f0ad4e; color: #000; } /* Amarelo */

/* Segurança Social */
.badge-ss { background: #007bff; }              /* Azul vibrante */


/* ===============================
   SIDEBAR — ESCURO TRANSLÚCIDO
   =============================== */

.day-sidebar {
    position: fixed;
    top: 80px;
    right: 0;
    width: 380px;
    height: calc(100vh - 80px);

    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);

    color: #fff;
    font-size: 12px;
    box-shadow: -4px 0 12px rgba(0,0,0,0.25);

    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: transform 0.3s ease;
}

.day-sidebar.hidden {
    transform: translateX(100%);
}

/* Header do sidebar */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;

    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);

    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #fff;
}

/* Botões fixos no topo */
.sidebar-header-buttons {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 8px;
    padding: 10px;

    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);

    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.action-btn {
    flex: 1;
    padding: 8px;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}

.action-btn.create  { background: rgba(0,150,255,0.6); }
.action-btn.edit    { background: rgba(255,200,0,0.7); color: #000; }
.action-btn.delete  { background: rgba(255,0,0,0.6); }

/* Área com scroll */
.sidebar-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* ===============================
   FORMULÁRIOS DO SIDEBAR
   =============================== */

.sidebar-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-form.hidden {
    display: none;
}

.sidebar-form h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

.sidebar-form label {
    margin-top: 8px;
    display: block;
    font-weight: 600;
    color: #fff;
    font-size: 13px;
}

.sidebar-form input,
.sidebar-form select,
.sidebar-form textarea {
    width: 100%;
    padding: 8px;
    margin-top: 4px;

    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;

    border-radius: 6px;
    font-size: 12px;
}

/* Botões do formulário (sticky) */
.sidebar-form-actions {
    position: sticky;
    bottom: 0;

    display: flex;
    justify-content: space-between;
    gap: 10px;

    padding: 12px;

    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);

    border-top: 1px solid rgba(255,255,255,0.15);
}

.cancel-btn,
.save-btn,
.delete-btn {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border: none;
}

.cancel-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.save-btn {
    background: rgba(0,180,0,0.7);
    color: #fff;
}

.delete-btn {
    background: rgba(255,0,0,0.7);
    color: #fff;
}

/* ===============================
   CARTÕES DE RESUMO
   =============================== */

.deadline-cards {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
    flex-wrap: nowrap;
}

.deadline-card-box {
    flex: 1 1 0;
    min-width: 250px;
    max-width: 25%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    box-sizing: border-box;
}

.deadline-card-box h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 6px;
}

.deadline-card-box .card-list div {
    margin-bottom: 6px;
    font-size: 13px;
}

/* Mobile */
@media (max-width: 700px) {
    .deadline-cards {
        flex-direction: column;
        flex-wrap: wrap;
    }

    .deadline-card-box {
        max-width: 100%;
    }
}

/* ===============================
   AJUSTES GERAIS
   =============================== */

/* Forçar estilo correto no dropdown (se quiseres mesmo isto global, mantém) */
select,
select option {
    background: #ffffff !important;
    color: #111827 !important;
}

/* Para selects dentro de modais */
.modal select {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #d1d5db;
}

/* ============================
   CARTÕES DE PRAZOS NO SIDEBAR
============================ */
.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.deadline-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    color: #fff;
}

.deadline-card:hover {
    background: rgba(255,255,255,0.15);
}

.deadline-card.selected {
    border: 2px solid #4da3ff;
    background: rgba(77,163,255,0.15);
}

.deadline-card h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
}

.deadline-card .deadline-meta {
    font-size: 12px;
    opacity: 0.85;
}

/* Ajuste do título */
.gc-title {
    text-align: center;
    margin-bottom: 20px;
}

/* Texto introdutório */
.section-text {
    font-size: 16px;
    line-height: 1.5;
}

/* Container do calendário */
.calendar-container {
    max-width: 900px;
    margin: 20px auto 0 auto; /* margem superior adicionada */
    background: rgba(0,0,0,0.25);
    padding: 15px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

/* Container geral */
.container {
    margin-top: 20px;
    margin-bottom: 30px;
}

/* Badge feriado mais legível */
.badge-feriado {
    background: #ffcc00;
    color: #000;
}

/* Sidebar mobile */
@media (max-width: 700px) {
    .day-sidebar {
        width: 100%;
        top: 60px;
        height: calc(100vh - 60px);
    }
}

/* ===============================
   RESPONSIVIDADE MOBILE
   =============================== */

@media (max-width: 600px) {

    /* Cartão mais respirável */
    .calendar-container {
        padding: 12px;
    }

    /* Título mais compacto */
    .gc-title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    /* Texto introdutório mais pequeno */
    .section-text {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Nota final mais discreta */
    .calendar-note,
    .text-muted {
        font-size: 12px;
        line-height: 1.3;
    }

    /* Header do calendário em coluna */
    .calendar-header {
        flex-direction: column;
        gap: 8px;
    }

    /* Título do mês mais pequeno */
    #calendarTitle {
        font-size: 18px;
    }

    /* Dias da semana mais compactos */
    .calendar-weekdays {
        font-size: 12px;
        padding: 3px 0;
    }

    /* Altura mínima dos dias reduzida */
    .calendar-day {
        min-height: 70px;
        padding: 4px;
    }

    /* Badges mais pequenos */
    .badge {
        font-size: 10px;
        padding: 2px 3px;
    }
}
