/* ============================================
   MySkillZone - Main Stylesheet
   Green Theme Training Platform
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-darker: #166534;
    --primary-light: #22c55e;
    --primary-lighter: #86efac;
    --primary-bg: #f0fdf4;
    --primary-bg-alt: #dcfce7;
    
    --secondary: #0f172a;
    --secondary-light: #1e293b;
    
    --accent: #059669;
    --accent-light: #34d399;
    
    --success: #16a34a;
    --warning: #eab308;
    --danger: #dc2626;
    --info: #2563eb;
    
    --text-primary: #1a1a2e;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-light: #d1d5db;
    
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --bg-dark: #0f172a;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }

/* ---- Container ---- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 640px; }
.container-md { max-width: 960px; }
.container-lg { max-width: 1280px; }
.container-xl { max-width: 1440px; }

/* ---- Grid ---- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---- Flex ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition-slow);
}
.navbar.scrolled {
    box-shadow: var(--shadow-md);
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}
.navbar-brand img {
    width: 40px;
    height: 40px;
}
.navbar-brand span {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links a {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    background: var(--primary-bg);
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile Menu */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    font-size: 1.5rem;
}
.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(16px);
    z-index: 999;
    padding: 20px;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
}
.mobile-menu.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    animation: mobileMenuSlide 0.25s ease forwards;
}
@keyframes mobileMenuSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.mobile-menu .mobile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}
.mobile-menu .mobile-menu-cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}
.mobile-menu .mobile-menu-cta .btn {
    justify-content: center;
    width: 100%;
}
.mobile-menu > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.05rem;
}
.mobile-menu > a:hover, .mobile-menu > a.active {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.5;
}
.btn i { font-size: 1.1rem; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

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

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-light); color: #fff; }

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-gray); color: var(--text-primary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-warning { background: var(--warning); color: var(--text-primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-info { background: var(--info); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-xl { padding: 16px 40px; font-size: 1.1rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; }
.btn-icon.btn-sm { padding: 6px; }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: visible;
    transition: var(--transition-slow);
}
.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-gray);
}
.card-body { padding: 20px; }
.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

/* Training Card */
.training-card { position: relative; }
.training-card .card-img { height: 200px; }
.training-card .card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
}
.training-card .card-price {
    position: absolute;
    top: 12px;
    right: 12px;
}
.training-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.training-card .card-title a { color: var(--text-primary); }
.training-card .card-title a:hover { color: var(--primary); }
.training-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.training-card .card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.training-card .card-provider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.training-card .provider-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
}
.training-card .provider-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.training-card .verified-tick {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Provider Card */
.provider-card { text-align: center; }
.provider-card .card-body { padding: 28px 20px; }
.provider-card .provider-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin: 0 auto 16px;
    border: 3px solid var(--primary-bg);
}
.provider-card .provider-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.provider-card .provider-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.provider-card .provider-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.provider-card .stat { text-align: center; }
.provider-card .stat-value { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.provider-card .stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fefce8; color: #854d0e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-info { background: #eff6ff; color: #1e40af; }
.badge-gray { background: var(--bg-gray); color: var(--text-secondary); }
.badge-dark { background: var(--secondary); color: #fff; }
.badge-lg { padding: 6px 16px; font-size: 0.85rem; }
.badge-price { background: var(--secondary); color: #fff; font-size: 0.9rem; padding: 6px 14px; font-weight: 700; }
.badge-free { background: var(--primary); color: #fff; font-size: 0.9rem; padding: 6px 14px; font-weight: 700; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-control {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
.form-control.error { border-color: var(--danger); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
}
.input-group .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}
.input-group-icon {
    position: relative;
}
.input-group-icon .form-control { padding-left: 44px; }
.input-group-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, #0f2a1a 0%, #15402a 30%, #0f172a 100%);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(22,163,74,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(34,197,94,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; }
.hero-content { text-align: center; max-width: 800px; margin: 0 auto; }
.hero h1 {
    font-size: 3.2rem;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.2;
}
.hero h1 .highlight { color: var(--primary-light); }
.hero p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-search {
    max-width: 620px;
    margin: 0 auto 40px;
    position: relative;
}
.hero-search .form-control {
    padding: 16px 60px 16px 52px;
    border-radius: var(--radius-xl);
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1.05rem;
    backdrop-filter: blur(8px);
}
.hero-search .form-control::placeholder { color: rgba(255,255,255,0.5); }
.hero-search .form-control:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 0 4px rgba(22,163,74,0.15);
}
.hero-search .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem;
}
.hero-search .btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: var(--radius-xl);
    padding: 10px 24px;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 48px;
}
.hero-stat { text-align: center; }
.hero-stat .number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
    display: block;
}
.hero-stat .label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

/* ============================================
   SECTION STYLES
   ============================================ */
.section { padding: 80px 0; }
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-header h2 { margin-bottom: 12px; }
.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}
.section-header .section-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    margin: 16px auto 0;
}
.section-alt { background: var(--bg-white); }

/* ============================================
   CATEGORIES BAR
   ============================================ */
.categories-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}
.categories-bar::-webkit-scrollbar { display: none; }
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.category-chip:hover, .category-chip.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}
.category-chip i { font-size: 1.1rem; }

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.search-bar .search-input {
    flex: 1;
    min-width: 250px;
}
.search-bar .filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow: visible;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-white);
}
.table-responsive {
    overflow: visible;
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead { background: var(--bg-gray); }
th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}
tbody tr:hover { background: var(--bg-light); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid;
}
.alert i { font-size: 1.2rem; margin-top: 1px; }
.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fefce8; border-color: #fde047; color: #854d0e; }
.alert-info { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.alert-dismissible { position: relative; padding-right: 44px; }
.alert-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.25s ease;
}
@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.2rem; }
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.modal-close:hover { background: var(--bg-gray); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 0;
    overflow-x: auto;
}
.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    color: var(--primary);
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}
.tab-panel { display: none; padding: 24px 0; }
.tab-panel.active { display: block; }
.tab-content { display: none; padding: 24px 0; }
.tab-content.active { display: block; }

/* ============================================
   STAR RATING
   ============================================ */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.star-rating i { color: var(--warning); font-size: 0.95rem; }
.star-rating .rating-number {
    margin-left: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-wrapper { display: flex; justify-content: center; margin-top: 40px; }
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
}
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.page-dots { color: var(--text-muted); padding: 0 4px; }

/* ============================================
   SIDEBAR (Dashboard)
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 0;
}
.sidebar {
    width: 270px;
    background: var(--secondary);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    overflow-y: auto;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
}
.sidebar-brand img { width: 32px; height: 32px; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--primary);
}
.sidebar-user .user-info h4 {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}
.sidebar-user .user-info span {
    font-size: 0.78rem;
    color: var(--primary-light);
}
.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-nav .nav-section {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35);
    padding: 16px 16px 8px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
}
.sidebar-nav a i { font-size: 1.2rem; width: 20px; text-align: center; }
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
}
.sidebar-nav a .badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Dashboard Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 270px;
    min-height: 100vh;
    background: var(--bg-light);
}
.sidebar-toggle { display: none; }
.main-content { min-width: 0; overflow-wrap: break-word; }
.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 99;
}
.dashboard-topbar h2 { font-size: 1.3rem; }
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.notification-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}
.notification-btn:hover { background: var(--bg-gray); }
.notification-btn .notif-count {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.dashboard-content { padding: 32px; }

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-card .stat-icon.green { background: var(--primary-bg); color: var(--primary); }
.stat-card .stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-card .stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-card .stat-icon.purple { background: #faf5ff; color: #9333ea; }
.stat-card .stat-icon.red { background: #fef2f2; color: #dc2626; }
.stat-card .stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.stat-card .stat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}
.stat-card .stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.stat-card .stat-trend.up { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 64px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand { max-width: 340px; }
.footer-brand h3 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 1.3rem;
}
.footer-brand p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    line-height: 1.7;
}
.footer h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1rem;
}
.footer-links a {
    display: block;
    padding: 6px 0;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-links a:hover { color: var(--primary-light); }
.footer-contact p {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.footer-contact i { color: var(--primary-light); }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.35);
}

/* ============================================
   LOADING
   ============================================ */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
.loading-overlay.active { display: flex; }

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    padding: 8px;
    margin-top: 4px;
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
}
.dropdown-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}
.empty-state i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 16px;
}
.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 24px;
}

/* ============================================
   PAYMENT
   ============================================ */
.payment-form {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.payment-summary {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}
.payment-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}
.payment-row.total {
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 1.1rem;
}
.sandbox-banner {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #854d0e;
    margin-bottom: 20px;
}

/* ============================================
   CERTIFICATE
   ============================================ */
.certificate-preview {
    background: var(--bg-white);
    border: 8px double var(--primary);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.certificate-preview h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
}
.certificate-preview .cert-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 32px;
}
.certificate-preview .cert-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 20px 0;
}
.certificate-preview .cert-course {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   QR CODE
   ============================================ */
.qr-container {
    text-align: center;
    padding: 32px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.qr-container img {
    margin: 0 auto 16px;
    max-width: 200px;
}
.qr-container .qr-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 99;
    transition: var(--transition);
}
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }
.back-to-top.visible { display: flex; }

/* ============================================
   RESPONSIVE — See comprehensive rules below utilities
   ============================================ */

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-primary { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: #fff !important; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.1rem; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.no-wrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-cover { object-fit: cover; }
.border { border: 1px solid var(--border); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: rgba(22, 163, 74, 0.15); color: var(--primary-dark); }

/* ============================================
   PUBLIC PAGE COMPONENTS
   ============================================ */

/* Page top offset for fixed navbar */
.page-top { padding-top: 72px; }

/* Page hero banner for inner pages */
.page-hero {
    background: linear-gradient(135deg, #0f2a1a, #15402a, #0f172a);
    padding: 60px 0;
    text-align: center;
}
.page-hero h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 16px;
}
.page-hero .page-hero-sub {
    color: rgba(255,255,255,0.6);
    margin-bottom: 24px;
}
.page-hero--lg { padding: 80px 0; }
.page-hero--lg h1 { font-size: 2.5rem; }
.page-hero .highlight-text { color: var(--primary-light); }

/* CTA section */
.cta-section {
    background: linear-gradient(135deg, #0f2a1a, #15402a);
    padding: 80px 0;
}
.cta-inner {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}
.cta-inner h2 { color: #fff; font-size: 2rem; margin-bottom: 12px; }
.cta-inner p { color: rgba(255,255,255,0.6); margin-bottom: 32px; font-size: 1.05rem; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-outline-white { border-color: rgba(255,255,255,0.3); color: #fff; }

/* How It Works cards */
.step-card {
    text-align: center;
    padding: 24px;
}
.step-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
}

/* Value card icons */
.value-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.6rem;
}

/* Contact info rows */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.contact-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3rem;
}

/* Training detail hero */
.td-banner {
    background: linear-gradient(135deg, #0f2a1a, #15402a);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}
.td-banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
}
.td-banner h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 8px;
}
.td-banner .td-subtitle {
    color: rgba(255,255,255,0.6);
    max-width: 700px;
    margin-bottom: 16px;
}
.td-meta {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}
.td-meta a { color: #fff; }

/* Provider row in training banner */
.td-provider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}
.td-provider-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}
.td-provider-link:hover { opacity: 0.85; }
.td-provider-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.28);
}
.td-provider-logo-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
}
.td-provider-name { font-size: 0.9rem; line-height: 1.3; }
.td-provider-verified { color: var(--primary); margin-left: -2px; }
.td-meta-sep { opacity: 0.35; }
.td-rating { display: flex; align-items: center; gap: 4px; }
.td-rating-count { color: rgba(255,255,255,0.6); font-size: 0.85rem; }

/* Mobile booking bar - hidden on desktop */
.mobile-booking-bar { display: none; }

/* Two-column layout: main + sidebar */
.td-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}
.td-sidebar {
    position: sticky;
    top: 88px;
}

/* Detail cards inside training detail */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.detail-item {
    padding: 14px;
    background: var(--bg-gray);
    border-radius: 8px;
}
.detail-item .label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.detail-item .value {
    font-weight: 600;
}
.detail-item .value i { color: var(--primary); }

/* Objectives grid */
.objectives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

/* Schedule day card */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.day-number {
    width: 48px;
    height: 48px;
    background: var(--primary-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Review summary */
.review-score {
    text-align: center;
    min-width: 120px;
}
.review-score .score-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text);
}

/* Provider card on listing page */
.provider-card-center .card-body { text-align: center; }

/* Price display in sidebar */
.price-display { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.price-big { font-size: 2rem; font-weight: 800; }
.price-old { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }
.price-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Capacity bar */
.capacity-bar { margin-bottom: 16px; }
.capacity-bar .bar-bg {
    height: 8px;
    background: var(--bg-gray);
    border-radius: 4px;
    overflow: hidden;
}
.capacity-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

/* Quick info in sidebar */
.quick-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.85rem;
}
.quick-info i { color: var(--primary); width: 20px; text-align: center; }

/* Share row */
.share-card { text-align: center; }
.share-label { color: var(--text-muted); display: block; margin-bottom: 8px; font-size: 0.85rem; }

/* Filters bar */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.filters-bar .filters-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-select {
    width: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* Brochure download row */
.brochure-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.brochure-row .brochure-icon { font-size: 2rem; color: var(--danger); flex-shrink: 0; }
.brochure-row .btn { margin-left: auto; }

/* Trainer card */
.trainer-card {
    display: flex;
    gap: 16px;
}
.trainer-photo {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}
.trainer-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Review item */
.review-item .review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.review-item .review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.review-item .review-meta { margin-left: auto; }

/* FAQ details */
.faq-item summary {
    padding: 20px 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    cursor: pointer;
}
.faq-item summary i { font-size: 1.2rem; color: var(--primary); flex-shrink: 0; }
.faq-item .faq-answer { padding: 0 24px 20px 52px; color: var(--text-secondary); }

/* About mission grid */
.mission-visual {
    background: var(--primary-bg);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
}
.mission-visual i { font-size: 4rem; color: var(--primary); display: block; margin-bottom: 16px; }
.mission-visual h3 { color: var(--primary-dark); }

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE FIXES
   ============================================ */

/* -- Tablet: <=1024px -- */
@media (max-width: 1024px) {
    /* Dashboard sidebar hidden by default, toggled */
    .sidebar { transform: translateX(-100%); z-index: 1100; }
    .sidebar.open { transform: translateX(0); }
    .dashboard-main { margin-left: 0 !important; }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle { display: block !important; }
    
    /* Grid helpers */
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    
    /* All inline 3+ column grids inside dashboard */
    .dashboard-content div[style*="grid-template-columns:1fr 1fr 1fr"],
    .dashboard-content div[style*="grid-template-columns: 1fr 1fr 1fr"],
    .dashboard-content div[style*="grid-template-columns:repeat(3"] {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* 6-column data grids (provider bookings etc.) */
    .dashboard-content div[style*="grid-template-columns:2fr 2fr 1fr 1fr 1fr 120px"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    /* Hide header row of 6-col grid on tablet */
    .dashboard-content > .card > div[style*="grid-template-columns:2fr 2fr 1fr 1fr 1fr 120px"]:first-child {
        display: none !important;
    }
    
    /* Fixed sidebar grids e.g. 200px 1fr */
    .dashboard-content div[style*="grid-template-columns:200px 1fr"],
    .dashboard-content div[style*="grid-template-columns: 200px 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    .hero-stats { gap: 36px; }
    .td-layout { grid-template-columns: 1fr 320px; gap: 24px; }
}

/* -- Mobile: <=768px -- */
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    .container { padding: 0 16px; }
    .section { padding: 48px 0; }
    
    /* Navigation */
    .nav-links { display: none; }
    .nav-actions .btn { display: none; }
    .nav-actions .dropdown { display: none; }
    .nav-actions .mobile-toggle { display: flex !important; }
    .mobile-toggle { display: flex !important; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--bg-gray); }
    .navbar .container { height: 56px; padding: 0 16px; }
    .navbar-brand { font-size: 1.2rem; gap: 8px; }
    .navbar-brand i { font-size: 1.4rem; }
    
    /* Sidebar overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    .sidebar-overlay.open { display: block; }
    
    /* Show the sidebar toggle */
    .sidebar-toggle { display: block !important; }
    
    /* Dashboard layout */
    .dashboard-content { padding: 16px !important; }
    .dashboard-topbar { padding: 12px 16px; }
    .dashboard-topbar h2 { font-size: 1.1rem; }
    
    /* Flash messages inside dashboard */
    .dashboard-main > div[style*="padding:20px 32px"] { padding: 12px 16px 0 !important; }
    
    /* Hero */
    .hero { padding: 70px 0 40px; }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: 0.95rem; margin-bottom: 24px; }
    .hero-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .hero-stat .number { font-size: 1.3rem; }
    .hero-stat .label { font-size: 0.75rem; }
    .hero-search { margin-bottom: 28px; }
    .hero-search .form-control { padding: 14px 52px 14px 42px; font-size: 0.95rem; }
    .hero-search .btn { padding: 8px 16px; font-size: 0.82rem; }
    
    /* Grid responsive */
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .grid-2 { grid-template-columns: 1fr !important; }
    .grid-auto { grid-template-columns: 1fr !important; }
    
    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    
    /* Search bar */
    .search-bar { flex-direction: column; }
    .search-bar .search-input { min-width: auto; }
    
    /* All inline grid columns → single column */
    div[style*="grid-template-columns:1fr 380px"],
    div[style*="grid-template-columns:1fr 360px"],
    div[style*="grid-template-columns:1fr 340px"],
    div[style*="grid-template-columns: 1fr 380px"],
    div[style*="grid-template-columns: 1fr 360px"],
    div[style*="grid-template-columns: 1fr 340px"] {
        grid-template-columns: 1fr !important;
    }
    /* Sticky sidebar cards: unstick on mobile */
    div[style*="grid-template-columns:1fr 380px"] > div:last-child,
    div[style*="grid-template-columns:1fr 360px"] > div:last-child,
    div[style*="grid-template-columns:1fr 340px"] > div:last-child,
    div[style*="grid-template-columns: 1fr 380px"] > div:last-child,
    div[style*="grid-template-columns: 1fr 360px"] > div:last-child,
    div[style*="grid-template-columns: 1fr 340px"] > div:last-child {
        position: static !important;
    }
    
    /* 2-column inline grids → single column */
    .dashboard-content div[style*="grid-template-columns:1fr 1fr"],
    .dashboard-content div[style*="grid-template-columns: 1fr 1fr"],
    .dashboard-content div[style*="grid-template-columns:2fr 1fr"],
    .dashboard-content div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* 3+ column grids in dashboard */
    .dashboard-content div[style*="grid-template-columns:1fr 1fr 1fr"],
    .dashboard-content div[style*="grid-template-columns: 1fr 1fr 1fr"],
    .dashboard-content div[style*="grid-template-columns:repeat(3"],
    .dashboard-content div[style*="grid-template-columns:1fr 1fr auto"],
    .dashboard-content div[style*="grid-template-columns: 1fr 1fr auto"],
    .dashboard-content div[style*="grid-template-columns:1fr 1fr 1fr 1fr"],
    .dashboard-content div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* 6-column data grids */
    .dashboard-content div[style*="grid-template-columns:2fr 2fr 1fr 1fr 1fr 120px"] {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        padding: 12px 16px !important;
    }
    /* Column header row: hide on mobile */
    .dashboard-content > .card > div[style*="grid-template-columns:2fr 2fr 1fr 1fr 1fr 120px"]:first-child,
    .card > div[style*="font-size:0.78rem"][style*="text-transform:uppercase"] {
        display: none !important;
    }
    
    /* 200px fixed grids */
    .dashboard-content div[style*="grid-template-columns:200px"],
    .dashboard-content div[style*="grid-template-columns: 200px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* 2-column grids inside cards (non-dashboard pages too) */
    .card div[style*="grid-template-columns:1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
    .card div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Two-column payment grid */
    div[style*="grid-template-columns:1fr 1fr"] > .form-group {
        min-width: 0;
    }
    
    /* Stat cards on mobile */
    .stat-card { padding: 16px; gap: 12px; }
    .stat-card .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .stat-card .stat-info h3 { font-size: 1.4rem; }
    .stat-card .stat-number { font-size: 1.3rem; }
    
    /* Booking cards: flex layout adjustments */
    .main-content .card > .card-body > div[style*="display:flex"][style*="gap:20px"] {
        flex-direction: column !important;
        gap: 12px !important;
    }
    /* Thumbnail images in booking/review cards: full width on mobile */
    .main-content .card > .card-body > div[style*="display:flex"] > div[style*="width:120px"],
    .main-content .card > .card-body > div[style*="display:flex"] > div[style*="width:80px"] {
        width: 100% !important;
        height: 160px !important;
    }
    .main-content .card > .card-body > div[style*="display:flex"] > div[style*="width:120px"] img,
    .main-content .card > .card-body > div[style*="display:flex"] > div[style*="width:80px"] img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Booking metadata row: wrap on mobile */
    .main-content div[style*="display:flex"][style*="gap:16px"][style*="font-size:0.85rem"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    /* Booking action buttons: wrap */
    .main-content div[style*="display:flex"][style*="justify-content:space-between"][style*="align-items:center"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    /* Filter forms: stack on mobile */
    form.flex.gap-1:not(.inline-form) {
        flex-direction: column !important;
    }
    form.flex.gap-1 .form-control {
        max-width: 100% !important;
    }
    
    /* Tables responsive */
    .table-responsive, .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 600px; }
    th, td { padding: 10px 12px; font-size: 0.82rem; }
    
    /* Modal: full width on mobile */
    .modal { max-width: 100%; margin: 12px; border-radius: var(--radius-md); }
    .modal-body { padding: 16px; }
    
    /* Flex gap utilities: reduce on small screens */
    .flex.gap-4 { gap: 20px; }
    .flex.gap-3 { gap: 16px; }
    
    /* Buttons: slightly smaller */
    .btn { padding: 8px 18px; font-size: 0.85rem; }
    .btn-sm { padding: 5px 12px; font-size: 0.78rem; }
    .btn-lg { padding: 12px 24px; font-size: 0.95rem; }
    .btn-xl { padding: 12px 28px; font-size: 1rem; }
    
    /* Certificate list: ensure grid wraps */
    .grid.grid-2[style*="gap:20px"] { grid-template-columns: 1fr !important; }
    
    /* QR scan layout */
    div[style*="grid-template-columns:minmax(320px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Inline 2-col layout in payment form */
    div[style*="display:grid"][style*="grid-template-columns:1fr 1fr"][style*="gap:12px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Tab buttons wrap nicely */
    .tabs { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    .tab-btn { padding: 10px 16px; font-size: 0.82rem; white-space: nowrap; }
    
    /* Public page layout */
    .page-top { padding-top: 56px !important; }
    .page-hero { padding: 32px 0; }
    .page-hero h1 { font-size: 1.5rem; }
    .page-hero--lg { padding: 40px 0; }
    .page-hero--lg h1 { font-size: 1.6rem; }
    .page-hero .page-hero-sub { font-size: 0.9rem; margin-bottom: 16px; padding: 0 8px; }

    .cta-section { padding: 40px 0; }
    .cta-inner h2 { font-size: 1.4rem; }
    .cta-inner p { font-size: 0.9rem; margin-bottom: 20px; }
    .cta-buttons { flex-direction: column; align-items: center; gap: 10px; }
    .cta-buttons .btn { width: 100%; max-width: 280px; }

    /* Training detail layout */
    .td-layout { grid-template-columns: 1fr !important; gap: 16px; }
    .td-sidebar { position: static !important; }
    .td-banner { padding: 18px 0 20px; }
    .td-banner > .container {
        padding: 16px;
        border-radius: 20px;
        background: linear-gradient(180deg, rgba(7, 18, 12, 0.18), rgba(7, 18, 12, 0.34));
        backdrop-filter: blur(4px);
    }
    .td-banner h1 { font-size: 1.35rem; line-height: 1.3; margin-bottom: 10px; }
    .td-banner .td-subtitle { font-size: 0.85rem; line-height: 1.5; margin-bottom: 12px; line-clamp: 4; -webkit-line-clamp: 4; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    .td-meta { font-size: 0.8rem; gap: 6px; }
    .td-provider-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.1);
    }
    .td-provider-link { gap: 8px; min-width: 0; flex: 1; }
    .td-provider-logo { width: 24px; height: 24px; }
    .td-provider-logo-placeholder { width: 24px; height: 24px; font-size: 0.8rem; }
    .td-provider-name {
        font-size: 0.86rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .td-meta-sep { display: none; }
    .td-rating {
        margin-top: 0;
        flex-shrink: 0;
        padding-left: 10px;
        border-left: 1px solid rgba(255,255,255,0.14);
    }
    .td-rating-count { display: none; }
    .td-meta .stars { font-size: 0.8rem; }
    .td-badges { gap: 6px; margin-bottom: 10px; }
    .td-banner .badge { font-size: 0.68rem; padding: 4px 8px; border-radius: 999px; }
    .detail-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .detail-item { padding: 10px; }
    .detail-item .label { font-size: 0.7rem; }
    .detail-item .value { font-size: 0.85rem; }
    .objectives-grid { grid-template-columns: 1fr; }
    .price-big { font-size: 1.6rem; }
    .review-score .score-number { font-size: 2rem; }
    .brochure-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .brochure-row .btn { margin-left: 0; width: 100%; }
    .quick-info { font-size: 0.82rem; }
    
    /* Breadcrumb mobile */
    .td-breadcrumb { padding: 8px 0 !important; }
    .td-breadcrumb-nav {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.76rem !important;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .td-breadcrumb-nav::-webkit-scrollbar { display: none; }
    
    /* Trainer card stack on mobile */
    .trainer-card { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
    .trainer-photo, .trainer-photo-placeholder { width: 56px; height: 56px; }
    
    /* FAQ */
    .faq-item summary { padding: 14px 16px; gap: 10px; font-size: 0.88rem; }
    .faq-item .faq-answer { padding: 0 16px 14px 38px; font-size: 0.88rem; }
    
    /* About mission */
    .mission-visual { padding: 28px 16px; }
    .mission-visual i { font-size: 2.5rem; }
    
    /* Contact */
    .contact-item { gap: 12px; }
    .contact-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    
    /* Provider cards */
    .filters-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .filters-bar .filters-group { justify-content: flex-start; }
    .filter-select { flex: 1; min-width: 0; }
    
    /* Mobile menu polish */
    .mobile-menu { top: 56px; padding: 14px; gap: 4px; }
    .mobile-menu > a { padding: 12px 14px; font-size: 0.92rem; border-radius: var(--radius-md); }
    .mobile-menu > a.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
    .mobile-menu > a i { font-size: 1.1rem; width: 22px; }
    .mobile-menu-cta {
        margin-top: 2px;
        border-radius: 16px;
        background: var(--bg-gray);
        padding: 10px;
    }
    .mobile-menu-cta .btn {
        width: 100%;
        min-height: 44px;
        padding: 11px 14px;
        font-size: 0.88rem;
        border-width: 1px;
        box-shadow: none;
    }
    
    /* Card interactive touch feedback */
    .card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
    .training-card:active { transform: scale(0.98); }
    .provider-card:active { transform: scale(0.98); }
    
    /* Flash messages mobile */
    div[style*="position:fixed"][style*="top:80px"] { top: 60px !important; right: 12px !important; left: 12px !important; min-width: 0 !important; max-width: none !important; }
    
    /* Categories bar smooth scroll */
    .categories-bar { gap: 6px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
    .category-chip { scroll-snap-align: start; white-space: nowrap; font-size: 0.82rem; padding: 6px 12px; }
    
    /* Section headers */
    .section-header { margin-bottom: 28px; }
    .section-header p { font-size: 0.9rem; padding: 0 8px; }
    
    /* Card images better aspect */
    .card-img { height: 180px; object-fit: cover; }
    .card-title { font-size: 1rem; }
    .card-meta { font-size: 0.78rem; gap: 6px; }
    .card-meta span { white-space: nowrap; }
    .card-provider { font-size: 0.82rem; }
    .card-footer { padding: 12px 16px; }
    .card-footer .btn { font-size: 0.82rem; }
    
    /* Status tabs row */
    .flex.gap-1.mb-3.flex-wrap { gap: 6px; }
    .flex.gap-1.mb-3.flex-wrap .btn-sm { padding: 5px 10px; font-size: 0.75rem; }
    
    /* Training detail header banner spacing */
    div[style*="padding-top:72px"] { padding-top: 60px !important; }
    
    /* Provider/Admin pages: reduce content padding inside cards */
    .card-body { padding: 16px; }
    
    /* Dropdown positioning fix for mobile */
    .dropdown-menu { min-width: 180px; }
    
    /* Make scroll containers touch-friendly */
    .categories-bar { -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    
    /* Mobile sticky booking bar */
    .mobile-booking-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid var(--border);
        padding: 10px 14px;
        z-index: 900;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
        animation: slideUpBar 0.3s ease forwards;
    }
    @keyframes slideUpBar {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .mobile-booking-bar .price-info {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }
    .mobile-booking-bar .price-info .price-value {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--primary);
    }
    .mobile-booking-bar .price-info .price-label {
        font-size: 0.72rem;
        color: var(--text-muted);
    }
    .mobile-booking-bar .btn {
        flex: 1;
        max-width: 180px;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.84rem;
    }
    
    /* Tabs scrollable on mobile */
    .tabs { 
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        scroll-snap-type: x mandatory;
        border-bottom: 2px solid var(--border);
    }
    .tab-btn { 
        scroll-snap-align: start;
        white-space: nowrap;
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.82rem;
    }
    
    /* Badge animation */
    .badge { transition: transform 0.15s ease; }
    .badge:active { transform: scale(0.95); }
    
    /* Interactive hover/touch states */
    .faq-item summary { transition: background 0.15s ease; }
    .faq-item summary:active { background: var(--bg-gray); }
    .step-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
    .step-card:active { transform: translateY(-2px); box-shadow: var(--shadow-md); }
    
    /* Add bottom padding when sticky bar is present */
    .page-top ~ .mobile-booking-bar ~ footer,
    body:has(.mobile-booking-bar) .page-top { padding-bottom: 72px; }
}

/* -- Small phones: <=480px -- */
@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    .hero { padding: 72px 0 40px; }
    .hero h1 { font-size: 1.6rem; }
    .hero-search .form-control { padding: 12px 48px 12px 40px; font-size: 0.9rem; }
    .hero-search .btn { padding: 8px 16px; font-size: 0.82rem; }
    .hero-stats { flex-direction: column; gap: 12px; }
    .section-header h2 { font-size: 1.2rem; }
    
    /* Collapse grids to single column */
    .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
    
    .card-img { height: 160px; }
    .stat-card { flex-direction: column; text-align: center; }
    .stat-card .stat-icon { margin: 0 auto; }
    .stat-card .stat-number { font-size: 1.2rem; }
    
    .dashboard-content { padding: 12px !important; }
    .dashboard-topbar { padding: 10px 12px; }
    
    /* Certificate view: make canvas scrollable */
    .card div[style*="display:flex"][style*="justify-content:center"][style*="background:#f1f5f9"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        padding: 12px !important;
    }
    
    /* Very small buttons */
    .btn { padding: 7px 14px; font-size: 0.82rem; }
    .btn-sm { padding: 4px 10px; font-size: 0.75rem; }
    
    /* Provider bookings 6-col data rows */
    .dashboard-content div[style*="grid-template-columns:2fr 2fr 1fr 1fr 1fr 120px"] {
        padding: 10px 12px !important;
        border-bottom: 2px solid var(--border) !important;
    }
    
    /* Pagination smaller */
    .page-link { width: 34px; height: 34px; font-size: 0.82rem; }
    .pagination { gap: 4px; }
    
    /* Public page small phone */
    .page-hero h1 { font-size: 1.35rem; }
    .page-hero--lg h1 { font-size: 1.5rem; }
    .td-banner h1 { font-size: 1.3rem; }
    .td-banner > .container { padding: 14px; border-radius: 16px; }
    .td-provider-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .td-provider-link { width: 100%; }
    .td-rating {
        width: 100%;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.14);
        padding-top: 8px;
    }
    .detail-grid { grid-template-columns: 1fr; }
    .mobile-booking-bar {
        padding: 10px 12px;
        gap: 8px;
    }
    .mobile-booking-bar .price-info .price-value { font-size: 1rem; }
    .mobile-booking-bar .btn {
        max-width: 150px;
        font-size: 0.8rem;
        padding: 10px 12px;
    }
    .step-icon { width: 56px; height: 56px; font-size: 1.4rem; }
    .step-card { padding: 16px; }
    .step-card h4 { font-size: 0.95rem; }
    .value-icon { width: 52px; height: 52px; font-size: 1.3rem; }
    .cta-inner h2 { font-size: 1.3rem; }
    .trainer-card { gap: 10px; }
    
    /* Empty state: smaller */
    .empty-state { padding: 40px 16px; }
    .empty-state i { font-size: 3rem; }
    
    /* Banner cards: stack */
    .card[style*="background:linear-gradient"] .card-body {
        flex-direction: column !important;
        text-align: center;
    }
    .card[style*="background:linear-gradient"] .card-body .btn {
        align-self: center;
    }
}

/* ============================================
   CERTIFICATE PRINT - FIT ON 1 PAGE
   ============================================ */
@media print {
    /* Hide everything except the certificate */
    .sidebar, .navbar, .dashboard-topbar, .back-to-top, .no-print,
    .sidebar-overlay, .mobile-menu, .mobile-toggle { display: none !important; }
    .dashboard-main { margin-left: 0 !important; }
    .dashboard-layout { display: block !important; }
    body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    
    /* Certificate canvas: scale to fit page */
    #certificatePrint {
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    #certificatePrint > div[style*="display:flex"][style*="justify-content:center"] {
        background: none !important;
        padding: 0 !important;
    }
    #certCanvas {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: attr(data-ratio);
        box-shadow: none !important;
    }
    /* Hide certificate details below canvas when printing */
    #certificatePrint > .card-body { display: none !important; }
}
