:root {
    --primary-color: #4a6741;
    /* Botanical Green */
    --secondary-color: #8da083;
    /* Soft Green */
    --accent-color: #d4a373;
    /* Earthy Gold */
    --bg-color: #f8f9f5;
    --text-color: #2b2d42;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1 0 auto;
}

/* Header Styling */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.brand-logo-img {
    height: 48px;
    width: 48px;
    object-fit: cover;
    border-radius: 12px;
    margin-right: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.navbar-brand:hover .brand-logo-img {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 15px rgba(74, 103, 65, 0.2);
}

.nav-link {
    font-weight: 500;
    color: var(--text-color) !important;
    margin: 0 10px;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9f5 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    border-radius: 50%;
    opacity: 0.1;
    z-index: 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #6c757d;
    margin-bottom: 2.5rem;
}

/* Card Styling */
.course-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: white;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.course-card .card-img-container {
    position: static;
    /* Let absolute children find the course-card parent */
    overflow: hidden;
}

.course-card .course-badge-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.course-card .card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card:hover .card-img-top {
    transform: scale(1.05);
}

.course-card .card-body {
    padding: 1.5rem;
    position: static;
    /* Important for stretched-link to reach parent */
}

/* Ensure stretched link is above images and overlays */
.stretched-link::after {
    z-index: 10;
}

.course-card .card-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.hover-lift {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 30px;
    padding: 0.6rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #385031;
    border-color: #385031;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 103, 65, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 30px;
    padding: 0.6rem 2rem;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* Footer */
.footer {
    background-color: #2b2d42;
    color: white;
    padding: 60px 0 20px;
    margin-top: 100px;
    flex-shrink: 0;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    display: block;
    text-decoration: none;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    margin-bottom: 10px;
}

.footer-link:hover {
    color: var(--secondary-color);
}