/* assets/css/style.css */
:root {
    --primary-color: #0066FF;
    --primary-hover: #0052cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #F8F9FA;
    --dark-text: #333333;
    --gray-text: #6B7280;
    --border-color: #e5e7eb;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --sidebar-width: 250px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--dark-text);
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    padding: 24px;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.sidebar-menu li {
    padding: 0 16px;
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--gray-text);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(0, 102, 255, 0.05);
    color: var(--primary-color);
}

.sidebar-menu svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--danger-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.05);
}

/* Header */
.top-header {
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    background-color: #f9fafb;
}

.header-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-text);
    width: 16px;
    height: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-info .role {
    font-size: 0.8rem;
    color: var(--gray-text);
}

/* Cards */
.card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 24px;
    min-width: 0;
    /* Fix: prevent grid children from overflowing column */
    overflow: hidden;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), #00a2ff);
    border-radius: var(--border-radius);
    padding: 30px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 20px rgba(0, 102, 255, 0.2);
}

.welcome-text h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.welcome-text p {
    opacity: 0.9;
    font-size: 1rem;
}

/* Stats Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--primary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.stat-details h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--dark-text);
}

.stat-details p {
    color: var(--gray-text);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f9fafb;
    color: var(--gray-text);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 0.95rem;
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-text);
}

.form-control,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #e5e7eb;
    color: var(--dark-text);
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Split Login Page Specific */
.login-body-split {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    font-family: 'Outfit', sans-serif;
    background-color: var(--light-bg);
    overflow: hidden;
}

.login-split-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.login-brand-side {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0033cc 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 40px;
}

.brand-content {
    max-width: 480px;
    position: relative;
    z-index: 10;
}

.brand-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    line-height: 1.1;
}

.brand-content p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.6;
}

.brand-stats {
    display: flex;
    gap: 40px;
}

.stat-item h4 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0;
}

.stat-item span {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bg-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.shape-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -150px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 40px;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-header {
    margin-bottom: 40px;
}

.login-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-text);
    font-size: 1rem;
}

.custom-input-group label {
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.form-control-lg {
    padding: 14px 20px;
    font-size: 1.05rem;
    border-radius: 10px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.form-control-lg:focus {
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.15);
}

.d-none-desktop {
    display: none;
}

@media (max-width: 992px) {
    .login-brand-side {
        display: none;
    }

    .d-none-desktop {
        display: block;
        text-align: center;
        margin-bottom: 30px;
    }

    .d-none-desktop h2 {
        font-size: 2.5rem;
    }
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.badge-primary {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-color);
}

/* Utilities */
.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Mobile Navigation Elements */
.mobile-menu-btn,
.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--dark-text);
}

.mobile-menu-btn svg,
.mobile-close-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1100;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }

    /* Prevent any element from overflowing the viewport */
    .content-wrapper {
        padding: 16px;
        overflow-x: hidden;
    }

    /* Make sure the top-level containers don't overflow */
    .app-container {
        overflow-x: hidden;
    }

    /* Header */
    .header-search {
        display: none;
    }

    .top-header {
        padding: 0 12px;
    }

    /* Show hamburger & close buttons */
    .mobile-menu-btn,
    .mobile-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Sidebar overlay */
    .sidebar-overlay {
        display: block;
    }

    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* Welcome banner: stack vertically */
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 20px;
    }

    .welcome-text h2 {
        font-size: 1.3rem;
    }

    /* Stats grid: 1 column on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    /* Form rows: collapse to 1 column */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Cards: reduce padding */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }

    /* Table: enable horizontal scrolling, prevent overflow */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    table {
        min-width: 480px;
        width: max-content;
    }

    th,
    td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    /* Page headings row: stack or shrink */
    .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        gap: 10px;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Buttons on mobile */
    .btn {
        font-size: 0.9rem;
        padding: 9px 16px;
    }

    /* Filter form in admissions page */
    .form-row[style*="align-items"] {
        grid-template-columns: 1fr;
    }
}