:root {
    --primary-color: #f2a93b;
    --primary-hover: #ff8c00;
    --secondary-color: #9a1635;
    --dark-maroon: #5a0019;
    --accent-orange: #ff8c00;
    --dark-bg: #22141a;
    --light-bg: #f8f1e9;
    --soft-cream: #f5e8d3;
    --text-main: #333333;
    --text-muted: #666666;
    --white: #ffffff;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 20px 25px -5px rgba(242, 169, 59, 0.1), 0 10px 10px -5px rgba(242, 169, 59, 0.04);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
}

h1, h2, h3, h4, h5, h6, .section-title {
    font-family: 'Playfair Display', serif;
}

/* Navbar Tuning */
.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
    background: var(--dark-maroon);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--white) !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #9a1635 0%, #22141a 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 35c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm57-13c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zM58 58c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.search-container {
    background: var(--white);
    padding: 0.5rem;
    border-radius: 50px;
    display: flex;
    max-width: 600px;
    margin-top: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.search-input {
    border: none;
    padding: 0.8rem 1.5rem;
    flex-grow: 1;
    border-radius: 50px;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    border-radius: 50px !important;
    padding: 0.6rem 1.8rem !important;
}

/* Cards Styling */
.course-card {
    border: none;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
    height: 100%;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-shadow-hover);
    border: 1px solid var(--primary-color);
}

.course-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f8fafc;
}

.course-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card:hover .course-img {
    transform: scale(1.1);
}

.course-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.8rem;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-body {
    padding: 1.5rem;
}

.course-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

.teacher-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.rating {
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.course-price {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Section Header */
.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-subtitle {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-weight: 800;
    font-size: 2.5rem;
}

/* Feature Icon */
.feature-box {
    padding: 2rem;
    background: var(--white);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-box:hover {
    background: var(--primary-color);
}

.feature-box:hover * {
    color: var(--white) !important;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Stats Counter */
.stat-box {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    font-weight: 600;
    color: var(--text-muted);
}

/* Testimonials */
.testimonial-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin: 1rem;
}

.student-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

/* Sidebar Details */
.sticky-sidebar {
    position: sticky;
    top: 100px;
}

.detail-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow-hover);
    overflow: hidden;
}

/* Footer Styling */
footer {
    background: var(--dark-bg);
    color: #94a3b8;
    padding-top: 80px;
}

footer .footer-title {
    color: var(--white);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

footer .footer-link {
    color: #94a3b8;
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
    transition: color 0.3s ease;
}

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

.newsletter-form {
    background: rgba(255,255,255,0.05);
    padding: 0.5rem;
    border-radius: 50px;
    display: flex;
    overflow: hidden;
}

.newsletter-input {
    background: transparent;
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    flex-grow: 1;
    font-size: 0.9rem;
}

.newsletter-input:focus {
    outline: none;
}

/* Waves and Patterns */
.wave-bg {
    position: relative;
    overflow: hidden;
}

.wave-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23f2a93b' fill-opacity='0.1' d='M0,160L48,176C96,192,192,224,288,213.3C384,203,480,149,576,128C672,107,768,117,864,138.7C960,160,1056,192,1152,197.3C1248,203,1344,181,1392,170.7L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    z-index: 1;
    pointer-events: none;
}

.dark-wave-bg {
    background: linear-gradient(135deg, #9a1635 0%, #22141a 100%);
    position: relative;
}

.dark-wave-bg::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23f8f1e9' fill-opacity='1' d='M0,224L60,213.3C120,203,240,181,360,181.3C480,181,600,203,720,224C840,245,960,267,1080,250.7C1200,235,1320,181,1380,154.7L1440,128L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(to right, #f2a93b, #ff8c00) !important;
    border: none !important;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    color: #22141a !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(242, 169, 59, 0.2);
}

.btn-primary:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 169, 59, 0.4);
    background: linear-gradient(to right, #ff8c00, #f2a93b) !important;
}

/* Filters */
.filter-card {
    border: none;
    border-radius: 12px;
    background: white;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.filter-title {
    font-weight: 700;
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

/* Skeleton Loaders (Optional improvement) */
@keyframes loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Latest Updates Ribbon */
.updates-ribbon {
    background: linear-gradient(90deg, #9a1635 0%, #f2a93b 100%);
    overflow: hidden;
    position: relative;
    z-index: 100;
    box-shadow: 0 12px 32px -4px rgba(154, 22, 53, 0.1);
    height: 50px;
    display: flex;
    align-items: center;
}

.ribbon-label {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 110;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.ribbon-label i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.ribbon-track-wrapper {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.ribbon-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: ribbon-scroll 60s linear infinite;
}

.ribbon-track:hover {
    animation-play-state: paused;
}

.ribbon-item {
    display: inline-flex;
    align-items: center;
    color: white;
    font-weight: 500;
    margin-right: 3rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.ribbon-dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    margin-right: 1.5rem;
}

.ribbon-btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    margin-left: 0.8rem;
    transition: all 0.3s ease;
}

.ribbon-btn:hover {
    background: white;
    color: #004bca !important;
    border-color: white;
}

@keyframes ribbon-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========================================
   RESPONSIVE MEDIA QUERIES
   ======================================== */

/* Tablet and smaller adjustments */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

/* Mobile overrides */
@media (max-width: 768px) {
    /* Global Spacing & Typography */
    section.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    .section-title { font-size: 1.8rem !important; margin-bottom: 1.5rem; }
    .section-subtitle { font-size: 0.75rem; }

    /* Navbar Adjustment */
    .navbar-brand { font-size: 1.25rem; }
    .navbar-brand img { height: 45px !important; }

    /* Ribbon Fix */
    .updates-ribbon { height: 40px; }
    .ribbon-label { padding: 0 0.8rem; font-size: 0.6rem; }
    .ribbon-label i { display: none; }
    .ribbon-item { font-size: 0.75rem; margin-right: 1.5rem; }
    .ribbon-dot { margin-right: 0.8rem; }
    .ribbon-btn { display: none; }

    /* Hero Section */
    .display-4 { font-size: 2.2rem; }
    .lead { font-size: 0.95rem !important; }

    /* Stats Section */
    .stat-box { padding: 1rem; }
    .stat-number { font-size: 1.8rem; }
    .stat-label { font-size: 0.75rem; }

    /* Course Cards Styling */
    .course-card { margin-bottom: 1.5rem; border-radius: 12px !important; }
    .course-body { padding: 1rem !important; }
    .course-title { font-size: 0.95rem !important; line-height: 1.4; margin-bottom: 0.5rem; }
    .course-img-wrapper { height: 160px !important; }
    .teacher-info { font-size: 0.8rem !important; margin-bottom: 0.5rem !important; }
    .course-footer { flex-direction: column; align-items: flex-start !important; gap: 10px; }
    .course-footer form, .course-footer button { width: 100%; }
    .price-box { width: 100%; display: flex; align-items: baseline; justify-content: space-between; }

    /* Horizontal Course Card (Cart) */
    .course-card-horizontal .row.g-0 { flex-direction: column; }
    .course-card-horizontal .col-md-3 { height: 150px !important; width: 100%; }
    .course-card-horizontal .col-md-3 div { height: 100% !important; min-height: 150px !important; }
    .course-card-horizontal .card-body { padding: 1rem !important; text-align: center; }
    .course-card-horizontal .card-body .d-flex { flex-direction: column; align-items: center; text-align: center; }
    .course-card-horizontal .text-md-end { text-align: center !important; margin-top: 10px; }

    /* Teacher Profile Fixes */
    .course-card.text-center .bg-light.rounded-circle { width: 100px !important; height: 100px !important; margin-bottom: 1rem !important; }
    .course-card h5 { font-size: 1.1rem !important; }
    .course-card p.small { font-size: 0.75rem !important; margin-bottom: 0.8rem !important; }
    .course-card .d-flex.justify-content-center.gap-3 { gap: 1rem !important; padding: 1rem 0 !important; }

    /* Checkout & Summary */
    .sticky-sidebar { position: static !important; margin-top: 2rem; }
    .summary-card { padding: 1.5rem !important; border-radius: 12px !important; }

    /* Responsive Course Detail Page Sidebar */
    .sticky-sidebar { position: static !important; margin-top: 0; }
    .detail-card {
        margin-top: 0 !important;
        border-radius: 16px !important;
        box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
        border: 1px solid rgba(0,0,0,0.05);
    }
    .detail-card .card-body { padding: 1.5rem !important; }
    .detail-card h2 { font-size: 1.8rem !important; }
    .detail-card .btn-lg { padding: 12px !important; font-size: 1rem !important; border-radius: 12px !important; }
    .detail-card ul.list-unstyled li { margin-bottom: 1rem !important; font-size: 0.85rem !important; }
    .detail-card .d-flex.justify-content-center.gap-4 { gap: 1rem !important; flex-wrap: wrap; }

    /* Tables on Mobile - Card-stacking view */
    .table-premium thead { display: none; }
    .table-premium tbody tr {
        display: block;
        margin-bottom: 1.5rem;
        background: white;
        border-radius: 1rem;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        border: 1px solid rgba(0,0,0,0.05);
    }
    .table-premium tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.75rem 0.5rem !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }
    .table-premium tbody td:last-child { border-bottom: none !important; }
    .table-premium tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: var(--text-muted);
    }
    .table-premium tbody td:first-child {
        background: var(--light-bg);
        margin: -1rem -1rem 0.5rem -1rem;
        border-radius: 1rem 1rem 0 0;
        justify-content: center;
        padding: 1rem !important;
    }
    .table-premium tbody td:first-child::before { display: none; }

    /* Forms on Mobile */
    .form-control, .form-select { font-size: 16px !important; }
    .btn { width: 100%; margin-bottom: 0.5rem; }
    .btn-sm, .btn-icon-custom, .navbar-toggler, .dropdown-toggle { width: auto; margin-bottom: 0; }

    /* Grid adjustments */
    .row.g-4 > [class*='col-'] { margin-bottom: 1rem; }
}

/* Live Pulse Animation */
.pulse { 
    animation: pulse-red 2s infinite; 
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}
@keyframes pulse-red { 
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); } 
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); } 
}

@media (min-width: 992px) {
    .sticky-sidebar {
        position: sticky !important;
        top: 100px;
        z-index: 10;
    }
    .detail-card {
        margin-top: -150px !important;
    }
}
