@import 'variables.css';

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xxl);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    margin: var(--spacing-sm) auto 0;
    border-radius: var(--radius-sm);
}

/* Navbar */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-links a {
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s;
}

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

/* Premium Auth Buttons */
.nav-links .btn-login {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white !important;
    /* Override nav link color */
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 74, 156, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    /* Ensure no underline */
}

.nav-links .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 74, 156, 0.35);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white !important;
}

/* Dashboard Button (Logged In) */
.nav-links .btn-dashboard {
    background: linear-gradient(135deg, var(--accent-color) 0%, #e67e22 100%);
    color: white !important;
    padding: 8px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(255, 159, 67, 0.3);
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-links .btn-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 159, 67, 0.4);
    color: white !important;
}

/* Logout Button */
.nav-links .btn-logout {
    background: transparent;
    color: var(--text-light) !important;
    border: 1px solid #e0e0e0;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.nav-links .btn-logout:hover {
    background: #ffebee;
    color: #c62828 !important;
    border-color: #ffcdd2;
}

/* Mobile Menu */
.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Implement JS toggle later */
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-md);
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }
}

/* Video Course Card Styles */
.courses-scroll-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    gap: 30px;
    padding: 20px 5px;
    /* Top/Bottom padding for shadows */
    width: 100%;

    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.courses-scroll-container::-webkit-scrollbar {
    display: none;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;

    /* Sizing for 3 columns with gap */
    flex: 0 0 calc(33.333% - 20px);
    min-width: 300px;
    /* Minimum width for readability */
    scroll-snap-align: start;
}

@media (max-width: 1024px) {
    .course-card {
        flex: 0 0 calc(50% - 15px);
        /* 2 columns on tablets */
    }
}

@media (max-width: 768px) {
    .course-card {
        flex: 0 0 calc(85% - 15px);
        /* Mostly full width on mobile to encourage scrolling */
        min-width: 280px;
    }
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.course-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #f0f0f0;
    /* Fallback color */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.thumbnail-header {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3;
    /* higher than image and overlay */
}

.price-badge-top {
    font-weight: 600;
    color: var(--white);
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.live-badge {
    background-color: #ff4757;
    color: var(--white);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--white);
    border-radius: 50%;
    display: inline-block;
}

.play-icon-container {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.4);
    /* Darker background for visibility on images */
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.course-card:hover .play-icon-container {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.course-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
    line-height: 1.4;
}

.course-meta {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
}

.course-schedule {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
}

.discount-text {
    color: #2ecc71;
    font-weight: 600;
    font-size: 0.9rem;
}

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

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-details {
    flex: 1;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s;
}

.btn-details:hover {
    background-color: var(--primary-dark);
}

.btn-join {
    flex: 1;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: white;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
    transition: 0.3s;
}

.footer-col ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    color: #888;
}

/* --- Mobile Optimization Overrides --- */
@media (max-width: 768px) {

    /* Global Spacing */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: var(--spacing-lg);
    }

    /* Typography */
    h1 {
        font-size: 2rem !important;
        /* Override hero h1 */
    }

    body {
        font-size: 15px;
        /* Slightly smaller body text */
    }

    /* Layout */
    .container {
        padding: 0 20px;
        /* Ensure edge spacing */
    }

    /* Hero Section */
    .hero {
        padding: 50px 0 !important;
        text-align: center;
    }

    .hero-content {
        padding-right: 0 !important;
        margin-bottom: 40px;
    }

    .hero-btns {
        justify-content: center;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .hero-btns .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        /* Single column */
        gap: 20px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        /* Stack footer columns */
        text-align: center;
    }
}

@media (max-width: 480px) {

    /* Small Mobile Specifics */
    .course-card {
        min-width: 100%;
        /* Full width cards on small screens */
        flex: 0 0 100%;
    }
}

/* --- Bottom Navigation (Mobile Only) --- */
.bottom-nav {
    display: none;
    /* Hidden by default */
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
        /* Space for bottom nav */
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        justify-content: space-around;
        padding: 10px 0;
        z-index: 2000;
        border-top: 1px solid #eee;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #888;
        font-size: 0.75rem;
        gap: 4px;
        flex: 1;
    }

    .nav-item i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .nav-item.active {
        color: var(--primary-color);
        font-weight: 600;
    }

    .nav-item:hover {
        color: var(--primary-color);
    }
}