@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4A7C59; /* Soothing Sage Green */
    --primary-hover: #3C6749;
    --bg-dark: #FAF7F2; /* Soft Warm Cream */
    --bg-card: #FFFFFF; /* Pure White Cards */
    --text-main: #2D3D36; /* Slate Charcoal with Forest Tint */
    --text-muted: #7A8A82; /* Muted Sage-Grey */
    --accent: #E07A5F; /* Soft Warm Terracotta */
    --danger: #E07A5F; /* Friendly Red/Terracotta */
    --success: #4A7C59; /* Sage Green */
    --glass-border: rgba(74, 124, 89, 0.08); /* Gentle Border */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Calm Radial Ambient Glow */
body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 800px;
    background: radial-gradient(circle, rgba(74, 124, 89, 0.04) 0%, rgba(250, 247, 242, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Friendly Soft Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 30px rgba(74, 124, 89, 0.03);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(74, 124, 89, 0.2);
    box-shadow: 0 15px 35px rgba(74, 124, 89, 0.06);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.2rem;
    border-radius: 50px; /* Pill shape */
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: #FAF7F2;
    box-shadow: 0 4px 15px rgba(74, 124, 89, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.25);
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(74, 124, 89, 0.2);
    color: var(--primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(74, 124, 89, 0.03);
    color: var(--primary-hover);
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    padding: 0.9rem 1.1rem;
    background: #FFFFFF;
    border: 1px solid rgba(74, 124, 89, 0.12);
    border-radius: 12px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.08);
}

/* Calming Top Navigation Bar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    background: rgba(250, 247, 242, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(74, 124, 89, 0.06);
    box-shadow: 0 2px 20px rgba(74, 124, 89, 0.02);
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

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

.nav-links a.btn-primary {
    color: #FAF7F2;
    margin-left: 2rem;
    padding: 0.7rem 1.6rem;
    border-radius: 50px;
}

.nav-links a.btn-primary:hover {
    color: #FAF7F2;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 8rem 0 5rem;
    position: relative;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.15;
    color: var(--text-main);
    font-weight: 700;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 680px;
    margin: 0 auto 2.5rem;
    line-height: 1.8;
}

/* Course Grid (Horizontal 3-Column Grid) */
.course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
}

.course-grid .glass-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.course-card img, .glass-card img {
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.glass-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

/* Admin Dashboard */
.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #FFFFFF;
    border-right: 1px solid rgba(74, 124, 89, 0.08);
    padding: 2rem;
}

.sidebar-link {
    display: block;
    padding: 0.8rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-link.active, .sidebar-link:hover {
    background: rgba(74, 124, 89, 0.06);
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* Straight Calming Slow Marquee Scroll */
.marquee-container {
    background: rgba(74, 124, 89, 0.05);
    color: var(--primary);
    padding: 1.2rem 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    margin: 5rem 0;
    width: 100%;
    border-top: 1px solid rgba(74, 124, 89, 0.08);
    border-bottom: 1px solid rgba(74, 124, 89, 0.08);
}

.marquee-content {
    display: inline-block;
    animation: marquee 45s linear infinite;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

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

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

/* Tabs UI */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.tab-btn {
    background: #FFFFFF;
    border: 1px solid rgba(74, 124, 89, 0.12);
    color: var(--text-main);
    padding: 0.75rem 1.6rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.tab-btn:hover, .tab-btn.active {
    background: var(--primary);
    color: #FAF7F2;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(74, 124, 89, 0.15);
}

/* Badges */
.card-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-student {
    background: rgba(74, 124, 89, 0.08);
    color: var(--primary);
    border: 1px solid rgba(74, 124, 89, 0.15);
}

.badge-professional {
    background: rgba(224, 122, 95, 0.08);
    color: var(--accent);
    border: 1px solid rgba(224, 122, 95, 0.15);
}

.badge-all {
    background: rgba(138, 149, 143, 0.1);
    color: #55665c;
    border: 1px solid rgba(138, 149, 143, 0.18);
}

.badge-difficulty {
    background: #FFFFFF;
    color: var(--text-muted);
    border: 1px solid rgba(74, 124, 89, 0.1);
}

.badge-difficulty.beginner {
    color: #4A7C59;
}

.badge-difficulty.intermediate {
    color: #b8860b;
}

.badge-difficulty.advanced {
    color: #E07A5F;
}

/* Ratings */
.stars {
    color: #e2b13c;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    margin-top: 5rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(74, 124, 89, 0.02);
}

.leaderboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(74, 124, 89, 0.05);
    transition: background 0.3s ease;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: rgba(74, 124, 89, 0.02);
}

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(74, 124, 89, 0.06);
    color: var(--primary);
}

.rank-1 {
    background: var(--accent);
    color: #FFFFFF;
}

.rank-2 {
    background: rgba(224, 122, 95, 0.2);
    color: var(--accent);
}

.rank-3 {
    background: rgba(74, 124, 89, 0.15);
    color: var(--primary);
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-meta span:first-child {
    font-weight: 600;
    color: var(--text-main);
}

.user-meta span:last-child {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.xp-badge {
    background: rgba(74, 124, 89, 0.06);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

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

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

@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    nav { flex-direction: column; padding: 1rem; gap: 0.75rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
    .nav-links a { margin-left: 0; }
    .marquee-container { margin: 3rem 0; }
}
