/* ============================================
   ROOT & TYPOGRAPHY
   ============================================ */

:root {
    /* Primary Purple Palette - Custom Mixed */
    --primary-color: #660099;
    --primary-dark: #4e0075;
    --primary-light: #8300A8;

    /* Accent & Secondary Purples */
    --secondary-color: #9200AF;
    --tertiary-color: #f3e8ff;
    /* Light purple tint */
    --accent-color: #8300A8;
    --accent-dark: #660099;

    /* Neutrals - Adjusted for purple theme */
    --neutral-light: #fdfaff;
    --neutral-medium: #f3e8ff;
    --neutral-gray: #7a618d;

    --dark: #3a0055;
    --dark-secondary: #5a4a6d;
    --gray-light: #fcfaff;
    --gray-medium: #e9d5ff;
    --gray-text: #7a618d;

    --text-primary: #3a0055;
    --text-secondary: #5a4a6d;

    /* Accents */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Shadows - Updated with purple tint */
    --shadow-sm: 0 1px 3px rgba(102, 0, 153, 0.08);
    --shadow-md: 0 4px 6px rgba(102, 0, 153, 0.12);
    --shadow-lg: 0 10px 25px rgba(102, 0, 153, 0.15);

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-primary);
    background-color: #fdfaff;
    line-height: 1.6;
    /* Background watermark with purple tints */
    background-image: radial-gradient(circle at 20% 50%, rgba(102, 0, 153, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(146, 0, 175, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(131, 0, 168, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
}

/* ============================================
   NAVBAR STYLING
   ============================================ */

.navbar-custom {
    background-color: rgba(250, 249, 248, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--primary-light);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.navbar-custom.scrolled {
    background-color: rgba(250, 249, 248, 0.98);
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--secondary-color);
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--dark) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-dark) !important;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mega Dropdown */
.dropdown-menu-mega {
    width: 100vw;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    border: none;
    box-shadow: var(--shadow-lg);
    border-top: 3px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 250, 248, 0.98) 0%, rgba(240, 250, 248, 0.95) 100%);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, #660099 0%, #8300A8 50%, #9200AF 100%);
    border: none;
    color: white;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(102, 0, 153, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 0, 153, 0.3);
    background: linear-gradient(135deg, #4e0075 0%, #660099 50%, #8300A8 100%);
    color: white;
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #660099 0%, #8300A8 100%);
    border-color: transparent;
    color: white;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer-custom {
    background: linear-gradient(135deg, #3a0055 0%, #660099 100%);
    color: white;
    margin-top: 5rem;
}

.footer-custom a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-custom a:hover {
    color: var(--primary-color);
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transform: translateY(-3px);
}

/* ============================================
   SIDEBAR & DASHBOARD NAV
   ============================================ */

.sidebar {
    background: #ffffff;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.03);
    border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.sidebar .nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0.2rem 0;
}

.sidebar .nav-link:hover {
    background-color: rgba(102, 0, 153, 0.05);
    color: var(--primary-color) !important;
}

.active-link {
    background-color: rgba(102, 0, 153, 0.1) !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

.active-link i {
    color: var(--primary-color) !important;
}

.sidebar-heading {
    letter-spacing: 0.5px;
    margin-top: 1.5rem !important;
    padding-left: 1rem !important;
}

/* ============================================
   TABLES & DATA DISPLAY
   ============================================ */

.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom-width: 1px;
}

.table td {
    padding: 1rem;
    font-size: 0.9rem;
}

/* Table responsiveness and vertical scrolling */
.table-responsive {
    border-radius: 12px;
    max-height: 550px;
    /* Constrain height for vertical scroll */
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) rgba(102, 0, 153, 0.05);
}

/* Custom scrollbar for webkit browsers */
.table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(102, 0, 153, 0.02);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
    opacity: 0.5;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Sticky header logic */
.table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa !important;
    box-shadow: inset 0 -1px 0 rgba(102, 0, 153, 0.1);
}

@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
        max-height: 450px;
        /* Shorter on mobile */
    }

    .table th,
    .table td {
        padding: 0.75rem;
        min-width: 120px;
        /* Ensure columns don't get too cramped */
    }

    .table td:last-child {
        min-width: 100px;
        /* Action buttons column */
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.section-padding {
    padding: 5rem 0;
}

@media (max-width: 992px) {
    .section-padding {
        padding: 3rem 0;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 2rem 0;
    }

    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.container-xl {
    max-width: 1400px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Added pastel section backgrounds */
.section-light {
    background-color: var(--neutral-light);
    background-image: radial-gradient(circle at 15% 60%, rgba(255, 182, 185, 0.06) 0%, transparent 40%), radial-gradient(circle at 85% 20%, rgba(138, 198, 209, 0.06) 0%, transparent 40%);
}

.section-accent {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--tertiary-color) 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-custom {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .dropdown-menu-mega {
        width: 100%;
        left: 0 !important;
        transform: none;
    }
}

/* ============================================
   GLOBAL RESPONSIVENESS & UTILITIES
   ============================================ */

.extra-small {
    font-size: 0.7rem !important;
}

.x-small {
    font-size: 0.65rem !important;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hover-up {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hover-up:hover {
    transform: translateY(-5px) !important;
}

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hover-lift:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 1rem 3rem rgba(102, 0, 153, 0.15) !important;
}

/* Custom Thin Scrollbar Utility */
.custom-scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 0, 153, 0.2) transparent;
}

.custom-scrollbar-thin::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(102, 0, 153, 0.2);
    border-radius: 10px;
}

.custom-scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 0, 153, 0.4);
}

.description-scroll {
    height: 100px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 0, 153, 0.2) transparent;
}

.description-scroll::-webkit-scrollbar {
    width: 4px;
}

.description-scroll::-webkit-scrollbar-thumb {
    background: rgba(102, 0, 153, 0.2);
    border-radius: 10px;
}

/* Aspect Ratios */
.ratio-21x9 {
    --bs-aspect-ratio: calc(9 / 21 * 100%);
}