:root {
    --navy: #10355E;
    --orange: #F7931E;
    --white: #ffffff;
    --grey: #F4F7F9;
    --text: #334155;
    --bg-color: #f0f2f5;
    --transition: all 0.3s ease;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--navy);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: var(--transition);
}

/* Admin Table Scrolling */
.table-container {
    width: 100%;
    overflow: auto;
    /* Scroll X and Y */
    max-height: 500px;
    /* Fixed height for vertical scroll */
    border: 1px solid #eee;
    border-radius: 8px;
    background: white;
}

.table-container table {
    width: 100%;
    min-width: 800px;
    /* Ensure content is wide enough to trigger scroll on small screens */
    border-collapse: collapse;
}

.table-container th {
    position: sticky;
    top: 0;
    background: #f4f4f9;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.nav-links a:hover {
    color: var(--orange);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
    flex: 1;
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background-color: #0d2a4a;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--orange);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #e08210;
    transform: translateY(-2px);
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 5rem auto;
    padding: 2rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--navy);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--navy);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Footer */
footer {
    background-color: var(--navy);
    color: var(--white);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* Utility Colors */
.text-navy {
    color: var(--navy);
}

.text-orange {
    color: var(--orange);
}

.text-white {
    color: var(--white);
}

/* Hero Section */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4rem 5%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    min-height: 70vh;
}

.hero-content {
    flex: 1;
    padding-right: 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--navy);
}

.hero .highlight {
    color: var(--orange);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text);
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--navy);
    animation: float 6s ease-in-out infinite;
}

.hero-image i {
    filter: drop-shadow(0 10px 20px rgba(16, 53, 94, 0.2));
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

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

/* Features Section */
.features {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 5rem 5%;
    background-color: var(--white);
}

.feature-card {
    flex: 1;
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
    background: white;
}

.feature-card i {
    font-size: 3rem;
    color: var(--orange);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Mobile Navigation */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--navy);
    margin: 5px;
    transition: all 0.3s ease;
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 70px;
        /* Adjust based on navbar height */
        background-color: var(--white);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
        padding-top: 2rem;
    }

    .nav-links li {
        opacity: 0;
        margin-left: 0;
        margin-bottom: 2rem;
    }

    .burger {
        display: block;
    }
}

.nav-active {
    transform: translateX(0%);
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Content Cards & Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}

.content-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.content-img-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: white;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
}

.content-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.content-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

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

/* --- Mobile Responsiveness Enhancements --- */
@media screen and (max-width: 768px) {

    /* Hero Section Stacking */
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 3rem 1rem;
        min-height: auto;
    }

    .hero-content {
        padding-right: 0;
        margin-top: 2rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
        margin: 0 auto 1.5rem auto;
    }

    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        gap: 0.8rem;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .hero-image i {
        font-size: 8rem !important;
        /* Scale down giant icon if present */
    }

    /* Features Section */
    .features {
        flex-direction: column;
        padding: 3rem 1rem;
        gap: 1.5rem;
    }

    /* Admin Dashboard Stats */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Forms */
    .form-container {
        margin: 2rem auto;
        padding: 1.5rem;
        width: 95%;
    }

    /* General Containers */
    .container {
        padding: 1.5rem 15px;
    }

    /* Typography Scaling */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    /* Content Grids (My Learning, Courses) */
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Admin/Sidebar */
    aside {
        width: 100% !important;
        margin-bottom: 2rem;
    }
}