/**
 * Digital Classroom Utilization System - Main Stylesheet
 * ISAT U Color Scheme: Primary #21397d (Dark Blue), Secondary #f9c41a (Yellow/Gold), Accent #cd201f (Red)
 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #282828;
    background-image: linear-gradient(rgba(247, 246, 245, 0.85), rgba(247, 246, 245, 0.85)), url('../images/nbuilding.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    height: 100%;
}

/* CSS Variables for ISAT U Color Scheme */
:root {
    /* ISAT U Brand Colors */
    --primary-color: #21397d;        /* Dark Blue */
    --primary-hover: #1a2d65;        /* Darker Blue */
    --primary-light: #e8ebf3;        /* Light Blue tint */
    --secondary-color: #f9c41a;      /* Yellow/Gold */
    --secondary-hover: #e0b016;      /* Darker Gold */
    --secondary-light: #fef4d9;      /* Light Gold tint */
    --accent-color: #cd201f;         /* Red */
    --accent-hover: #a51a19;         /* Darker Red */
    --accent-light: #f8e5e5;         /* Light Red tint */
    --neutral-color: #a5a4a4;        /* Medium Gray */
    --neutral-dark: #282828;         /* Dark Gray */
    --neutral-light: #f7f6f5;        /* Light Gray */

    /* Additional ISAT U Colors */
    --isat-blue-medium: #3b5998;     /* Medium Blue */
    --isat-navy: #010035;            /* Navy/Almost Black */

    /* Semantic Colors */
    --success-color: #059669;        /* Green for success */
    --warning-color: #f59e0b;        /* Orange for warnings */
    --error-color: #cd201f;          /* ISAT U Red for errors */

    /* Base Colors */
    --white: #ffffff;
    --black: #000000;

    /* Gray Scale (adjusted to ISAT U palette) */
    --gray-50: #f7f6f5;              /* ISAT U Light Gray */
    --gray-100: #ededede6;           /* Very Light Gray */
    --gray-200: #d8d8d8;
    --gray-300: #c4c4c4;
    --gray-400: #a5a4a4;             /* ISAT U Medium Gray */
    --gray-500: #8a8a8a;
    --gray-600: #6f6f6f;
    --gray-700: #545454;
    --gray-800: #282828;             /* ISAT U Dark Gray */
    --gray-900: #010035;             /* ISAT U Navy */

    /* Layout Properties */
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgba(33, 57, 125, 0.08);
    --shadow: 0 1px 3px 0 rgba(33, 57, 125, 0.12), 0 1px 2px 0 rgba(33, 57, 125, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(33, 57, 125, 0.15), 0 4px 6px -2px rgba(33, 57, 125, 0.08);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-800);
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.875rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.625rem; }
h5 { font-size: 1.125rem; margin-bottom: 0.5rem; }
h6 { font-size: 1rem; margin-bottom: 0.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col {
    flex: 1;
    padding: 0 0.5rem;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    margin-right: 0.75rem;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    list-style: none;
}

.nav-item {
    margin-left: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding-top: 4rem;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-nav-item i {
    width: 1.25rem;
    margin-right: 0.75rem;
}

/* Main Content */
.main-content {
    margin-left: 0;
    padding: 2rem 1rem;
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-open {
    margin-left: 250px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, var(--gray-50), var(--white));
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 2.5rem;
}

.btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(33, 57, 125, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-danger {
    background: var(--accent-color);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--accent-hover);
    color: var(--white);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 2rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-height: 3rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 57, 125, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 5rem;
}

.form-error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.table tbody tr:hover {
    background: var(--primary-light);
}

.table-striped tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.table-striped tbody tr:nth-child(even):hover {
    background: var(--primary-light);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: var(--secondary-light);
    border-color: var(--secondary-color);
    color: #065f46;
}

.alert-error {
    background: var(--accent-light);
    border-color: var(--accent-color);
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: #1e40af;
}

/* Schedule Grid */
.schedule-grid {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.schedule-header {
    background: var(--gray-100);
    padding: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: var(--gray-800);
}

.schedule-time {
    background: var(--gray-50);
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    color: var(--gray-600);
}

.schedule-cell {
    background: var(--white);
    min-height: 3rem;
    position: relative;
    padding: 0.25rem;
}

.schedule-item {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.schedule-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.schedule-item.conflict {
    background: var(--accent-color);
}

/* Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, var(--white), var(--gray-50));
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8125rem;
}

.stat-change {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--accent-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Support both custom .active and Bootstrap .show classes */
.modal.active,
.modal.show {
    display: flex; /* Show the modal */
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

/* Support both custom .active and Bootstrap .show classes */
.modal.active .modal-content,
.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(rgba(247, 246, 245, 0.85), rgba(247, 246, 245, 0.85)), url('../images/nbuilding.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
    padding: 1rem;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    text-align: center;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    font-size: 1.875rem;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        z-index: 200;
    }
    
    .main-content.sidebar-open {
        margin-left: 0;
    }
    
    .header-content {
        padding: 0.75rem 0;
    }
    
    .nav {
        display: none;
    }
    
    .row {
        margin: 0;
    }
    
    .col {
        padding: 0;
        margin-bottom: 1rem;
    }
    
    .col-12, .col-6, .col-4, .col-3, .col-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .schedule-grid {
        display: block;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--accent-color); }
.text-muted { color: var(--gray-500); }

.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.bg-success { background-color: var(--success-color); }
.bg-warning { background-color: var(--warning-color); }
.bg-danger { background-color: var(--accent-color); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--shadow); }

/* Print Styles */
@media print {
    .header,
    .sidebar,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}