/* ============================================
   TABLE OF CONTENTS
   ============================================
   1. CSS Variables & Reset
   2. Base Styles & Typography
   3. Layout & Container
   4. Navigation (Navbar + Burger Menu)
   5. Hero Section & Search Banner
   6. Categories Section
   7. Promo Section
   8. Course Table & Cards (List Page)
   9. Detail Page
   10. Footer
   11. Buttons & Components
   12. Animations & Utilities
   13. Responsive Breakpoints
   ============================================ */

/* --------------------------------------------
   1. CSS Variables & Reset
-------------------------------------------- */
:root {
    /* Color Palette - Blue & White Theme */
    --primary-50: #eef5ff;
    --primary-100: #d9e9ff;
    --primary-200: #b8d6ff;
    --primary-300: #8cbaff;
    --primary-400: #5b96f0;
    --primary-500: #0a4b8c;      /* Main Primary */
    --primary-600: #063a6b;
    --primary-700: #042a4d;
    --primary-800: #021c33;
    --primary-900: #010e1a;
    
    --accent-400: #00a3e0;
    --accent-500: #0088bb;
    --accent-600: #006d96;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --discount: #d62828;
    
    /* Spacing System */
    --space-xs: 0.5rem;    /* 8px */
    --space-sm: 0.75rem;   /* 12px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Borders */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --------------------------------------------
   2. Base Styles & Typography
-------------------------------------------- */
body {
    font-family: var(--font-family);
    font-size: var(--font-md);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--font-4xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-3xl);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--font-xl);
}

p {
    margin-bottom: var(--space-md);
    color: var(--gray-600);
}

a {
    text-decoration: none;
    color: var(--primary-500);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-600);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------
   3. Layout & Container
-------------------------------------------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-3xl) 0;
}

.section-sm {
    padding: var(--space-2xl) 0;
}

/* --------------------------------------------
   4. Navigation (Navbar + Burger Menu)
-------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: var(--font-2xl);
    font-weight: 800;
    color: var(--primary-500);
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--accent-400);
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    gap: var(--space-xl);
    list-style: none;
}

.nav-links li a {
    font-weight: 500;
    color: var(--gray-700);
    padding: var(--space-xs) 0;
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-500);
    transition: width var(--transition-base);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.nav-links li a:hover {
    color: var(--primary-500);
}

/* Burger Menu (Mobile) */
.burger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: var(--space-xs);
}

.burger .line {
    width: 28px;
    height: 2px;
    background: var(--gray-800);
    transition: var(--transition-base);
}

.burger.active .line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.active .line:nth-child(2) {
    opacity: 0;
}

.burger.active .line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* --------------------------------------------
   5. Hero Section & Search Banner
-------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--primary-50) 0%, white 100%);
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(10,75,140,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.6s ease;
}

.highlight {
    color: var(--accent-400);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(0, 163, 224, 0.2);
    z-index: -1;
}

.hero p {
    font-size: var(--font-lg);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.6s ease 0.1s both;
}

/* Search Banner */
.search-banner {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.search-form {
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--radius-full);
    padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg);
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition-base);
}

.search-form:focus-within {
    box-shadow: var(--shadow-xl);
}

.search-form i {
    color: var(--gray-400);
    font-size: var(--font-lg);
}

.search-form input {
    flex: 1;
    border: none;
    padding: var(--space-md);
    font-size: var(--font-md);
    outline: none;
    background: transparent;
}

.search-form input::placeholder {
    color: var(--gray-400);
}

.search-form button {
    background: var(--primary-500);
    border: none;
    color: white;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.search-form button:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
}

/* --------------------------------------------
   6. Categories Section
-------------------------------------------- */
.categories {
    padding: var(--space-3xl) 0;
    background: white;
}

.categories h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-lg);
}

.cat-card {
    background: var(--gray-50);
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 1px solid transparent;
}

.cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-200);
    box-shadow: var(--shadow-lg);
}

.cat-card i {
    font-size: 2.5rem;
    color: var(--primary-500);
    margin-bottom: var(--space-md);
}

.cat-card h3 {
    margin-bottom: var(--space-xs);
    font-size: var(--font-lg);
}

.cat-card p {
    color: var(--gray-500);
    font-size: var(--font-sm);
    margin-bottom: 0;
}

/* --------------------------------------------
   7. Promo Section
-------------------------------------------- */
.promo-section {
    padding: var(--space-3xl) 0;
    background: var(--gray-50);
}

.promo-section h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.promo-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.promo-card::before {
    content: 'HOT';
    position: absolute;
    top: var(--space-md);
    right: -30px;
    background: var(--discount);
    color: white;
    padding: 4px 30px;
    font-size: var(--font-xs);
    font-weight: 700;
    transform: rotate(45deg);
}

.promo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}

.promo-card h3 {
    font-size: var(--font-xl);
    margin-bottom: var(--space-sm);
    padding-right: var(--space-lg);
}

.rating {
    color: var(--warning);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.old-price {
    text-decoration: line-through;
    color: var(--gray-400);
    font-size: var(--font-sm);
    margin-right: var(--space-sm);
}

.discount-price {
    color: var(--discount);
    font-weight: 700;
    font-size: var(--font-xl);
}

.promo-card a {
    display: inline-block;
    margin-top: var(--space-md);
    font-weight: 600;
    color: var(--primary-500);
}

.promo-card a:hover {
    color: var(--primary-600);
}

/* --------------------------------------------
   8. Course Table & Cards (List Page)
-------------------------------------------- */
.page-title {
    margin: var(--space-2xl) 0 var(--space-xl);
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    margin: var(--space-xl) 0;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    background: white;
}

.course-table {
    width: 100%;
    border-collapse: collapse;
}

.course-table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.course-table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-table td {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.course-table tr:hover {
    background: var(--gray-50);
}

.course-table strong {
    color: var(--gray-800);
}

/* Card List (Mobile Alternative) */
.cards-list {
    display: none;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.card-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: var(--transition-base);
}

.card-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-item h3 {
    margin-bottom: var(--space-sm);
    font-size: var(--font-lg);
}

.card-item p {
    margin-bottom: var(--space-sm);
}

.btn-small {
    display: inline-block;
    background: var(--primary-500);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: 600;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
}

.btn-small:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
    color: white;
}

/* --------------------------------------------
   9. Detail Page
-------------------------------------------- */
.detail-container {
    padding: var(--space-2xl) var(--space-lg);
}

.detail-card {
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.detail-card > *:not(:last-child) {
    border-bottom: 1px solid var(--gray-200);
}

.detail-card h2 {
    padding: var(--space-lg) var(--space-xl) 0;
    margin-bottom: var(--space-md);
}

.detail-card p,
.detail-card ul {
    padding: 0 var(--space-xl);
}

.detail-card ul {
    list-style: none;
    margin-bottom: var(--space-lg);
}

.detail-card ul li {
    padding: var(--space-xs) 0;
    color: var(--gray-700);
}

.detail-card ul li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
    margin-right: var(--space-sm);
}

.map-container {
    margin: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.price-box {
    background: var(--gray-50);
    padding: var(--space-xl);
    text-align: center;
}

.price-box .old-price {
    font-size: var(--font-lg);
    display: inline-block;
    margin-right: var(--space-md);
}

.price-box .new-price {
    font-size: var(--font-3xl);
    font-weight: 800;
    color: var(--discount);
    display: inline-block;
}

.btn-primary {
    background: var(--primary-500);
    border: none;
    padding: var(--space-md) var(--space-xl);
    color: white;
    font-weight: 700;
    font-size: var(--font-lg);
    border-radius: var(--radius-full);
    cursor: pointer;
    width: 100%;
    margin-top: var(--space-lg);
    transition: all var(--transition-base);
}

.btn-primary:hover {
    background: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* --------------------------------------------
   10. Footer
-------------------------------------------- */
footer {
    background: var(--gray-900);
    color: var(--gray-400);
    text-align: center;
    padding: var(--space-xl);
    margin-top: var(--space-3xl);
}

footer p {
    margin-bottom: 0;
    color: var(--gray-400);
}

footer a {
    color: var(--gray-300);
    text-decoration: underline;
}

footer a:hover {
    color: white;
}

/* --------------------------------------------
   11. Buttons & Components
-------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    font-size: var(--font-sm);
}

.btn-primary-outline {
    background: transparent;
    border: 2px solid var(--primary-500);
    color: var(--primary-500);
}

.btn-primary-outline:hover {
    background: var(--primary-500);
    color: white;
}

/* --------------------------------------------
   12. Animations & Utilities
-------------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

/* --------------------------------------------
   13. Responsive Breakpoints
-------------------------------------------- */
/* Tablet */
@media (max-width: 768px) {
    :root {
        --font-4xl: 1.875rem;
        --font-3xl: 1.5rem;
    }
    
    .container {
        padding: 0 var(--space-md);
    }
    
    .section {
        padding: var(--space-2xl) 0;
    }
    
    /* Hide table, show cards */
    .course-table thead {
        display: none;
    }
    
    .table-wrapper {
        display: none;
    }
    
    .cards-list {
        display: grid;
    }
    
    .course-table tr {
        display: block;
        margin-bottom: var(--space-md);
    }
    
    .course-table td {
        display: block;
        text-align: right;
        padding: var(--space-sm);
        position: relative;
        padding-left: 50%;
    }
    
    .course-table td::before {
        content: attr(data-label);
        position: absolute;
        left: var(--space-md);
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--gray-700);
    }
}

/* Mobile */
@media (max-width: 640px) {
    /* Burger Menu Active */
    .burger {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-200);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        border-bottom: 1px solid var(--gray-100);
    }
    
    .nav-links li a {
        display: block;
        padding: var(--space-md) var(--space-lg);
    }
    
    .nav-links li a::after {
        display: none;
    }
    
    .hero {
        padding: var(--space-2xl) var(--space-md);
    }
    
    .hero h1 {
        font-size: var(--font-3xl);
    }
    
    .search-form {
        flex-direction: column;
        background: transparent;
        box-shadow: none;
        gap: var(--space-sm);
    }
    
    .search-form input {
        background: white;
        border-radius: var(--radius-full);
        border: 1px solid var(--gray-200);
        width: 100%;
    }
    
    .search-form button {
        width: 100%;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .promo-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-card h2,
    .detail-card p,
    .detail-card ul {
        padding: 0 var(--space-lg);
    }
    
    .map-container {
        margin: var(--space-lg);
    }
    
    .price-box .new-price {
        font-size: var(--font-2xl);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .cat-card {
        padding: var(--space-lg);
    }
}

/* Desktop Large */
@media (min-width: 1280px) {
    .container {
        padding: 0;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .burger,
    .search-banner,
    footer,
    .btn-primary {
        display: none;
    }
    
    body {
        color: black;
    }
    
    .detail-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}