/*
 * ARQUIVO: calendar.css
 * DESCRIÇÃO: Estilos para a página de calendário com design de barrinhas verticais.
 * VERSÃO: 3.2.1 - Design de Barrinhas Verticais com Sync Inteligente
 */

/* Container principal com scroll e fundo fixo */
.calendar-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 0px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Cabeçalho */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    gap: 10px;
}

body.dark-mode .calendar-header {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

.calendar-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    flex: 1;
    color: #ffffff;
}

body.dark-mode .calendar-header h1 {
    color: #ffffff;
}

.back-button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
}

body.dark-mode .back-button {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.header-spacer {
    width: 50px;
}

/* Resumo do Progresso */
.progress-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    transition: all 0.3s ease;
}

body.dark-mode .summary-card {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.summary-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.8;
    color: #ffffff;
}

body.dark-mode .summary-label {
    color: #ffffff;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-gold, #ffd700);
}

/* Container dos meses */
.months-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    flex: 1;
}

/* Cada mês */
.month {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

body.dark-mode .month {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

.month-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.3s ease;
    color: #ffffff;
}

body.dark-mode .month-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    color: #ffffff;
}

.month-header:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
}

.month-toggle-icon {
    font-size: 11px;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.month.collapsed .month-toggle-icon {
    transform: rotate(-90deg);
}

/* Grid dos dias - Compacto */
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 12px;
    max-height: 400px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.month.collapsed .days-grid {
    max-height: 0;
    padding: 0 12px;
    opacity: 0;
}

/* Cabeçalho dos dias da semana */
.weekday-header {
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    opacity: 0.7;
    padding: 4px 0;
    letter-spacing: 0.3px;
    color: #ffffff;
}

body.dark-mode .weekday-header {
    color: #ffffff;
}

/* Cada dia - Com barrinhas verticais */
.day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    margin-bottom: 5px;
    min-width: 28px;
    min-height: 32px;
    padding: 3px 2px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-mode .day {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Número do dia */
.day-number {
    font-size: 8px;
    font-weight: 700;
    margin-bottom: 2px;
    margin-top: 10px;
    color: #ffffff;
    text-align: center;
    width: 100%;
}

body.dark-mode .day-number {
    color: #ffffff;
}

/* Container das barrinhas */
.day-bars {
    display: flex;
    gap: 1px;
    width: 100%;
    height: 12px;
    margin-top: 1px;
    margin-bottom: 5px;
    justify-content: center;
}

/* Cada barrinha vertical */
.day-bar {
    flex: 1;
    height: 100%;
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

body.dark-mode .day-bar {
    background: rgba(255, 255, 255, 0.15);
}

/* Barrinha ativa (oração feita) */
.day-bar.active {
    background: var(--bar-color, #2ECC71);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

/* Cores das barrinhas por oração */
.day-bar.laudes.active {
    background: #FF6B6B; /* Vermelho */
}

.day-bar.hora-media.active {
    background: #4ECDC4; /* Azul-verde */
}

.day-bar.vesperas.active {
    background: #FFD93D; /* Amarelo */
}

.day-bar.completas.active {
    background: #6BCB77; /* Verde */
}

/* Hover nos dias */
.day:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

/* Legenda */
.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    color: #ffffff;
}

body.dark-mode .legend {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.legend-color.laudes {
    background: #FF6B6B;
}

.legend-color.hora-media {
    background: #4ECDC4;
}

.legend-color.vesperas {
    background: #FFD93D;
}

.legend-color.completas {
    background: #6BCB77;
}

/* Botões de Ação */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 15px;
    margin-bottom: 20px;
}

.action-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-poppins), sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

body.dark-mode .action-btn {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Sincronização Google Drive */
.sync-actions {
    display: flex;
    gap: 12px;
}

.sync-btn-auth {
    background: rgba(66, 133, 244, 0.25);
    border-color: rgba(66, 133, 244, 0.4);
}

.sync-btn-auth:hover {
    background: rgba(66, 133, 244, 0.4);
}

/* Estado Automático (Verde) */
.sync-btn-auth.active-auto {
    background: rgba(34, 197, 94, 0.3) !important;
    color: #2ecc71 !important;
    border-color: rgba(46, 204, 113, 0.5) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Estado Manual (Vermelho) */
.sync-btn-auth.active-manual {
    background: rgba(239, 68, 68, 0.3) !important;
    color: #ff6b6b !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-btn-auth span:first-child {
    font-size: 14px;
}

.sync-btn-auth.active-auto span:first-child {
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-btn-logout {
    background: rgba(234, 67, 53, 0.25);
    border-color: rgba(234, 67, 53, 0.4);
}

.sync-btn-logout:hover {
    background: rgba(234, 67, 53, 0.4);
}

.sync-status-text {
    font-size: 11px;
    text-align: center;
    margin-top: -10px;
    margin-bottom: 15px;
    color: #ffffff;
    opacity: 0.8;
    font-family: var(--font-poppins), sans-serif;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sync-status-text.success {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
    opacity: 1;
}

.sync-status-text.error {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    opacity: 1;
}

.sync-status-text.default {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Responsivo para Mobile */
@media (max-width: 600px) {
    .calendar-container {
        padding: 12px;
    }

    .calendar-header {
        padding: 10px 12px;
        margin-bottom: 15px;
        flex-direction: row;
        gap: 8px;
        justify-content: space-between;
    }

    .calendar-header h1 {
        font-size: 14px;
        order: 2;
        flex: 1;
        text-align: center;
    }

    .back-button {
        order: 1;
        width: auto;
        text-align: center;
        padding: 8px 12px;
        font-size: 10px;
        white-space: nowrap;
    }

    .header-spacer {
        display: none;
    }

    .progress-summary {
        gap: 10px;
        margin-bottom: 15px;
    }

    .summary-card {
        padding: 10px 14px;
        min-width: 85px;
    }

    .action-buttons {
        gap: 8px;
    }

    .action-btn {
        padding: 10px 12px;
        font-size: 10px;
        min-width: 80px;
    }
}

/* MODAIS PERSONALIZADOS */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

body.dark-mode .modal-content {
    background: #2a2a2a;
    color: #ffffff;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    font-weight: bold;
}

.success-modal .modal-icon { color: #22c55e; }
.error-modal .modal-icon { color: #ef4444; }

.modal-message {
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

.modal-button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-modal .modal-button { background: #22c55e; color: white; }
.error-modal .modal-button { background: #ef4444; color: white; }


/* ========================================
   BARRA DE ROLAGEM PERSONALIZADA
   Tons de cinza escuro e claro
   ======================================== */

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a; /* Cinza muito escuro */
}

::-webkit-scrollbar-thumb {
    background: #4a4a4a; /* Cinza claro */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #6a6a6a; /* Cinza ainda mais claro no hover */
    box-shadow: 0 0 8px rgba(100, 100, 100, 0.4);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #4a4a4a #1a1a1a;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #4a4a4a;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #6a6a6a;
    box-shadow: 0 0 8px rgba(100, 100, 100, 0.4);
}

body.light-mode ::-webkit-scrollbar-track {
    background: #e8e8e8; /* Cinza claro para modo light */
}

body.light-mode ::-webkit-scrollbar-thumb {
    background: #999999; /* Cinza médio */
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: #777777; /* Cinza mais escuro no hover */
    box-shadow: 0 0 8px rgba(100, 100, 100, 0.3);
}
