/**
 * Custom CSS - MindSpark Courses Platform
 */

/* ==================== GLOBAL STYLES ==================== */

:root {
    /* Primary Brand Colors (Logo Blues) */
    --primary-blue: #0072CE;
    --primary-blue-alt: #1A8CB8;
    --dark-navy: #003366;
    --light-sky-blue: #E6F4FF;
    --accent-blue: #00A3FF;
    
    /* Neutrals */
    --white: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --text-dark: #222222;
    --text-gray: #666666;
    --border-color: #DDE2E8;
    
    /* Feedback Colors */
    --success-green: #22B573;
    --warning-yellow: #FFB020;
    --danger-red: #E53935;
    
    /* Legacy (for compatibility) */
    --bg-light: #F5F7FA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
}

.main-content {
    padding-top: 76px;
    /* Account for fixed navbar */
    min-height: calc(100vh - 300px);
}

/* ==================== GRADIENT TEXT ==================== */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-light {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-light-gray {
    color: #D1D5DB;
}

/* ==================== BUTTONS ==================== */

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 114, 206, 0.2);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 114, 206, 0.3);
    color: white;
}

.btn-outline-gradient {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    background: transparent;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-gradient:hover {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    color: white;
    border-color: transparent;
}

/* ==================== PRICING CARDS ==================== */

.pricing-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

.pricing-card.popular {
    border: 2px solid var(--primary-purple);
    transform: scale(1.05);
}

.pricing-card.popular::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.price .currency {
    font-size: 1.2rem;
    font-weight: 400;
    margin-right: 5px;
}

.price .amount {
    font-size: 3rem;
}

.price .period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-gray);
    display: block;
    margin-top: 5px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.course-card {
    position: relative;
}

.course-card .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1;
    padding: 6px 12px;
    font-weight: 500;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card p {
    margin: 0;
    opacity: 0.9;
}

/* ==================== HERO SECTION ==================== */

.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                url('../img/hero-bg.jpg') center/cover no-repeat fixed;
    background-attachment: fixed;
    color: white;
    padding: 120px 0 100px;
    position: relative;
    overflow: hidden;
    min-height: 650px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 30px;
}

/* ==================== BADGES ==================== */

.badge-beginner {
    background-color: var(--success-green);
}

.badge-intermediate {
    background-color: var(--warning-yellow);
}

.badge-advanced {
    background-color: var(--danger-red);
}

.badge-all-levels {
    background-color: var(--primary-blue);
}

/* ==================== RATINGS ==================== */

.rating {
    color: #FFA500;
    font-size: 0.9rem;
}

.rating .fa-star,
.rating .fa-star-half-alt {
    margin-right: 2px;
}

/* ==================== PROGRESS BAR ==================== */

.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #E5E7EB;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-alt));
    border-radius: 10px;
}

/* ==================== CATEGORY CARDS ==================== */

.category-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
}

.category-card i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.category-card h5 {
    font-weight: 600;
    margin-bottom: 10px;
}

/* ==================== FILTER SIDEBAR ==================== */

.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-sidebar h6 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.filter-sidebar .form-label {
    font-weight: 500;
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ==================== COURSE DETAIL ==================== */

.course-hero {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
}

.course-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
}

.course-hero-content {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    color: white;
    z-index: 1;
}

.course-sidebar {
    position: sticky;
    top: 100px;
}

/* ==================== TABS ==================== */

.nav-tabs {
    border-bottom: 2px solid #E5E7EB;
}

.nav-tabs .nav-link {
    color: var(--text-gray);
    border: none;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-purple);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-purple);
    background: transparent;
    border-bottom: 2px solid var(--primary-purple);
}

/* ==================== TESTIMONIALS ==================== */

.testimonial-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.testimonial-card .quote-icon {
    font-size: 2rem;
    color: var(--primary-purple);
    opacity: 0.3;
}

/* ==================== NAVBAR ==================== */

.navbar {
    padding: 15px 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    color: inherit;
    padding: 8px 16px !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-blue) !important;
}

/* ==================== FORMS ==================== */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 114, 206, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* ==================== ALERTS ==================== */

.alert {
    border-radius: 8px;
    border: none;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .course-hero {
        height: 250px;
    }

    .main-content {
        padding-top: 70px;
    }
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ==================== PREMIUM SIDEBAR LAYOUT (REPAIRED) ==================== */

.admin-panel {
    background-color: #F8FAFC;
    min-height: 100vh;
}

/* Sidebar Styling - Fixed & Rigid */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    color: #ffffff !important;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .sidebar-header {
    padding: 15px 15px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #94A3B8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav-container {
    flex: 1;
    padding-bottom: 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar-nav-container::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.sidebar .nav-section {
    padding: 12px 14px 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 8px 12px !important;
    margin: 2px 10px;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    text-decoration: none;
}

.sidebar .nav-link i {
    width: 18px;
    font-size: 0.9rem;
    margin-right: 8px;
}

.sidebar .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    box-shadow: 0 4px 15px rgba(0, 114, 206, 0.3);
}

/* Sidebar Profile */
.sidebar-profile {
    padding: 10px 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-profile-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-profile-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
}

.profile-role {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.6875rem;
    font-weight: 500;
}

/* Main Content Area */
.admin-main {
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #F8FAFC;
    transition: margin-left 0.3s ease;
}

.admin-top-bar {
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.admin-content {
    padding: 40px;
    width: 100%;
}

/* Stats Cards Fixes */
.admin-stats-card {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-stats-card .icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Responsive Handling */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }
}





/* ==================== UTILITIES ==================== */

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
}

.shadow-custom {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rounded-custom {
    border-radius: 12px;
}

/* ==================== CONTACT SECTION ==================== */

#contact {
    background-color: var(--dark-navy) !important;
}

#contact .btn-light {
    background-color: var(--white);
    color: var(--dark-navy);
    font-weight: 600;
    border: none;
}

#contact .btn-light:hover {
    background-color: var(--light-sky-blue);
    color: var(--dark-navy);
}

#contact .btn-outline-light {
    border-color: var(--white);
    color: var(--white);
}

#contact .btn-outline-light:hover {
    background-color: var(--white);
    color: var(--dark-navy);
}

/* ==================== ADDITIONAL RESPONSIVENESS ==================== */

@media (max-width: 991.98px) {
    .section-py { padding: 50px 0; }
    .section-title { font-size: 1.75rem; }
    .hero-premium { 
        min-height: auto; 
        padding-top: 130px !important; 
        padding-bottom: 80px !important; 
        text-align: center;
        background-attachment: scroll; /* Better performance on mobile */
    }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-trust { justify-content: center; }
    .btn-hero-primary, .btn-hero-ghost { width: 100%; margin-bottom: 10px; }
    .stats-strip { padding: 10px 0; }
    .stat-strip-item { border-bottom: 1px solid #eee; padding: 15px; }
    .stat-strip-item:last-child { border-bottom: none; }
}

@media (max-width: 576px) {
    .section-title { font-size: 1.5rem; }
    .course-card-v2 { max-width: 400px; margin: 0 auto; }
    .pricing-card-v2 { padding: 24px 20px; }
    .hero-title { font-size: 2.1rem; }
}

.page-hero-premium {
    background: linear-gradient(135deg, #061828 0%, #0d3060 100%);
    padding: 80px 0 56px;
}

@media (max-width: 991.98px) {
    .page-hero-premium { padding: 60px 0 40px; }
}

/* ==================== INSTRUCTOR PORTAL ==================== */

/* Dashboard Header */
.dashboard-header { border-bottom: 1px solid rgba(255,255,255,0.08); }

/* Instructor-specific gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-alt));
}

/* Profile page form focus override */
.instructor-portal .form-control:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,0.1);
    background-color: #fff !important;
}

/* Messaging center custom scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* Messaging layout helpers */
.resize-none { resize: none; }
.max-w-700 { max-width: 700px; }