/* Modern Theme for JISSR Connect */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Green/Emerald Vibe (Sonarges Brand) */
    --primary-color: #198754;
    /* Bootstrap Success/Green or Brand Green */
    --primary-hover: #157347;
    /* Darker Green */
    --secondary-color: #64748B;
    /* Slate 500 */
    --success-color: #10B981;
    /* Emerald 500 */
    --warning-color: #F59E0B;
    /* Amber 500 */
    --danger-color: #EF4444;
    /* Red 500 */

    /* Backgrounds */
    --bg-body: #F3F4F6;
    /* Cool Gray 100 */
    --bg-card: #FFFFFF;
    --bg-sidebar: #111827;
    /* Gray 900 */
    --bg-header: rgba(255, 255, 255, 0.8);
    /* Glassmorphism base */

    /* Text */
    --text-main: #1F2937;
    /* Gray 800 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --text-light: #F9FAFB;
    /* Gray 50 - for dark backgrounds */
    --text-on-primary: #FFFFFF;

    /* Shapes */
    --radius-sm: 0.375rem;
    /* 6px */
    --radius-md: 0.75rem;
    /* 12px */
    --radius-lg: 1rem;
    /* 16px */
    --radius-xl: 1.5rem;
    /* 24px */

    /* Shadows - Tailwind style */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-base: all 0.2s ease-in-out;
}

/* Base Overrides */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    line-height: 1.6;
}

.page-wrapper {
    margin-top: 70px !important;
    /* Match new topbar height */
    margin-left: 250px !important;
    /* Match new sidebar width */
}

.page-footer {
    left: 250px !important;
    /* Match new sidebar width */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.025em;
    /* Tighter tracking for headings */
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Utility Classes for new Design System */
.shadow-modern {
    box-shadow: var(--shadow-md) !important;
}

.radius-modern {
    border-radius: var(--radius-lg) !important;
}

.bg-glass {
    background: var(--bg-header) !important;
    backdrop-filter: blur(10px);
    margin-top: 2rem;
}

/* =========================================
   2. SIDEBAR REDESIGN
   ========================================= */
.sidebar-wrapper {
    background: var(--bg-sidebar) !important;
    box-shadow: var(--shadow-xl) !important;
    border-right: none !important;
    width: 250px !important;
    /* Override legacy 320px */
}

.sidebar-header {
    background: var(--bg-sidebar) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    height: 70px !important;
    /* Match topbar height */
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 1rem !important;
}

.sidebar-header .logo-icon {
    max-height: 40px !important;
    width: auto !important;
}

/* Fix Menu Spacing */
.sidebar-wrapper .metismenu {
    margin-top: 70px !important;
    /* Match new header height */
    background: transparent !important;
}

/* Menu Items */
.metismenu li a {
    color: #9CA3AF !important;
    /* Gray 400 */
    border: none !important;
    padding: 12px 20px !important;
    font-weight: 500 !important;
    transition: var(--transition-base);
    border-left: 4px solid transparent !important;
}

.metismenu li a:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #F3F4F6 !important;
    /* Gray 100 */
}

/* Active State */
.metismenu li.mm-active>a,
.metismenu li:hover>a.has-arrow {
    /* More visible green background for transparency on dark sidebar */
    background: rgba(25, 135, 84, 0.25) !important;
    color: var(--primary-color) !important;
    border-left: 5px solid var(--primary-color) !important;
    /* Thicker Border */
}

.metismenu li.mm-active>a .parent-icon,
.metismenu li.mm-active>a .menu-title {
    color: var(--success-color) !important;
    /* Brighter green for text/icon */
    font-weight: 600 !important;
}

.metismenu .parent-icon {
    color: inherit !important;
    font-size: 1.25rem !important;
}

/* Submenus */
.metismenu ul {
    background: rgba(17, 24, 39, 0.5) !important;
    /* Darker background */
}

.metismenu ul a {
    padding-left: 45px !important;
    font-size: 0.9rem !important;
}


/* =========================================
   3. TOPBAR (HEADER) REDESIGN
   ========================================= */
.sidebar-header {
    background: var(--bg-sidebar) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    height: 70px !important;
    /* Fixed height for alignment */
}

/* ... */

.topbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: var(--shadow-sm) !important;
    top: 0 !important;
    left: 250px !important;
    /* Adjust if sidebar width changes */
    right: 0 !important;
    z-index: 1000 !important;
    position: fixed !important;
    height: 70px !important;
    /* Match sidebar header height */
}

.topbar .navbar {
    padding: 0.75rem 1.5rem !important;
}

.topbar .nav-link {
    color: var(--text-muted) !important;
}

.topbar .user-info .user-name {
    color: var(--text-main) !important;
    font-weight: 600 !important;
}

.topbar .user-info .designattion {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
}

/* Search Box */
.mobile-search-icon,
.search-bar {
    display: none !important;
    /* Hide native search if not needed/re-styled */
}

/* Notifications Badge */
.alert-count {
    background-color: var(--danger-color) !important;
    top: 0 !important;
    right: 0 !important;
}

/* =========================================
   4. CARDS & CONTAINERS
   ========================================= */
.card {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    background: var(--bg-card) !important;
    margin-bottom: 1.5rem !important;
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 1.25rem 1.5rem !important;
}

.card-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    margin-bottom: 0 !important;
}

.card-body {
    padding: 1.5rem !important;
}

/* =========================================
   5. TABLES & DATATABLES
   ========================================= */
.table-responsive {
    border-radius: var(--radius-md);
}

.table thead th {
    background-color: #F9FAFB !important;
    /* Gray 50 */
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
    border-bottom: 1px solid #E5E7EB !important;
    padding: 0.75rem 1.5rem !important;
}

.table tbody td {
    vertical-align: middle !important;
    padding: 1rem 1.5rem !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid #F3F4F6 !important;
}

.table-hover tbody tr:hover {
    background-color: #F9FAFB !important;
}

/* =========================================
   6. FORMS & BUTTONS
   ========================================= */
.form-control,
.form-select {
    border-radius: var(--radius-sm) !important;
    border: 1px solid #D1D5DB !important;
    padding: 0.625rem 0.75rem !important;
    font-size: 0.95rem !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.btn {
    border-radius: var(--radius-sm) !important;
    padding: 0.625rem 1.25rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.025em !important;
    transition: var(--transition-base) !important;
    box-shadow: var(--shadow-sm);
    border: none !important;
}

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

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

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

/* Badge/Chips */
.badge {
    padding: 0.35em 0.65em !important;
    font-weight: 500 !important;
    border-radius: 9999px !important;
    /* Pill shape */
}

/* =========================================
   7. AUTH PAGES (LOGIN / OTP)
   ========================================= */

/* Right side background (Form area) */
.section-authentication-cover .col-xl-6:last-child {
    background-color: var(--bg-card) !important;
    /* Optional: Subtle pattern or gradient */
    background-image: radial-gradient(circle at top right, #f3f4f6, #ffffff) !important;
}

/* Form Container */
.section-authentication-cover .form-body {
    background: transparent !important;
}

/* Auth Inputs */
.section-authentication-cover .form-control {
    background-color: #F9FAFB !important;
    /* Light gray input bg */
    border-color: #E5E7EB !important;
    padding: 0.8rem 1rem !important;
    /* Larger touch target */
    font-size: 1rem !important;
}

.section-authentication-cover .form-control:focus {
    background-color: #FFFFFF !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

/* Login Button */
.section-authentication-cover .btn-primary {
    padding: 0.8rem 1.5rem !important;
    font-size: 1rem !important;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2) !important;
}

.section-authentication-cover .btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3) !important;
    transform: translateY(-2px);
}

/* Back Link (OTP Page) */
.section-authentication-cover a.text-start i {
    color: var(--primary-color) !important;
}

/* OTP Sent Box */
.otpSent {
    background-color: #ECFDF5 !important;
    /* Emerald 50 */
    color: #065F46 !important;
    /* Emerald 800 */
    border: 1px solid #D1FAE5 !important;
    border-radius: var(--radius-md) !important;
    font-weight: 500;
}

/* =========================================
   8. MODULE SELECTION PAGE (Advanced Animations)
   ========================================= */

@keyframes float-pulse {
    0% {
        transform: translateY(-8px);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(-8px);
    }
}

.module-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background: #fff;
}

.module-card:hover {
    /* Trigger the floating animation */
    animation: float-pulse 2s infinite ease-in-out;
    border-color: var(--primary-color) !important;

    /* Deep, Multi-layered Green Glow Shadow */
    box-shadow:
        0 10px 20px -5px rgba(25, 135, 84, 0.4),
        /* Primary Depth */
        0 20px 25px -5px rgba(25, 135, 84, 0.2),
        /* Ambient Spread */
        0 0 15px 0px rgba(25, 135, 84, 0.3) !important;
    /* Inner Glow feel */
    z-index: 10;
}

.module-card .module-icon {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.module-card:hover .module-icon {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: scale(1.2) rotate(3deg);
    /* Pop and slight tilt */
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.5);
    /* Icon shadow */
}

/* =========================================
   9. ANIMATIONS & EFFECTS
   ========================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Staggered Delays for Grid Items */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

.delay-7 {
    animation-delay: 0.7s;
}

.delay-8 {
    animation-delay: 0.8s;
}

.delay-9 {
    animation-delay: 0.9s;
}

.delay-10 {
    animation-delay: 1s;
}

/* Diagonal Band for Sub-menus */
.submenu-band {
    position: relative;
    overflow: hidden;
}

.submenu-band::after {
    content: "";
    position: absolute;
    top: -10px;
    right: -35px;
    width: 80px;
    height: 40px;
    background: #e2e8f0;
    /* Light Gray Band */
    transform: rotate(45deg);
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}