/* CSS Custom Properties */
:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --secondary-color: #90a4ae;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #ff5722;
    --info-color: #2196f3;
    
    --border-radius: 15px;
    --border-radius-sm: 6px;
    --border-radius-lg: 20px;
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    --shadow-sm: 0 2px 8px rgba(33, 150, 243, 0.08);
    --shadow-md: 0 10px 25px rgba(33, 150, 243, 0.15);
    --shadow-lg: 0 15px 35px rgba(33, 150, 243, 0.2);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --font-size-xs: 0.65rem;
    --font-size-sm: 0.75rem;
    --font-size-md: 0.85rem;
    --font-size-lg: 0.95rem;
}

/* Estilos gerais modernos */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Container principal */
.container {
    margin-top: 1rem;
}

/* Cards modernos */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(33, 150, 243, 0.1);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
    overflow: hidden;
}

.card-header {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md);
    font-weight: 600;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-size: var(--font-size-md);
}

.card-body {
    padding: var(--spacing-lg);
}

/* Calendário moderno */
.calendario-container {
    background: rgba(255, 255, 255, 0.98);
    
    overflow: hidden;
    position: relative;
}

/* Loading local do calendário */
.calendario-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 12px;
}

.calendario-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2rem;
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #bbdefb;
    
    padding: 1px;
    width: 100%;
}

.calendario-header {
    background: #1565c0;
    color: white;
    padding: 0.75rem 0.4rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.calendario-dia {
    background: white;
    height: 120px;
    padding: 8px;
    position: relative;
    
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendario-dia:hover {
    background: #f8fbff;
    transform: scale(1.005);
    box-shadow: var(--shadow-sm);
}

.calendario-dia.outro-mes {
    background: #f5f5f5;
    color: #9e9e9e;
}

.calendario-dia.hoje {
    background: #2196f3;
    color: white;
    border: 2px solid #fff;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

.dia-numero {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.calendario-dia.hoje .dia-numero {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Área dos eventos sem scroll interno */
.calendario-dia .eventos-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Eventos modernos */
.evento-item {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    margin: 0px 0;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.evento-item:hover {
    transform: scale(1.02) translateY(-1px);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.2);
    background: var(--primary-dark);
}

.evento-hora {
    font-size: 0.45rem;
    font-weight: 600;
    opacity: 0.8;
    line-height: 1;
}

.evento-nome {
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Todas as categorias em tons de azul */
.evento-item[class*="categoria-"] {
    background: var(--primary-color);
}

/* Diferenciação apenas por modalidade */
.evento-item.modalidade-ead {
    border-left: 4px solid var(--success-color);
    box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.3);
}

.evento-item.modalidade-pre {
    border-left: 4px solid var(--warning-color);
    box-shadow: inset 0 0 0 1px rgba(255, 152, 0, 0.3);
}

.evento-item.modalidade-mista,
.evento-item.modalidade-pea {
    border-left: 4px solid var(--danger-color);
    box-shadow: inset 0 0 0 1px rgba(255, 87, 34, 0.3);
}

/* Cards de eventos modernos */
.evento-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(33, 150, 243, 0.1);
}

.evento-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 12px 25px rgba(33, 150, 243, 0.12);
}

.evento-card .card-body {
    padding: 1rem;
}

.evento-card .card-title {
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* Badges modernos */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-categoria {
    background: #1976d2;
    color: white;
}

.badge-modalidade {
    background: #42a5f5;
    color: white;
}

/* Formulários modernos */
.form-select, .form-control {
    border-radius: 10px;
    border: 2px solid #e3f2fd;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.6rem 0.8rem;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-select:focus, .form-control:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
    background: white;
    transform: translateY(-1px);
}

.form-select:hover {
    border-color: #42a5f5;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* Botões modernos */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    font-size: 0.8rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.4);
}

.btn-outline-primary {
    border: 2px solid #2196f3;
    color: #2196f3;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #90a4ae;
    color: white;
}

/* Indicadores de status modernos */
.status-inscricao {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.status-inscricao.aberta {
    background: var(--success-color);
}

.status-inscricao.fechada {
    background: var(--danger-color);
}

.status-inscricao.em-breve {
    background: var(--warning-color);
}

/* Contador de eventos moderno */
.contador-eventos {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: #1976d2;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
    border: 1px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contador-eventos:hover {
    background: #1565c0;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* Eventos do dia no modal */
.eventos-dia-lista {
    max-height: 350px;
    overflow-y: auto;
}

.evento-dia-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(33, 150, 243, 0.2) !important;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.evento-dia-item:hover {
    background: rgba(33, 150, 243, 0.05);
    border-color: #2196f3 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.evento-dia-item h6 {
    color: #1565c0;
    font-weight: 600;
    font-size: 0.9rem;
}

.evento-dia-item .badge {
    font-size: 0.6rem;
}

/* Modal moderno */
.modal-content {
    border-radius: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: #1976d2;
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
}

.modal-body {
    padding: 1.5rem;
    color: #37474f;
    font-size: 0.85rem;
}

.modal-footer {
    border: none;
    padding: 1rem 1.5rem;
}

/* Legenda discreta abaixo do calendário */
.legenda-discreta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 10px;
    background: rgba(245, 245, 245, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 1px;
    flex-wrap: wrap;
}

.legenda-secao {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.legenda-titulo {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    margin-right: 5px;
}

.legenda-separador {
    width: 1px;
    height: 25px;
    background: rgba(0, 0, 0, 0.15);
    margin: 0 5px;
}

.legenda-item-pequena {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legenda-item-pequena span {
    font-size: 0.65rem;
    color: #888;
    font-weight: 500;
}

.cor-pequena {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.cor-pequena.modalidade-ead {
    background: #1976d2;
    border-left: 3px solid var(--success-color);
    width: 10px;
}

.cor-pequena.modalidade-pre {
    background: #1976d2;
    border-left: 3px solid var(--warning-color);
    width: 10px;
}

.cor-pequena.modalidade-mista {
    background: #1976d2;
    border-left: 3px solid var(--danger-color);
    width: 10px;
}

/* Bolinhas de status para a legenda */
.status-bolinha {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.status-bolinha.aberta {
    background: var(--success-color);
}

.status-bolinha.em-breve {
    background: var(--warning-color);
}

.status-bolinha.fechada {
    background: var(--danger-color);
}

/* Alertas modernos */
.alert {
    border-radius: 15px;
    border: none;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #d32f2f;
    border-left: 4px solid #f44336;
}

/* Scrollbar moderna */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #1976d2;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1565c0;
}

/* Responsividade moderna */
@media (max-width: 768px) {
    .calendario-dia {
        height: 100px;
        padding: 6px;
    }
    
    .evento-item {
        font-size: 0.6rem;
        padding: 3px 5px;
        margin: 1px 0;
    }
    
    .evento-hora {
        font-size: 0.5rem;
    }
    
    .evento-nome {
        font-size: 0.55rem;
    }
    
    .dia-numero {
        font-size: 0.8rem;
    }
    
    .calendario-header {
        padding: 0.6rem 0.2rem;
        font-size: 0.65rem;
        letter-spacing: 0.2px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .contador-eventos {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
        bottom: 4px;
        right: 4px;
    }
    
    /* Legenda responsiva - tablet */
    .legenda-discreta {
        gap: 20px;
        padding: 12px 15px;
    }
    
    .legenda-secao {
        gap: 12px;
    }
    
    .legenda-titulo {
        font-size: 0.63rem;
        margin-right: 4px;
    }
    
    .legenda-separador {
        height: 22px;
        margin: 0 4px;
    }
    
    .legenda-item-pequena span {
        font-size: 0.58rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .calendario-dia {
        height: 85px;
        padding: 4px;
    }
    
    .evento-item {
        font-size: 0.55rem;
        margin: 1px 0;
        padding: 2px 4px;
    }
    
    .evento-hora {
        display: none;
    }
    
    .evento-nome {
        font-size: 0.55rem;
    }
    
    .card {
        margin-bottom: 0.75rem;
    }
    
    .calendario-header {
        padding: 0.4rem 0.1rem;
        font-size: 0.6rem;
        letter-spacing: 0.1px;
    }
    
    .contador-eventos {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
        bottom: 3px;
        right: 3px;
    }
    
    /* Legenda legível para celular */
    .legenda-discreta {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 4px;
        padding: 6px 8px;
        font-size: 0.6rem;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .legenda-secao {
        display: flex;
        flex-direction: row;
        gap: 3px;
        align-items: center;
        white-space: nowrap;
        min-width: 0;
    }
    
    .legenda-titulo {
        display: none;
    }
    
    .legenda-separador {
        display: none;
    }
    
    .legenda-item-pequena {
        gap: 3px;
        align-items: center;
        min-width: 0;
        margin: 0 3px;
    }
    
    .legenda-item-pequena span {
        font-size: 0.6rem;
        font-weight: 500;
        white-space: nowrap;
    }
    
    .cor-pequena, .status-bolinha {
        width: 9px;
        height: 9px;
        flex-shrink: 0;
        margin-right: 3px;
    }
    
    .cor-pequena.modalidade-ead,
    .cor-pequena.modalidade-pre,
    .cor-pequena.modalidade-mista {
        width: 8px;
        border-left-width: 2px;
    }
}

/* Legenda para telas muito pequenas */
@media (max-width: 400px) {
    .legenda-discreta {
        padding: 4px 6px;
        gap: 2px;
        font-size: 0.55rem;
    }
    
    .legenda-secao {
        gap: 2px;
    }
    
    .legenda-item-pequena {
        gap: 2px;
        margin: 0 2px;
    }
    
    .legenda-item-pequena span {
        font-size: 0.55rem;
    }
    
    .cor-pequena, .status-bolinha {
        width: 8px;
        height: 8px;
        margin-right: 2px;
    }
    
    .cor-pequena.modalidade-ead,
    .cor-pequena.modalidade-pre,
    .cor-pequena.modalidade-mista {
        width: 7px;
        border-left-width: 2px;
    }
} 