/**
 * Custom CSS - Sistema de Gestão de Mensalidades
 * Estilos personalizados e responsivos
 */

/* Reset e Base */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-bg: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos para horários no select */
.form-select option:disabled {
    color: #6c757d;
    font-style: italic;
    background-color: #f8f9fa;
}

.form-select option:not(:disabled) {
    color: #212529;
    font-weight: 500;
}

.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Cores das bolinhas do FullCalendar - apenas a bolinha, não o background */
.fc-daygrid-event-dot,
.fc-list-event-dot,
.fc-timegrid-event-dot {
    border-radius: 50% !important;
    width: 8px !important;
    height: 8px !important;
    margin-right: 8px !important;
    flex-shrink: 0 !important;
}

/* Eventos concluídos sempre ficam verdes na bolinha (prioridade máxima) */
.fc-event[data-status="concluido"] .fc-daygrid-event-dot,
.fc-event[data-status="concluido"] .fc-list-event-dot,
.fc-event[data-status="concluido"] .fc-timegrid-event-dot {
    background-color: #22c55e !important;
    border-color: #16a34a !important;
}

/* Eventos cancelados sempre ficam vermelhos na bolinha (prioridade máxima) */
.fc-event[data-status="cancelado"] .fc-daygrid-event-dot,
.fc-event[data-status="cancelado"] .fc-list-event-dot,
.fc-event[data-status="cancelado"] .fc-timegrid-event-dot {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Cores específicas por tipo de evento - apenas para a bolinha (se não estiver cancelado ou concluido) */
.fc-event[data-tipo="aula"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-daygrid-event-dot,
.fc-event[data-tipo="aula"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-list-event-dot,
.fc-event[data-tipo="aula"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-timegrid-event-dot {
    background-color: #3788d8 !important;
    border-color: #3788d8 !important;
}

.fc-event[data-tipo="evento"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-daygrid-event-dot,
.fc-event[data-tipo="evento"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-list-event-dot,
.fc-event[data-tipo="evento"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-timegrid-event-dot {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
}

.fc-event[data-tipo="palestra"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-daygrid-event-dot,
.fc-event[data-tipo="palestra"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-list-event-dot,
.fc-event[data-tipo="palestra"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-timegrid-event-dot {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
}

.fc-event[data-tipo="workshop"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-daygrid-event-dot,
.fc-event[data-tipo="workshop"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-list-event-dot,
.fc-event[data-tipo="workshop"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-timegrid-event-dot {
    background-color: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
}

.fc-event[data-tipo="consulta"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-daygrid-event-dot,
.fc-event[data-tipo="consulta"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-list-event-dot,
.fc-event[data-tipo="consulta"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-timegrid-event-dot {
    background-color: #ec4899 !important;
    border-color: #ec4899 !important;
}

.fc-event[data-tipo="outro"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-daygrid-event-dot,
.fc-event[data-tipo="outro"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-list-event-dot,
.fc-event[data-tipo="outro"]:not([data-status="cancelado"]):not([data-status="concluido"]) .fc-timegrid-event-dot {
    background-color: #64748b !important;
    border-color: #64748b !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-user {
    padding: 20px;
    background: rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i {
    font-size: 2rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info strong {
    display: block;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info small {
    display: block;
    opacity: 0.8;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 15px;
}

.sidebar-nav .nav-item i {
    width: 25px;
    font-size: 1.2rem;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 30px;
}

.sidebar-nav .nav-item.active {
    background: rgba(255,255,255,0.15);
    border-left: 4px solid white;
    color: white;
    padding-left: 30px;
    font-weight: 600;
    position: relative;
}

.sidebar-nav .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.sidebar-nav .nav-item.active i {
    color: white;
}

.sidebar-nav .nav-item.logout {
    color: rgba(255,255,255,0.7);
}

.sidebar-nav .nav-item.logout:hover {
    background: rgba(220, 53, 69, 0.3);
    color: white;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 0;
}

/* ==================== NAV DROPDOWN ==================== */
.nav-item-dropdown {
    position: relative;
}

.nav-item-toggle {
    cursor: pointer;
    position: relative;
}

.nav-item-toggle .nav-item-arrow {
    margin-left: auto;
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    width: auto;
}

.nav-item-dropdown.active .nav-item-toggle .nav-item-arrow {
    transform: rotate(180deg);
}

.nav-item-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.1);
}

.nav-item-dropdown.active .nav-item-submenu {
    max-height: 300px;
}

.nav-item-submenu-item {
    display: flex;
    align-items: center;
    padding: 10px 25px 10px 60px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 15px;
    font-size: 0.9rem;
}

.nav-item-submenu-item i {
    width: 20px;
    font-size: 1rem;
}

.nav-item-submenu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 65px;
}

.nav-item-submenu-item.active {
    background: rgba(255,255,255,0.15);
    border-left: 4px solid white;
    color: white;
    font-weight: 600;
    padding-left: 65px;
    position: relative;
}

.nav-item-submenu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.nav-item-submenu-item.active i {
    color: white;
}

.nav-item-dropdown.active .nav-item-toggle {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-item-dropdown.active .nav-item-toggle i {
    color: white;
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* ==================== TOP BAR ==================== */
.top-bar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ==================== TOGGLE BUTTON (MOBILE) ==================== */
.sidebar-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #764ba2;
    transform: scale(1.05);
}

/* ==================== CONTAINER ==================== */
.container-fluid {
    flex: 1;
    padding: 30px;
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-bottom: 2px solid #f0f0f0;
    padding: 1rem 1.5rem;
    background-color: #fff;
    border-radius: 10px 10px 0 0 !important;
}

.card-body {
    padding: 1.5rem;
}

/* Estatísticas Cards */
.card.text-white .card-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card.text-white h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

.card.text-white .card-body {
    padding: 1.25rem;
}

.card.text-white .fs-1 {
    font-size: 2rem !important;
}

/* ==================== TABELAS ==================== */
.table {
    font-size: 0.9rem;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: #495057;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.table-responsive {
    border-radius: 10px;
}

/* ==================== DATATABLES ==================== */
.dataTables_wrapper .dataTables_length select {
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 1rem;
}

/* ==================== BADGES ==================== */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-group .btn {
    margin: 0;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ==================== FORMS ==================== */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ==================== MODALS ==================== */
.modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 2px solid #f0f0f0;
    background-color: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-title {
    font-weight: 600;
    color: var(--dark-color);
}

.modal-footer {
    border-top: 2px solid #f0f0f0;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

/* ==================== FOOTER ==================== */
.footer {
    background: white;
    padding: 15px 0;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

.footer .container-fluid {
    padding: 0 30px;
}

.footer-login {
    position: fixed;
    bottom: 0;
    width: 100%;
    margin-top: 0;
}

/* ==================== ALERTS ==================== */
.alert {
    border: none;
    border-radius: 0.5rem;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* ==================== LOGIN PAGE ==================== */
.card.shadow {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.alert {
    animation: fadeIn 0.3s ease;
}

/* ==================== SIDEBAR OVERLAY (MOBILE) ==================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    /* Esconde sidebar no mobile */
    .sidebar {
        left: -280px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar.active ~ .sidebar-overlay,
    .sidebar-overlay {
        display: block;
    }
    
    /* Remove margem do main-wrapper */
    .main-wrapper {
        margin-left: 0;
    }
    
    /* Mostra botão de toggle */
    .sidebar-toggle {
        display: flex;
    }
    
    /* Ajusta top-bar */
    .top-bar {
        padding-left: 70px;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .card.text-white h2 {
        font-size: 1.5rem;
    }
    
    .card.text-white .fs-1 {
        font-size: 1.5rem !important;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
    
    .container-fluid {
        padding: 20px 15px;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .top-bar-right {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay.hidden {
    display: none;
}

/* ==================== HELP BUTTON - BOTÃO DE AJUDA FLUTUANTE ==================== */
.help-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.85);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    z-index: 1040;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
    opacity: 0.75;
}

.help-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
    color: #fff;
    opacity: 1;
}

.help-fab:active {
    transform: scale(0.95);
}

.help-offcanvas {
    max-width: 420px;
}

.help-offcanvas .offcanvas-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-bottom: none;
}

.help-offcanvas .offcanvas-header .btn-close {
    filter: brightness(0) invert(1);
}

.help-offcanvas .offcanvas-body {
    font-size: 0.92rem;
    line-height: 1.65;
}

.help-offcanvas .help-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.help-offcanvas .help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-offcanvas .help-section h6 {
    color: #4f46e5;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.help-offcanvas .help-section ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.help-offcanvas .help-section li {
    margin-bottom: 0.35rem;
}

.help-offcanvas .help-tip {
    background: #f0f4ff;
    border-left: 3px solid #4f46e5;
    padding: 0.65rem 0.85rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: #374151;
}

@media (max-width: 576px) {
    .help-offcanvas {
        max-width: 100%;
    }
    .help-fab {
        bottom: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

/* ==================== FULLCALENDAR - DISPONIBILIDADES ==================== */
.fc-event.disponibilidade,
.fc-event.disponibilidade .fc-event-title,
.fc-event.disponibilidade .fc-event-time {
    color: #000000 !important;
}
