/* Design System Variables */
:root {
    --background: hsl(222, 84%, 4.9%);
    --foreground: hsl(210, 40%, 98%);
    --primary: hsl(166, 76%, 46%);
    --primary-foreground: hsl(210, 40%, 98%);
    --secondary: hsl(217, 32.6%, 17.5%);
    --muted-foreground: hsl(215, 20.2%, 65.1%);
    --course-card: hsl(216, 34%, 12%);
    --course-card-hover: hsl(216, 34%, 15%);
    --success: hsl(142, 71%, 45%);
    --warning: hsl(45, 93%, 58%);
    --destructive: hsl(0, 62.8%, 30.6%);
    --border: hsl(217, 32.6%, 17.5%);
    --radius: 0.75rem;
    --shadow-glow: 0 0 40px hsl(166, 76%, 46%, 0.2);
}

/* ════════════════════════
   NAVBAR
════════════════════════ */
.navbar {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 1000;
    background: rgba(3, 18, 13, .4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: background .3s, border-color .3s, box-shadow .3s;
    padding: 1.1em 5em;
}

.navbar.nav-scrolled {
    background: rgba(3, 18, 13, .96);
    border-bottom-color: var(--green-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, .55);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    min-width: 130px;
    width: 170px;
    object-fit: contain;
    object-position: center;
    transition: all 0.15s ease;
    cursor: pointer;
    height: 40px;
    filter: brightness(1.2);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.4em;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--txt-sub);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: color .25s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green);
    border-radius: 2px;
    transition: width .3s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--green);
}

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

.nav-cta {
    background: var(--green);
    color: #03120d;
    font-size: .92rem;
    font-weight: 800;
    padding: .6em 1.5em;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: .5px;
    transition: background .25s, box-shadow .25s, transform .2s;
    box-shadow: 0 0 20px rgba(0, 255, 136, .25);
}

.nav-cta:hover {
    background: var(--green-mid);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 255, 136, .4);
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: #00ff88;
    cursor: pointer;
}

.mobile-menu-toggle .close {
    display: none;
}

.mobile-nav-container {
    display: none;
    position: fixed;
    top: 70px;
    right: -100%;
    width: 300px;
    height: calc(100vh - 70px);
    background: rgba(3, 18, 13, 0.98);
    backdrop-filter: blur(10px);
    z-index: 999;
    transition: right 0.3s ease;
    border-left: 1px solid rgba(0, 255, 136, 0.2);
}

.mobile-nav-container.active {
    right: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
}

.mobile-nav-links a {
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links .enroll-now-mobile {
    background: rgba(0, 255, 136, 0.1);
    color: var(--green);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    margin-top: 3rem;
}

/* Courses Section */
.courses-section {
    min-height: 100vh;
    padding: 4rem 0;
}

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

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--foreground);
}

.main-title .accent {
    color: var(--primary);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.75;
}

/* Categories */
.categories-container {
    margin-bottom: 4rem;
}

.category-section {
    margin-bottom: 4rem;
}

.category-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* Courses Grid - 4 per row */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }
}

/* Course Card - Minimized content */
.course-card {
    background: var(--course-card);
    border: 1px solid var(--course-card-hover);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
    display: grid;
    grid-template-rows: 45% 55%;
    height: 380px;
}

/* Staggered animation delay for cards */
.course-card:nth-child(1) {
    animation-delay: 0.1s;
}

.course-card:nth-child(2) {
    animation-delay: 0.2s;
}

.course-card:nth-child(3) {
    animation-delay: 0.3s;
}

.course-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Border glow effect */
.course-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
            hsl(166, 76%, 46%) 0%,
            transparent 25%,
            transparent 75%,
            hsl(166, 76%, 46%) 100%);
    border-radius: calc(var(--radius) + 2px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

/* Hover state */
.course-card:hover {
    background: var(--course-card-hover);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px hsl(166, 76%, 46%, 0.15);
}

.course-card:hover::before {
    opacity: 1;
}

.course-image {
    position: relative;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Badge */
.badge {
    position: absolute;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.badge-category {
    top: 0.5rem;
    left: 0.5rem;
    background: hsl(166, 76%, 46%, 0.9);
    color: var(--primary-foreground);
}

.badge-level {
    top: 0.5rem;
    right: 0.5rem;
    border: 1px solid;
}

.badge-beginner {
    border-color: var(--success);
    color: var(--success);
    background: hsl(142, 71%, 45%, 0.1);
}

.badge-intermediate {
    border-color: var(--warning);
    color: var(--warning);
    background: hsl(45, 93%, 58%, 0.1);
}

.badge-advanced {
    border-color: var(--destructive);
    color: var(--destructive);
    background: hsl(0, 62.8%, 30.6%, 0.1);
}

/* Content - Minimized */
.course-content {
    padding: 1rem;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-card:hover .course-content {
    transform: translateY(-2px);
}

.course-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.course-description {
    font-size: .8rem;
    margin-bottom: 1rem;
}

.course-card:hover .course-title {
    color: var(--primary);
}

.course-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.icon {
    width: 0.875rem;
    height: 0.875rem;
}

.course-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.price-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.price-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.original-price {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-decoration: line-through;
}

.current-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.duration {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.75rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 0 20px hsl(166, 76%, 46%, 0.2);
}

.btn-primary:hover {
    background: hsl(166, 76%, 41%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px hsl(166, 76%, 46%, 0.3);
}

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    transform: translateY(-1px);
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin-top: 4rem;
}

.cta-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            hsl(166, 76%, 46%, 0.1),
            transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.cta-description {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 0.75rem 2rem;
    font-size: 0.875rem;
}

/* Fade in animation */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .navbar {
        padding: 1em 2.5em;
    }
}

@media (max-width: 1000px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-nav-container {
        display: block;
    }

    .nav-cta {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .courses-grid {
        gap: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 200px;
    }
}

@media (max-width: 520px) {
    .navbar {
        padding: 1em 1.5em;
    }
}