:root {
    --bg-main: #060608;
    --bg-card: #121216;
    --bg-navbar: rgba(8, 8, 12, 0.94);
    --primary: #d4af37;
    --primary-glow: rgba(212, 175, 55, 0.45);
    --text-main: #f4f4f5;
    --text-muted: #9b9ba8;
    --accent: #2ea043;
    --danger: #e5534b;
    --gold-gradient: linear-gradient(135deg, #c9a227 0%, #f5e6a8 48%, #c9a227 100%);
    --dark-gradient: linear-gradient(180deg, #1a1a22 0%, #060608 100%);
    --border-glass: rgba(212, 175, 55, 0.18);
    --border-light: rgba(255, 255, 255, 0.09);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --shadow-gold: 0 6px 28px rgba(212, 175, 55, 0.18);
    --shadow-dark: 0 16px 48px rgba(0, 0, 0, 0.55);
    --vela-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 42%);
    /* ถ้าไม่มีธีมจาก PHP ค่าเหล่านี้ใช้เป็นค่าเริ่มต้น */
    --theme-primary-rgb: 212, 175, 55;
    --theme-background-rgb: 10, 10, 10;
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(ellipse 90% 50% at 50% -15%, rgba(var(--theme-primary-rgb), 0.09), transparent 58%),
        linear-gradient(180deg, rgba(var(--theme-background-rgb), 0.9), rgba(var(--theme-background-rgb), 0.98)),
        var(--theme-image-background-url),
        var(--theme-image-pattern-url);
    background-size: auto, auto, cover, 380px auto;
    background-position: center top, center top, center top, center top;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
    background-attachment: scroll, scroll, fixed, fixed;
    color: var(--text-main);
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
    line-height: 1.62;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-dark);
}

/* Navbar */
.main-nav {
    height: 80px;
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 5%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-logo img {
    max-height: 45px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.2));
}

.nav-links {
    display: flex;
    gap: 35px;
    margin-left: 60px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-auth {
    margin-left: auto;
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn-gold {
    background: var(--gold-gradient);
    color: #111;
    border: none;
    padding: 10px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-gold:hover {
    box-shadow: 0 0 25px var(--primary-glow);
    transform: translateY(-2px);
    color: #000;
}

.btn-outline-gold {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 9px 27px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-outline-gold:hover {
    background: var(--primary);
    color: #111;
    box-shadow: var(--shadow-gold);
}

/* Hero Section */
.hero-section {
    padding-top: 110px;
    padding-bottom: 50px;
    background:
        linear-gradient(180deg, rgba(var(--theme-background-rgb), 0.2), rgba(var(--theme-background-rgb), 0.72)),
        radial-gradient(ellipse 85% 55% at 50% 0%, rgba(var(--theme-primary-rgb), 0.14) 0%, transparent 58%),
        var(--theme-image-hero-url);
    background-size: auto, auto, cover;
    background-position: center top, center top, center top;
    background-repeat: no-repeat, no-repeat, no-repeat;
    min-height: calc(100vh - 300px);
}

.hero-banner {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    position: relative;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Announcement Bar */
.announcement-bar {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-glass);
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-dark);
}

/* Layout Layout (Like hi99) */
.side-categories {
    background: rgba(20, 20, 20, 0.8);
    border-radius: var(--radius-md);
    padding: 10px;
    border: 1px solid var(--border-light);
}

.side-cat-item {
    background: transparent;
    border: 1px solid transparent;
}

.side-cat-item.active {
    background: linear-gradient(180deg, rgba(212,175,55,0.1) 0%, rgba(212,175,55,0.02) 100%);
    border: 1px solid var(--border-glass);
}

.side-cat-item:hover {
    background: rgba(255,255,255,0.05);
}

.grayscale-icon {
    filter: grayscale(1) opacity(0.7);
    transition: all 0.3s;
}

.side-cat-item:hover .grayscale-icon, 
.side-cat-item.active .grayscale-icon {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}

.min-w-80 {
    min-width: 80px;
}

.mobile-cat-item {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.mobile-cat-item.active {
    background: rgba(212,175,55,0.1);
    border-color: var(--primary);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Provider Cards */
.provider-card {
    cursor: pointer;
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
    border: 1px solid var(--border-light);
    aspect-ratio: 1/1;
    border-radius: var(--radius-md);
}

.provider-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--theme-primary-rgb, 212, 175, 55), 0.55);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 0 0 32px rgba(var(--theme-primary-rgb), 0.12) !important;
}

.provider-card img {
    transition: transform 0.5s ease;
}

.provider-card:hover img {
    transform: scale(1.1);
}

.provider-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.provider-card:hover .provider-overlay {
    opacity: 1;
}

.public-provider-card {
    background:
        radial-gradient(circle at top, rgba(var(--theme-secondary-rgb), 0.18), transparent 52%),
        linear-gradient(180deg, rgba(var(--theme-surface-rgb), 0.98), rgba(var(--theme-background-rgb), 0.96));
}

.public-provider-card img {
    object-fit: contain;
    padding: 18px 16px 60px;
}

.provider-card-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 30px 14px 14px;
    background: linear-gradient(180deg, rgba(var(--theme-background-rgb), 0) 0%, rgba(var(--theme-background-rgb), 0.88) 38%, rgba(var(--theme-background-rgb), 0.98) 100%);
}

.provider-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), 0.12);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.22);
}

.provider-card-name {
    display: block;
    margin-top: 8px;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Text Colors */
.text-gold { color: var(--primary) !important; }
.bg-gold { background-color: var(--primary) !important; }

/* Forms & Inputs */
.form-control.glass, .form-select.glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 12px 15px;
}

.form-control.glass:focus, .form-select.glass:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    color: var(--text-main);
}

.input-group.glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.input-group.glass:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Modals */
.modal-content.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .nav-links { display: none; }
    .main-nav { padding: 0 20px; }
    .hero-section { padding-top: 100px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    body { padding-bottom: 70px; } /* Space for bottom nav */
}

/* Bottom Navigation */
.bottom-nav {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.8);
}

.bottom-nav-item {
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.bottom-nav-item.active, .bottom-nav-item:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.bottom-nav-center .center-btn {
    width: 65px;
    height: 65px;
    background: var(--dark-gradient);
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px rgba(212,175,55,0.4) !important;
    transition: all 0.3s ease;
}

.bottom-nav-center .center-btn:hover {
    transform: translate(-50%, -5px) scale(1.1) !important;
    box-shadow: 0 0 30px rgba(212,175,55,0.6) !important;
}

@media (max-width: 575px) {
    .main-nav {
        height: auto;
        min-height: 64px;
        padding: 10px 12px;
        flex-wrap: wrap;
    }
    .nav-auth {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }
    .btn-gold,
    .btn-outline-gold {
        padding: 9px 16px;
        font-size: 0.9rem;
    }
    .hero-section {
        padding-top: 88px;
        padding-bottom: 32px;
    }
}

@media (max-width: 991px) {
    body {
        background-attachment: scroll, scroll, scroll !important;
    }
}
