/* ==========================================================================
   THE COMMODITY JOURNAL - FINAL REVISION (EDITORIAL UI/UX)
   ========================================================================== */
:root {
    --bg-body: #F3F4F6;        
    --bg-panel: #FFFFFF;       
    --bg-hover: #F9FAFB;       
    
    --border-gray: #E5E7EB;    
    --hairline: rgba(15, 23, 42, 0.06); 
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.08); 
    
    --ink-black: #0F172A;      
    --ink-light: #64748B;      
    
    --sage-green: #386641;     
    --terra-red: #BC4749;      

    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    
    --radius-standard: 8px;    
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--ink-black);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ==========================================================================
   MASTHEAD (STICKY GLASSMORPHISM)
   ========================================================================== */
.journal-masthead {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--ink-black);
    padding: 30px 0 20px 0;
    margin-bottom: 30px;
}

.masthead-inner { display: flex; justify-content: space-between; align-items: flex-end; }
.brand-title { font-family: var(--font-serif); font-size: 34px; font-weight: 800; line-height: 1; margin: 0; }
.brand-subtitle { font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--ink-light); }

.clock-area { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; }
.market-open { background-color: var(--sage-green); }
.market-closed { background-color: var(--terra-red); }

/* ==========================================================================
   LAYOUT & PANELS
   ========================================================================== */
.journal-layout { display: grid; grid-template-columns: 360px 1fr; gap: 32px; padding-bottom: 64px; }
.panel-card { background-color: var(--bg-panel); border: 1px solid var(--hairline); border-radius: 4px; box-shadow: var(--shadow-soft); }
.journal-sidebar { align-self: start; height: max-content; }
.journal-main { display: flex; flex-direction: column; gap: 32px; }

.section-header { padding: 16px 24px; border-bottom: 1px solid var(--hairline); }
.section-header h2 { font-family: var(--font-serif); font-size: 18px; font-weight: 700; }

/* ==========================================================================
   MARKET LIST & SPARKLINE
   ========================================================================== */
.market-list { display: flex; flex-direction: column; }
.market-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px; border-bottom: 1px solid var(--hairline);
    cursor: pointer; transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
    height: 72px; /* Fixed height to stabilize list rendering */
}
.market-item:last-child { border-bottom: none; }
.market-item:hover { background-color: var(--bg-hover); }
.market-item.active { border-left-color: var(--ink-black); background-color: var(--bg-hover); }

.item-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.item-info { display: flex; flex-direction: column; }
.item-name { font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
.item-ticker { font-size: 11px; font-weight: 600; color: var(--ink-light); letter-spacing: 0.05em; }

.sparkline-container { width: 70px; height: 32px; margin: 0 10px; }

.item-right { display: flex; flex-direction: column; align-items: flex-end; min-width: 90px; }
.item-price { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--ink-black); }
.item-change { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }

.color-up { color: var(--sage-green); }
.color-down { color: var(--terra-red); }

/* ==========================================================================
   CHART SECTION & FILTERS
   ========================================================================== */
.chart-header { display: flex; justify-content: space-between; align-items: flex-end; padding: 24px; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; gap: 20px; }
.chart-header h2 { font-family: var(--font-serif); font-size: 26px; font-weight: 800; line-height: 1; margin: 0; }

.timeframe-tabs { display: flex; gap: 20px; }
.tab-btn { background: transparent; border: none; padding: 0 0 4px 0; font-size: 12px; font-weight: 700; color: var(--ink-light); cursor: pointer; position: relative; }
.tab-btn.active { color: var(--ink-black); }
.tab-btn.active::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background-color: var(--ink-black); }

.chart-container { padding: 24px; height: 420px; width: 100%; position: relative; }

/* Elegant Error Overlay */
.chart-error-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.95); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; text-align: center; }
.overlay-box { border: 1px solid var(--ink-black); padding: 30px; background: #fff; }

/* ==========================================================================
   PERFORMANCE GRID
   ========================================================================== */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; padding: 24px; }
.perf-block { background-color: #FFFFFF; border: 1px solid var(--border-gray); border-radius: var(--radius-standard); padding: 16px; display: flex; flex-direction: column; gap: 8px; transition: transform 0.2s; }
.perf-block:hover { transform: translateY(-2px); }

.perf-label { font-size: 11px; font-weight: 700; color: var(--ink-light); text-transform: uppercase; letter-spacing: 0.1em; }
.perf-val { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--ink-black); }
.perf-pct { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }

/* SKELETON LOADING */
.skeleton { background: #E5E7EB; background: linear-gradient(110deg, #E5E7EB 8%, #F3F4F6 18%, #E5E7EB 33%); background-size: 200% 100%; animation: 1.5s shimmer linear infinite; color: transparent !important; }
@keyframes shimmer { to { background-position-x: -200%; } }

@media (max-width: 1024px) { .journal-layout { grid-template-columns: 1fr; } .brand-title { font-size: 30px; } }
@media (max-width: 640px) { .masthead-inner { flex-direction: column; align-items: flex-start; gap: 16px; } .chart-header { flex-direction: column; align-items: flex-start; gap: 20px; } .perf-grid { grid-template-columns: repeat(2, 1fr); } }
.journal-footer {
    border-top: 2px solid var(--ink-black);
    padding: 48px 0;
    margin-top: 64px;
    background-color: #fff;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.disclaimer {
    font-size: 12px;
    color: var(--ink-light);
    max-width: 800px;
    line-height: 1.6;
    font-family: var(--font-sans);
}

.copyright {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-black);
}

@media (max-width: 640px) {
    .disclaimer { font-size: 11px; padding: 0 16px; }
}
/* --- NEWS TICKER STYLES --- */
.news-ticker-container {
    display: flex;
    align-items: center;
    background-color: var(--ink-black, #0f172a);
    color: #ffffff;
    height: 40px;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 13px;
    overflow: hidden;
    border-bottom: 2px solid #e2e8f0;
}

.ticker-label {
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0 16px;
    color: #eab308; /* Altın Sarısı */
    z-index: 2;
    background-color: var(--ink-black, #0f172a);
}

.ticker-content {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    /* 30 saniyede bir tur atar, infinite ile sonsuz döner */
    animation: scrollTicker 35s linear infinite;
}

/* Mouse üzerine gelince kaymayı durdurur */
.ticker-content:hover .ticker-track {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    margin-right: 48px;
    font-weight: 500;
}

/* Başlıkların arasına altın sarısı bir nokta koyar */
.ticker-item::before {
    content: "•";
    color: #eab308;
    margin-right: 12px;
}

@keyframes scrollTicker {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}
