/* Pastiemas School Management System - Custom Styles */

/* Custom color variables */
:root {
    --pastiemas-primary: #1e3a8a;
    --pastiemas-secondary: #64748b;
    --pastiemas-success: #059669;
    --pastiemas-warning: #d97706;
    --pastiemas-danger: #dc2626;
    --pastiemas-info: #0891b2;
    --pastiemas-light: #f8fafc;
    --pastiemas-dark: #1e293b;
}

/* Custom button styles */
.btn-pastiemas {
    background-color: var(--pastiemas-primary);
    border-color: var(--pastiemas-primary);
    color: white;
}

.btn-pastiemas:hover {
    background-color: #1e40af;
    border-color: #1e40af;
    color: white;
}

/* Custom card styles */
.card-pastiemas {
    border-left: 4px solid var(--pastiemas-primary);
}

.card-pastiemas .card-header {
    background-color: var(--pastiemas-light);
    border-bottom: 1px solid #e2e8f0;
}

/* Custom table styles */
.table-pastiemas {
    border-collapse: separate;
    border-spacing: 0;
}

.table-pastiemas thead th {
    background-color: var(--pastiemas-light);
    border-bottom: 2px solid var(--pastiemas-primary);
    font-weight: 600;
    color: var(--pastiemas-dark);
}

.table-pastiemas tbody tr:hover {
    background-color: #f1f5f9;
}

/* Custom form styles */
.form-control:focus {
    border-color: var(--pastiemas-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

.form-select:focus {
    border-color: var(--pastiemas-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* Custom badge styles */
.badge-pastiemas {
    background-color: var(--pastiemas-primary);
    color: white;
}

/* Custom alert styles */
.alert-pastiemas {
    background-color: #dbeafe;
    border-color: var(--pastiemas-primary);
    color: var(--pastiemas-primary);
}

/* Custom sidebar styles */
.sidenav-pastiemas .nav-link.active {
    background-color: var(--pastiemas-primary);
    color: white;
}

.sidenav-pastiemas .nav-link:hover {
    background-color: #f1f5f9;
    color: var(--pastiemas-primary);
}

/* Sidebar toggle functionality */
.sidenav {
    transition: transform 0.3s ease-in-out;
}

.sidenav.toggled {
    transform: translateX(-100%);
}

@media (max-width: 991.98px) {
    .sidenav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
    }

    .sidenav.show {
        transform: translateX(0);
    }

    .sidenav.toggled {
        transform: translateX(0);
    }

    /* Overlay for mobile */
    .sidenav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidenav-overlay.show {
        display: block;
    }

    /* Adjust main content when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Custom header styles */
.page-header-pastiemas {
    background: linear-gradient(135deg, var(--pastiemas-primary) 0%, #1e40af 100%);
}

/* Custom status badges */
.status-draft {
    background-color: var(--pastiemas-secondary);
    color: white;
}

.status-pending {
    background-color: var(--pastiemas-warning);
    color: white;
}

.status-approved {
    background-color: var(--pastiemas-success);
    color: white;
}

.status-rejected {
    background-color: var(--pastiemas-danger);
    color: white;
}

.status-active {
    background-color: var(--pastiemas-success);
    color: white;
}

.status-inactive {
    background-color: var(--pastiemas-secondary);
    color: white;
}

/* Custom loading spinner */
.spinner-pastiemas {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--pastiemas-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Custom progress bar */
.progress-pastiemas {
    background-color: #e2e8f0;
}

.progress-pastiemas .progress-bar {
    background-color: var(--pastiemas-primary);
}

/* Custom modal styles */
.modal-pastiemas .modal-header {
    background-color: var(--pastiemas-primary);
    color: white;
}

.modal-pastiemas .modal-header .btn-close {
    filter: invert(1);
}

/* Custom dropdown styles */
.dropdown-pastiemas .dropdown-item:hover {
    background-color: var(--pastiemas-light);
    color: var(--pastiemas-primary);
}

/* Custom pagination styles */
.pagination-pastiemas .page-link {
    color: var(--pastiemas-primary);
    border-color: #e2e8f0;
}

.pagination-pastiemas .page-link:hover {
    background-color: var(--pastiemas-light);
    border-color: var(--pastiemas-primary);
}

.pagination-pastiemas .page-item.active .page-link {
    background-color: var(--pastiemas-primary);
    border-color: var(--pastiemas-primary);
}

/* Custom tooltip styles */
.tooltip-pastiemas .tooltip-inner {
    background-color: var(--pastiemas-dark);
    color: white;
}

/* Custom breadcrumb styles */
.breadcrumb-pastiemas {
    background-color: var(--pastiemas-light);
    border-radius: 0.375rem;
}

.breadcrumb-pastiemas .breadcrumb-item a {
    color: var(--pastiemas-primary);
    text-decoration: none;
}

.breadcrumb-pastiemas .breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Custom stats card styles */
.stats-card {
    transition: transform 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-2px);
}

.stats-card .stats-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stats-card .stats-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stats-card .stats-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Custom timeline styles */
.timeline-pastiemas {
    position: relative;
    padding-left: 2rem;
}

.timeline-pastiemas::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e2e8f0;
}

.timeline-pastiemas .timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-pastiemas .timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: var(--pastiemas-primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e2e8f0;
}

/* Custom file upload styles */
.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s ease-in-out;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--pastiemas-primary);
}

.file-upload-area.dragover {
    border-color: var(--pastiemas-primary);
    background-color: #f8fafc;
}

/* Custom search box styles */
.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.search-box .form-control {
    padding-left: 2.5rem;
}

/* Custom filter styles */
.filter-section {
    background-color: var(--pastiemas-light);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Custom action buttons */
.action-buttons .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Custom empty state styles */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.empty-state .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state .empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-state .empty-state-description {
    margin-bottom: 1.5rem;
}

/* Custom loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Action buttons styling */
.action-buttons .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    min-width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn i {
    font-size: 0.875rem;
}

.action-buttons .btn-sm {
    min-width: 2rem;
    height: 2rem;
    padding: 0.25rem 0.5rem;
}

.action-buttons .btn-sm i {
    font-size: 0.75rem;
}

/* Ensure FontAwesome icons display properly */
.fas,
.far,
.fab,
.fal,
.fad {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
    font-weight: 900;
}

.far {
    font-weight: 400;
}

.fab {
    font-weight: 400;
}

/* Fix for action buttons in tables */
.table .action-buttons {
    white-space: nowrap;
}

.table .action-buttons .btn {
    margin: 0 0.125rem;
}

/* Custom responsive utilities */
@media (max-width: 768px) {
    .stats-card .stats-value {
        font-size: 1.5rem;
    }

    .action-buttons .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .filter-section .row>div {
        margin-bottom: 0.5rem;
    }
}

/* Custom print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .page-break {
        page-break-before: always;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* Custom dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --pastiemas-light: #1e293b;
        --pastiemas-dark: #f8fafc;
    }

    .card-pastiemas .card-header {
        background-color: #334155;
        border-bottom-color: #475569;
    }

    .table-pastiemas thead th {
        background-color: #334155;
        color: #f8fafc;
    }

    .table-pastiemas tbody tr:hover {
        background-color: #334155;
    }
}