/* Custom Styles for Monitoring Jamaah */

/* Sidebar */
.sidebar {
    min-height: 100vh;
    width: 260px;
    transition: all 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar .list-group-item {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar .sidebar-heading {
    border-color: rgba(255,255,255,0.1);
}

/* Main content */
#page-content-wrapper {
    margin-left: 260px;
    transition: all 0.3s;
    min-height: 100vh;
}

#page-content-wrapper.expanded {
    margin-left: 70px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    border-radius: 0.75rem;
}

.card-header {
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid;
}

.stat-card.border-primary { border-left-color: #0d6efd; }
.stat-card.border-success { border-left-color: #198754; }
.stat-card.border-danger { border-left-color: #dc3545; }
.stat-card.border-warning { border-left-color: #ffc107; }
.stat-card.border-info { border-left-color: #0dcaf0; }

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

.stat-card-sm .stat-number {
    font-size: 1.25rem;
}

/* Attendance Table */
.attendance-row {
    transition: background-color 0.2s;
}

.attendance-row:hover {
    background-color: #f8f9fa;
}

.status-buttons .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.status-buttons .btn-check:checked + .btn-outline-success {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

.status-buttons .btn-check:checked + .btn-outline-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.status-buttons .btn-check:checked + .btn-outline-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.status-buttons .btn-check:checked + .btn-outline-info {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #000;
}

.status-buttons .btn-check:checked + .btn-outline-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.reason-input {
    font-size: 0.8rem;
}

/* Sticky Footer */
.sticky-bottom {
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.fs-6 {
    font-size: 0.85rem !important;
}

/* Avatar */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    #page-content-wrapper {
        margin-left: 0;
    }
    
    .status-buttons .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .reason-input {
        font-size: 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    #menu-toggle {
        display: none !important;
    }
}

/* Calendar Report */
#calendar table th,
#calendar table td {
    vertical-align: middle;
}

#calendar .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.4em;
}

/* Import Preview */
.table-sm th, .table-sm td {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

/* Modal Fullscreen */
.modal-fullscreen-md-down {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .modal-fullscreen-md-down {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-fullscreen-md-down .modal-dialog {
        max-width: 100%;
        height: 100%;
        margin: 0;
    }
    
    .modal-fullscreen-md-down .modal-content {
        height: 100%;
        border: 0;
        border-radius: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .modal,
    .sticky-bottom,
    #menu-toggle {
        display: none !important;
    }
    
    #page-content-wrapper {
        margin-left: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .table-responsive {
        overflow: visible;
    }
}

/* Loading State */
.btn:disabled {
    opacity: 0.65;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Focus States */
.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Invalid Feedback */
.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}