/* ===================================================
   GLOBAL STYLE
=================================================== */

:root {
    --primary-color: #4f46e5;
    --secondary-color: #db2777;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --transition: all 0.3s ease;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: #f6f8fb;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Subtle Startup Glow Background */
body::before {
    content: "";
    position: fixed;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15), transparent 70%);
    z-index: -1;
    animation: floatBlob 8s ease-in-out infinite;
}

@keyframes floatBlob {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(20px);
    }
}

/* ===================================================
   SIDEBAR
=================================================== */

.sidebar {
    position: fixed;
    width: 250px;
    height: 100vh;
    left: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid #e5e7eb;
    padding: 30px 22px;
    transition: 0.3s ease;
    z-index: 1040;
}

.sidebar.collapsed {
    left: -250px;
}

/* Logo */
.logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 50px;
    color: #4f46e5;
}

/* Links */
.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    transition: 0.25s;
}

.sidebar a:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.sidebar a.active {
    background: #eef2ff;
    color: #4f46e5;
}

/* ===================================================
   MAIN CONTENT
=================================================== */

.main {
    margin-left: 250px;
    padding: 40px;
    width: calc(100% - 250px);
    transition: 0.3s ease;
    min-height: 100vh;
}

.main.expanded {
    margin-left: 0;
    width: 100%;
}

/* PW Style Top Header Navbar */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1030;
    margin: -40px -40px 30px -40px;
    flex-wrap: wrap;
    gap: 1rem;
}

.hamburger-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    margin-right: 20px;
}

/* Page Title */
.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
}

/* ===================================================
   CARDS
=================================================== */

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.35s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 35px rgba(79, 70, 229, 0.15);
}

/* ===================================================
   STAT / INFO BOX
=================================================== */

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #4f46e5;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* ===================================================
   RECOMMENDATION BOX
=================================================== */

.recommend {
    background: #fff7ed;
    border-left: 6px solid #f59e0b;
    padding: 16px;
    border-radius: 12px;
    color: #92400e;
    font-weight: 500;
}

/* ===================================================
   BATCH CARD
=================================================== */

.batch-card {
    background: #ffffff;
    padding: 22px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    transition: all 0.35s ease;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.batch-card::after {
    content: "";
    position: absolute;
    width: 120%;
    height: 120%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), transparent);
    top: -10%;
    left: -10%;
    opacity: 0;
    transition: 0.4s;
}

.batch-card:hover::after {
    opacity: 1;
}

.batch-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 45px rgba(79, 70, 229, 0.18);
}

.course-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    background: #eef2ff;
    padding: 10px;
    border-radius: 10px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    border-radius: 10px;
}

/* ===================================================
   PROGRESS BAR
=================================================== */

.progress {
    height: 14px;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
}

.progress-bar {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ===================================================
   BADGES
=================================================== */

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fff7ed;
    color: #92400e;
}

.badge-info {
    background: #eef2ff;
    color: #3730a3;
}

/* ===================================================
   TABLES
=================================================== */

.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.table th {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

/* ===================================================
   FADE PAGE ANIMATION
=================================================== */

.fade-page {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================================
   HERO SECTION
=================================================== */

.hero {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 28px;
}

.hero h2 {
    font-weight: 600;
}

.hero p {
    opacity: 0.9;
}

/* Back Button */
.back-btn {
    background: #4f46e5;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.back-btn:hover {
    background: #3730a3;
}

/* ===================================================
   DARK MODE
=================================================== */

body.dark-mode {
    background: linear-gradient(135deg, #0f172a, #020617);
}

body.dark-mode .sidebar {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: none;
}

body.dark-mode .logo {
    color: #818cf8;
}

body.dark-mode .sidebar a {
    color: #cbd5e1;
}

body.dark-mode .sidebar a:hover,
body.dark-mode .sidebar a.active {
    background: #1e293b;
    color: #818cf8;
}

body.dark-mode .card,
body.dark-mode .batch-card,
body.dark-mode .table {
    background: #0f172a;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

body.dark-mode .page-title {
    color: #f1f5f9;
}

body.dark-mode .progress {
    background: #1e293b;
}

body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .text-dark {
    color: #f1f5f9 !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode span,
body.dark-mode strong {
    color: #e2e8f0;
}

/* Dropdown Dark Mode */
body.dark-mode .dropdown-menu {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

body.dark-mode .dropdown-item {
    color: #cbd5e1;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
    background: #0f172a;
    color: #818cf8;
}

body.dark-mode .dropdown-divider {
    border-top-color: #334155;
}

body.dark-mode .dropdown-toggle {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

/* ===================================================
   LOGIN PAGE
=================================================== */

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

/* Glass Card Effect */
.login-card {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15);
    transition: 0.3s ease;
}

.login-card:hover {
    transform: translateY(-4px);
}

/* Modern Input */
.modern-input {
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    transition: 0.3s ease;
}

.modern-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Login Button */
.login-btn {
    border-radius: 12px;
    padding: 10px;
    font-weight: 600;
}

/* Dark Mode Support */
body.dark-mode.login-body {
    background: linear-gradient(135deg, #0f172a, #020617);
}

body.dark-mode .login-card {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark-mode .modern-input {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
}

/* ===================================================
   FLASH MESSAGES (SaaS Style)
=================================================== */

.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 300px;
}

.flash-alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================================
   APP LAYOUT
=================================================== */

.app-layout {
    display: flex;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 40px;
    width: calc(100% - 250px);
    transition: 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
    width: 100%;
}

/* ===================================================
   SIDEBAR ANIMATION
=================================================== */

.sidebar {
    transition: all 0.3s ease;
}

.sidebar a:hover {
    transform: translateX(6px);
}

/* ===================================================
   METRIC CARDS (AI STYLE)
=================================================== */

.metric-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15);
}

.metric-card h6 {
    color: #64748b;
    font-weight: 500;
}

.metric-card h3 {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
}

/* ===================================================
   PAGE LOADER
=================================================== */

.page-loader {
    position: fixed;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Dark Mode Support */
body.dark-mode .metric-card {
    background: #0f172a;
    color: #e2e8f0;
}

/* ===================================================
   MOBILE RESPONSIVENESS (MEDIA QUERIES)
=================================================== */

@media (max-width: 768px) {
    /* Make the sidebar a scrollable horizontal navbar on top */
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 15px;
        display: flex;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        z-index: 1000;
    }

    .logo {
        margin-bottom: 0;
        margin-right: 20px;
    }

    .sidebar a {
        margin-bottom: 0;
        margin-right: 15px;
        white-space: nowrap;
    }

    /* Remove the massive left margin from main content */
    .main, .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px;
    }

    .top-navbar {
        margin: -15px -15px 20px -15px;
        padding: 10px 15px;
    }
    
    .carousel-item {
        padding: 20px !important;
    }
    
    .carousel-item h2 {
        font-size: 1.5rem !important;
    }
    
    .carousel-item p {
        font-size: 1rem !important;
    }

    .page-title {
        font-size: 22px;
    }

    /* Turn off background floating blob on mobile to improve performance */
    body::before {
        display: none;
    }
    
    /* Responsive Table Wrapper */
    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Adjust Card padding for mobile */
    .card, .batch-card, .metric-card {
        padding: 16px;
    }
}