/* ==========================================================================
   Design Tokens & Dark Luxury Gold Theme
   ========================================================================== */
:root {
    --bg-dark: #090A0F;
    --bg-surface: #0E1017;
    --bg-card: #131520;
    --bg-card-hover: #1A1D2C;
    --bg-glass: rgba(19, 21, 32, 0.75);

    --primary-gold: #D4AF37;
    --primary-gold-dark: #AA8C2C;
    --accent-gold: #F3E5AB;
    --gold-glow: rgba(212, 175, 55, 0.15);

    --text-primary: #F5F6F8;
    --text-secondary: #A0A5B5;
    --text-muted: #626777;

    --border-gold: rgba(212, 175, 55, 0.18);
    --border-gold-hover: rgba(212, 175, 55, 0.45);
    --border-subtle: rgba(255, 255, 255, 0.05);

    --emerald-win: #2ECC71;
    --emerald-win-bg: rgba(46, 204, 113, 0.12);
    --ruby-loss: #E74C3C;
    --ruby-loss-bg: rgba(231, 76, 60, 0.12);
    --badge-blue: #3498DB;
    --badge-blue-bg: rgba(52, 152, 219, 0.12);

    --font-display: 'Playfair Display', serif;
    --font-sans: 'Outfit', 'Sarabun', sans-serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.15);
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.65;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.01) 0%, transparent 60%);
    background-attachment: fixed;
}

/* Loader */
.luxury-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}
.loader-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 4px;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}
.loader-sub {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 2px;
    overflow: hidden;
}
.loader-progress {
    width: 50%;
    height: 100%;
    background: var(--primary-gold);
    animation: loader-anim 1.4s infinite ease-in-out;
}
@keyframes loader-anim {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem 1.5rem;
}

/* Header & Nav */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2.5rem;
}
.brand-group {
    display: flex;
    flex-direction: column;
}
.brand-title {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-gold);
    letter-spacing: 2px;
    text-decoration: none;
}
.brand-sub {
    font-size: 0.78rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.placeholder-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-gold);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
    user-select: none;
    cursor: not-allowed;
}
.placeholder-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-gold);
    opacity: 0.6;
}

/* Hero Section */
.hero-banner {
    background: linear-gradient(135deg, rgba(19, 21, 32, 0.9) 0%, rgba(26, 29, 44, 0.7) 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-tag {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    background: var(--gold-glow);
    border: 1px solid var(--primary-gold);
    border-radius: var(--radius-full);
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.hero-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 0.75rem;
}
.hero-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 800px;
    line-height: 1.7;
}

/* Tab Navigation */
.tabs-nav {
    display: flex;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    background: var(--bg-card);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.12);
}
.tab-badge {
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: var(--emerald-win-bg); color: var(--emerald-win); }
.badge-gold { background: var(--gold-glow); color: var(--primary-gold); }
.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue); }

/* Grid & Cards */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.luxury-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    position: relative;
}
.luxury-card:hover {
    border-color: var(--border-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
}
.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--accent-gold);
}
.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Quote Banner */
.quote-box {
    background: rgba(212, 175, 55, 0.05);
    border-left: 3px solid var(--primary-gold);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--accent-gold);
    line-height: 1.7;
}

/* Trade Result Badge */
.trade-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
}
.trade-win {
    background: var(--emerald-win-bg);
    color: var(--emerald-win);
    border: 1px solid rgba(46, 204, 113, 0.3);
}
.trade-loss {
    background: rgba(231, 76, 60, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

/* Image Thumbnails Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: #000;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}
.gallery-item:hover {
    border-color: var(--primary-gold);
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}
.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(9, 10, 15, 0.85);
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lightbox Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}
.modal-content-box {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-full-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-gold);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
}
.modal-header-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-gold);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}
.modal-close-btn:hover {
    background: var(--ruby-loss);
    border-color: var(--ruby-loss);
}

/* Summary Metric Box */
.metrics-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.metric-card {
    flex: 1;
    min-width: 200px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
}
.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}
.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-display);
}
.metric-value.win { color: var(--emerald-win); }
.metric-value.gold { color: var(--primary-gold); }

/* Table Style */
.luxury-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.luxury-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--primary-gold);
    border-bottom: 1px solid var(--border-gold);
    font-weight: 600;
}
.luxury-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}
.luxury-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .header-nav { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .hero-title { font-size: 1.7rem; }
    .hero-banner { padding: 1.5rem; }
    .metrics-row { flex-direction: column; }
}
