/* ==========================================================================
   Gold Assets Homepage — shadcn/ui Design System
   ========================================================================== */

/* --- Theme Variables --- */
:root {
    --background: hsl(0 0% 100%);
    --foreground: hsl(220 8% 20%);
    --card: hsl(0 0% 100%);
    --card-foreground: hsl(220 8% 20%);
    --muted: hsl(240 4.8% 95.9%);
    --muted-foreground: hsl(240 3.8% 46.1%);
    --border: hsl(240 5.9% 90%);
    --radius: 0.5rem;

    --gold: hsl(43 74% 49%);
    --gold-muted: hsl(43 40% 92%);
    --up-color: hsl(0 72% 51%);
    --up-bg: hsl(0 72% 96%);
    --down-color: hsl(221 83% 53%);
    --down-bg: hsl(221 83% 96%);

    --header-bg: hsl(220 20% 16%);
    --header-fg: hsl(0 0% 95%);
    --strip-bg: hsl(0 0% 97%);
    --strip-border: hsl(240 5.9% 90%);
}

[data-theme="dark"] {
    --background: hsl(222 15% 6%);
    --foreground: hsl(0 0% 93%);
    --card: hsl(222 15% 10%);
    --card-foreground: hsl(0 0% 93%);
    --muted: hsl(220 12% 16%);
    --muted-foreground: hsl(218 10% 55%);
    --border: hsl(220 13% 23%);

    --gold-muted: hsl(43 30% 18%);
    --up-color: hsl(0 72% 60%);
    --up-bg: hsl(0 50% 16%);
    --down-color: hsl(221 70% 58%);
    --down-bg: hsl(221 50% 16%);

    --header-bg: hsl(222 15% 8%);
    --header-fg: hsl(0 0% 80%);
    --strip-bg: hsl(222 15% 8%);
    --strip-border: hsl(220 13% 23%);

    -webkit-font-smoothing: auto;
    -webkit-text-stroke: 0.2px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--foreground);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-logo { height: 36px; width: auto; }

.header-nav {
    display: flex;
    gap: 24px;
}

.header-nav a {
    color: var(--header-fg);
    font-size: 13px;
    font-weight: 500;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.header-nav a:hover { opacity: 1; }

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Selector */
.lang-selector {
    display: flex;
    gap: 2px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--header-fg);
    font-size: 11px;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.lang-btn:hover { opacity: 0.8; }
.lang-btn.active {
    opacity: 1;
    color: var(--gold);
    font-weight: 700;
}

/* Theme & Mobile Toggle */
.btn-icon {
    background: none;
    border: none;
    color: var(--header-fg);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.btn-icon:hover { opacity: 1; }
.btn-icon svg { width: 18px; height: 18px; }

.mobile-only { display: none; }

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px 16px 16px;
    z-index: 99;
}

.mobile-menu.active { display: block; }

.mobile-menu a {
    display: block;
    padding: 10px 0;
    color: var(--header-fg);
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-menu a:last-child { border-bottom: none; }

/* --- Hero --- */
.hero {
    position: relative;
    background: var(--header-bg);
    padding: 80px 0 72px;
    text-align: center;
    overflow: hidden;
}

/* Dot grid pattern */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, hsla(43 74% 49% / 0.18) 1.2px, transparent 1.2px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Gold accent glow at bottom */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, hsla(43 74% 49% / 0.7) 50%, transparent 100%);
    box-shadow: 0 0 20px 4px hsla(43 74% 49% / 0.15);
}

/* Radial gold glow behind title */
.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse, hsla(43 74% 49% / 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    color: hsl(0 0% 95%);
    line-height: 1.4;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-desc {
    font-size: 15px;
    color: hsl(0 0% 65%);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: inline-block;
    padding: 12px 32px;
    background: var(--gold);
    color: hsl(0 0% 10%);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    transition: opacity 0.15s, transform 0.15s;
}

.hero-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

[data-theme="dark"] .hero {
    background: hsl(222 18% 12%);
}

[data-theme="dark"] .hero::before {
    background-image: radial-gradient(circle, hsla(43 74% 49% / 0.12) 1.2px, transparent 1.2px);
}

[data-theme="dark"] .hero-glow {
    background: radial-gradient(ellipse, hsla(43 74% 49% / 0.06) 0%, transparent 70%);
}

/* --- Price Strip --- */
.price-strip {
    background: var(--strip-bg);
    border-bottom: 1px solid var(--strip-border);
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.price-strip .container {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    white-space: nowrap;
}

.strip-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.strip-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
}

.strip-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
}

.strip-change {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.strip-change.up { color: var(--up-color); }
.strip-change.down { color: var(--down-color); }

.strip-sep {
    color: var(--border);
    font-size: 12px;
    user-select: none;
}

.strip-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted-foreground);
    transition: background 0.3s;
}

.status-dot.connected { background: hsl(142 70% 45%); }
.status-dot.reconnecting { background: hsl(38 92% 50%); }
.status-dot.error { background: hsl(0 72% 51%); }

@keyframes breathe {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.status-dot.breathing {
    animation: breathe 1s cubic-bezier(0.45,0.05,0.55,0.95);
}

.status-text {
    font-size: 11px;
    color: var(--muted-foreground);
}

/* --- Section Layout --- */
.section {
    padding: 24px 0;
}

.section-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin-bottom: 12px;
}

/* --- Card Base --- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--foreground);
}

.card-meta {
    font-size: 12px;
    color: var(--muted-foreground);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.card-meta .chart-time {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
}

/* --- Wholesale + Actions Row --- */
.section-row {
    display: flex;
    gap: 16px;
}

.wholesale-card {
    flex: 1;
    min-width: 0;
}

.wholesale-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.wholesale-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-align: right;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--muted);
}

.wholesale-table th:first-child {
    text-align: left;
    width: 100px;
}

.wholesale-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
    text-align: right;
    color: var(--foreground);
}

.wholesale-table td:first-child {
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-foreground);
}

.wholesale-table tbody:last-child tr:last-child td {
    border-bottom: none;
}

/* Quick Actions */
.quick-actions {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.15s;
    text-align: center;
}

.action-btn:hover { opacity: 0.85; }

.action-buy {
    background: var(--up-color);
    color: white;
}

.action-sell {
    background: var(--down-color);
    color: white;
}

.action-contact {
    background: var(--muted);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.action-app {
    background: var(--gold);
    color: hsl(0 0% 10%);
}

/* --- Price Cards --- */
.price-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.price-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: box-shadow 0.15s;
}

.price-card-header {
    margin-bottom: 8px;
}

.asset-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.price-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.price-sub {
    font-size: 13px;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

.price-change {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 2px 8px;
    border-radius: 4px;
}

.price-change.up {
    color: var(--up-color);
    background: var(--up-bg);
}

.price-change.down {
    color: var(--down-color);
    background: var(--down-bg);
}

/* Flash Animations */
@keyframes flash-up {
    0% { background-color: var(--up-bg); }
    100% { background-color: transparent; }
}

@keyframes flash-down {
    0% { background-color: var(--down-bg); }
    100% { background-color: transparent; }
}

.flash-up { animation: flash-up 1.2s ease-out; }
.flash-down { animation: flash-down 1.2s ease-out; }

/* --- Charts --- */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.chart-card { padding: 16px 20px; }

.chart-wrapper {
    height: 220px;
    width: 100%;
}

.chart-price {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.chart-change-indicator {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.chart-change-indicator.up { color: var(--up-color); }
.chart-change-indicator.down { color: var(--down-color); }

/* --- Company Info --- */
.company-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
    align-items: start;
}

.company-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted-foreground);
    margin-bottom: 20px;
}

.company-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.company-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--foreground);
    font-weight: 500;
}

.feat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
}

.app-promo {
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.app-promo p {
    font-size: 13px;
    color: var(--muted-foreground);
    margin: 12px 0 16px;
    line-height: 1.6;
}

.btn-app {
    display: inline-block;
    padding: 10px 20px;
    background: var(--gold);
    color: hsl(0 0% 10%);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    transition: opacity 0.15s;
}

.btn-app:hover { opacity: 0.85; }

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0 16px;
    margin-top: 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 24px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 12px;
}

.footer-col p,
.footer-col a {
    font-size: 12px;
    color: var(--muted-foreground);
    display: block;
    margin-bottom: 6px;
    line-height: 1.5;
}

.footer-col a:hover { color: var(--foreground); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted-foreground);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a:hover { color: var(--foreground); }

/* --- Scroll Animations --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children inside a parent */
.scroll-reveal-group .scroll-reveal:nth-child(1) { transition-delay: 0s; }
.scroll-reveal-group .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal-group .scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal-group .scroll-reveal:nth-child(4) { transition-delay: 0.25s; }

/* Disable for reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .section-row {
        flex-direction: column;
    }

    .quick-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .quick-actions .action-btn {
        flex: 1;
        min-width: 140px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .company-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-nav { display: none; }
    .mobile-only { display: flex; }

    .hero { padding: 48px 0 40px; }
    .hero-title { font-size: 26px; }
    .hero-desc { font-size: 14px; }

    .price-cards {
        grid-template-columns: 1fr;
    }

    .price-value { font-size: 24px; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .price-value { font-size: 20px; }
    .wholesale-table td { font-size: 14px; padding: 8px; }
    .wholesale-table th { padding: 6px 8px; }
}
