/* SHS Prep Management System - Main Stylesheet */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --border-color: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: #f1f5f9;
    overflow-x: hidden;
}

/* Layout Structure */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f172a 100%);
    padding: 0;
    z-index: 1000;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 1rem 0;
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: 0.25rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
}

.sidebar-menu-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu-link.active {
    color: white;
    background: rgba(79, 70, 229, 0.2);
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

.sidebar-menu-icon {
    width: 20px;
    font-size: 1.15rem;
    text-align: center;
}

.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    margin-bottom: 0.75rem;
}

.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-user-details {
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.15rem;
}

.sidebar-user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-logout {
    display: block;
    padding: 0.625rem 1rem;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    text-decoration: none;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    color: white;
}

/* Mobile Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    flex: 1;
    background: #f1f5f9;
    transition: margin-left 0.3s ease;
}

.topbar {
    background: white;
    padding: 1.25rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-text);
    margin: 0;
}

.topbar-breadcrumb {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.content-wrapper {
    padding: 2rem;
    max-width: 1400px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

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

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

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--dark-text);
}

.card-body {
    padding: 1.75rem;
}

.card-footer {
    padding: 1.25rem 1.75rem;
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
}

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

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

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--dark-text);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--dark-text);
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    appearance: none;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.table thead th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

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

.table-responsive {
    overflow-x: auto;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    border-left: 4px solid;
}

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

.alert-danger {
    background-color: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

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

.alert-info {
    background-color: #dbeafe;
    border-color: var(--info-color);
    color: #1e3a8a;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border-radius: 0.25rem;
}

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

.badge-success {
    background-color: var(--success-color);
    color: white;
}

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

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

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

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem 1.5rem;
}

.col {
    flex: 1;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.col-md-10 {
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

/* Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

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

.ml-2 { margin-left: 1rem; }
.mr-2 { margin-right: 1rem; }

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

.px-2 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

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

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

.d-none { display: none !important; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.gap-2 { gap: 1rem; }

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

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

.rounded { border-radius: 0.5rem; }
.shadow { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.shadow-lg { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
}

/* Dashboard */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: 1rem;
    color: white;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    opacity: 0.9;
    font-size: 1.05rem;
}

.stats-card {
    padding: 2rem;
    background: white;
    color: var(--dark-text);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stats-card h3 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-card p {
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        padding: 1rem 1.5rem;
    }

    .topbar-title {
        font-size: 1.4rem;
    }

    .content-wrapper {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .col-md-12,
    .col-md-10,
    .col-md-8,
    .col-md-6,
    .col-md-5,
    .col-md-4,
    .col-md-3,
    .col-md-2,
    .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .table {
        font-size: 0.85rem;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        padding: 0.75rem;
    }

    .table tbody td {
        display: block;
        text-align: right;
        padding: 0.5rem 0;
        border: none;
    }

    .table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--dark-text);
    }

    .login-container {
        padding: 1rem;
    }

    .dashboard-header {
        padding: 1.5rem 1.25rem;
        border-radius: 0.75rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .stats-card {
        padding: 1.5rem;
    }

    .stats-card h3 {
        font-size: 2rem;
    }

    .card-header {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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