/* ══════════════════════════════════════
   AltınPort — Design System
   ══════════════════════════════════════ */
:root {
  --bg: #F7F5F0;
  --bg2: #EFECE5;
  --surface: #FFFFFF;
  --surface2: #FAFAF7;
  --border: #E2DDD4;
  --border2: #D4CFC5;
  --text: #2C2A25;
  --text2: #6B665C;
  --text3: #9C9789;
  --gold: #B8942E;
  --gold-dark: #8C6F1E;
  --gold-light: #F9F5EB;
  --gold-muted: #D4C48A;
  --green: #2D8B4E;
  --green-bg: #E8F5EC;
  --red: #C23B3B;
  --red-bg: #FDEAEA;
  --shadow: 0 1px 3px rgba(44,42,37,.06);
  --shadow2: 0 4px 16px rgba(44,42,37,.08);
  --radius: 6px;
  --transition: .2s ease;
}
[data-theme="dark"] {
  --bg: #1A1917;
  --bg2: #242320;
  --surface: #2C2B27;
  --surface2: #343330;
  --border: #3D3C37;
  --border2: #4A4943;
  --text: #E8E5DD;
  --text2: #A09B8E;
  --text3: #7A756A;
  --gold: #D4AD3C;
  --gold-dark: #E8C44A;
  --gold-light: #33301F;
  --gold-muted: #7A6C3A;
  --green: #4ABA6A;
  --green-bg: #1E2E22;
  --red: #E05555;
  --red-bg: #2E1E1E;
  --shadow: 0 1px 3px rgba(0,0,0,.2);
  --shadow2: 0 4px 16px rgba(0,0,0,.25);
}

/* Reset */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body { font-family:'Inter',system-ui,-apple-system,sans-serif; background:var(--bg); color:var(--text); font-size:14px; line-height:1.6; -webkit-font-smoothing:antialiased; }

/* ── Header ── */
.header { background:var(--surface); border-bottom:1px solid var(--border); height:54px; display:flex; align-items:center; justify-content:space-between; padding:0 clamp(16px,3vw,32px); position:sticky; top:0; z-index:100; }
.logo { font-size:1.2rem; font-weight:700; color:var(--text); text-decoration:none; letter-spacing:-.02em; }
.logo b { color:var(--gold); font-weight:800; }
.header-right { display:flex; align-items:center; gap:12px; }
.live-indicator { display:flex; align-items:center; gap:5px; font-size:.65rem; font-weight:600; color:var(--green); letter-spacing:.5px; text-transform:uppercase; }
.live-indicator::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--green); animation:blink 2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.theme-btn { background:none; border:1px solid var(--border); border-radius:var(--radius); width:32px; height:32px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text2); transition:var(--transition); font-size:1rem; }
.theme-btn:hover { background:var(--bg2); border-color:var(--border2); }

/* ── Ticker ── */
.ticker { background:var(--surface); border-bottom:1px solid var(--border); height:36px; overflow:hidden; position:relative; }
.ticker-track { display:flex; animation:marquee 45s linear infinite; white-space:nowrap; height:100%; align-items:center; }
.ticker:hover .ticker-track { animation-play-state:paused; }
@keyframes marquee { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.ticker-item { display:inline-flex; align-items:center; gap:6px; padding:0 20px; font-size:.7rem; border-right:1px solid var(--border); height:100%; }
.ticker-label { color:var(--text3); }
.ticker-val { font-weight:600; font-variant-numeric:tabular-nums; }

/* ── Layout ── */
.container { max-width:1180px; margin:0 auto; padding:20px clamp(16px,3vw,32px) 48px; }

.section-label { font-size:.6rem; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:var(--text3); margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid var(--border); }

/* ── Error ── */
.error-banner { background:var(--red-bg); color:var(--red); border:1px solid var(--red); border-radius:var(--radius); padding:10px 14px; font-size:.8rem; margin-bottom:16px; display:none; }
.error-banner.visible { display:flex; align-items:center; gap:8px; }

/* ── Gold Grid ── */
.gold-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:8px; margin-bottom:24px; }
.gold-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px; transition:var(--transition); position:relative; }
.gold-card:hover { box-shadow:var(--shadow2); border-color:var(--border2); }
.gold-card.primary { background:var(--gold-light); border-color:var(--gold-muted); }
.gold-card .label { font-size:.6rem; font-weight:600; letter-spacing:.5px; text-transform:uppercase; color:var(--text3); margin-bottom:3px; }
.gold-card.primary .label { color:var(--gold-dark); }
.gold-card .price { font-size:1.2rem; font-weight:700; font-variant-numeric:tabular-nums; }
.gold-card.primary .price { color:var(--gold-dark); }
.gold-card .unit { font-size:.55rem; color:var(--text3); margin-top:1px; }
.gold-card .chg { font-size:.6rem; font-weight:600; padding:2px 5px; border-radius:3px; margin-top:5px; display:inline-block; }
.chg.up { background:var(--green-bg); color:var(--green); }
.chg.down { background:var(--red-bg); color:var(--red); }

/* ── Two Column ── */
.main-grid { display:grid; grid-template-columns:1.4fr .6fr; gap:20px; }

/* ── FX Table ── */
.fx-panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.fx-search { display:flex; border-bottom:1px solid var(--border); }
.fx-search input { flex:1; padding:9px 12px; border:none; background:transparent; font-size:.8rem; color:var(--text); outline:none; font-family:inherit; }
.fx-search input::placeholder { color:var(--text3); }
.fx-head { display:grid; grid-template-columns:24px 1fr 72px 72px; gap:6px; padding:8px 12px; background:var(--surface2); border-bottom:1px solid var(--border); font-size:.55rem; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:var(--text3); }
.fx-head span:nth-child(3),.fx-head span:nth-child(4) { text-align:right; }
.fx-body { }
.fx-row { display:grid; grid-template-columns:24px 1fr 72px 72px; gap:6px; padding:8px 12px; border-bottom:1px solid var(--border); align-items:center; transition:background var(--transition); cursor:default; }
.fx-row:last-child { border-bottom:none; }
.fx-row:hover { background:var(--surface2); }
.fx-flag { width:20px; height:14px; border-radius:2px; object-fit:cover; display:block; }
.fx-name { font-size:.75rem; font-weight:500; line-height:1.3; }
.fx-name small { display:block; font-size:.55rem; color:var(--text3); font-weight:400; }
.fx-val { font-size:.75rem; font-weight:600; text-align:right; font-variant-numeric:tabular-nums; }

/* ── Right Column ── */
.side-col { display:flex; flex-direction:column; gap:12px; }

.ons-box { background:var(--gold-light); border:1px solid var(--gold-muted); border-radius:var(--radius); padding:16px; }
.ons-box .tag { font-size:.55rem; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--gold-dark); margin-bottom:4px; }
.ons-box .big-price { font-size:1.8rem; font-weight:700; color:var(--gold-dark); font-variant-numeric:tabular-nums; line-height:1.2; }
.ons-box .sub { font-size:.6rem; color:var(--text3); margin-top:2px; }

.metals-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.metal-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:10px; }
.metal-card .label { font-size:.55rem; color:var(--text3); font-weight:600; text-transform:uppercase; letter-spacing:.5px; }
.metal-card .val { font-size:.85rem; font-weight:700; margin-top:2px; font-variant-numeric:tabular-nums; }

/* ── Converter ── */
.converter { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
.conv-group { margin-bottom:12px; }
.conv-group:last-child { margin-bottom:0; }
.conv-group-label { font-size:.55rem; font-weight:600; letter-spacing:.8px; text-transform:uppercase; color:var(--text3); margin-bottom:5px; }
.conv-field { display:flex; align-items:center; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; transition:border-color var(--transition); }
.conv-field:focus-within { border-color:var(--gold-muted); }
.conv-field select { border:none; background:transparent; padding:10px 8px 10px 12px; font-size:.85rem; font-weight:600; color:var(--text); font-family:inherit; outline:none; cursor:pointer; -webkit-appearance:none; -moz-appearance:none; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%239C9789'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 4px center; padding-right:16px; border-right:1px solid var(--border); }
.conv-field .conv-flag { width:18px; height:13px; border-radius:2px; object-fit:cover; margin-left:10px; flex-shrink:0; }
.conv-field input { flex:1; border:none; background:transparent; padding:10px 12px; font-size:1.15rem; font-weight:600; text-align:right; color:var(--text); font-family:inherit; font-variant-numeric:tabular-nums; outline:none; }
.conv-field input::-webkit-outer-spin-button,.conv-field input::-webkit-inner-spin-button { -webkit-appearance:none; }
.conv-field input[type=number] { -moz-appearance:textfield; }
.conv-swap-row { display:flex; align-items:center; justify-content:center; margin:8px 0; position:relative; }
.conv-swap-row::before { content:''; position:absolute; left:0; right:0; top:50%; height:1px; background:var(--border); }
.conv-swap-btn { position:relative; z-index:1; background:var(--surface); border:1px solid var(--border); border-radius:50%; width:32px; height:32px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text2); font-size:.85rem; transition:all var(--transition); }
.conv-swap-btn:hover { background:var(--gold-light); border-color:var(--gold-muted); color:var(--gold-dark); transform:rotate(180deg); }
.conv-result-field { background:var(--gold-light); border-color:var(--gold-muted); }
.conv-result-field .conv-result-val { flex:1; padding:10px 12px; font-size:1.15rem; font-weight:700; text-align:right; color:var(--gold-dark); font-variant-numeric:tabular-nums; }

/* ── News ── */
.news-list { display:flex; flex-direction:column; gap:6px; }
.news-item { display:block; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; text-decoration:none; transition:var(--transition); }
.news-item:hover { border-color:var(--gold-muted); }
.news-item .src { font-size:.55rem; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--gold); margin-bottom:2px; }
.news-item .headline { font-size:.72rem; line-height:1.4; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.news-item .date { font-size:.55rem; color:var(--text3); margin-top:3px; }

/* ── Footer ── */
.status-line { text-align:center; font-size:.65rem; color:var(--text3); margin-top:20px; padding-top:12px; border-top:1px solid var(--border); }
.site-footer { background:var(--surface); border-top:1px solid var(--border); padding:14px clamp(16px,3vw,32px); display:flex; justify-content:space-between; font-size:.65rem; color:var(--text3); margin-top:24px; }

/* ── Skeleton ── */
.skeleton { background:linear-gradient(90deg,var(--bg2) 25%,var(--surface2) 50%,var(--bg2) 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:3px; color:transparent !important; user-select:none; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Responsive ── */
@media(max-width:1000px) {
  .gold-grid { grid-template-columns:repeat(3,1fr); }
}
@media(max-width:850px) {
  .main-grid { grid-template-columns:1fr; }
}
@media(max-width:600px) {
  .gold-grid { grid-template-columns:repeat(2,1fr); }
  .gold-card .price { font-size:1rem; }
  .site-footer { flex-direction:column; gap:4px; text-align:center; }
  .fx-head { grid-template-columns:20px 1fr 52px 52px; gap:3px; padding:6px 8px; font-size:.5rem; }
  .fx-row { grid-template-columns:20px 1fr 52px 52px; gap:3px; padding:6px 8px; }
  .fx-val { font-size:.62rem; }
  .fx-name { font-size:.65rem; }
  .fx-name small { font-size:.45rem; }
  .fx-flag { width:16px; height:11px; }
  .ons-box .big-price { font-size:1.4rem; }
  .conv-field input { font-size:1rem; }
  .conv-result-field .conv-result-val { font-size:1rem; }
}
@media(max-width:400px) {
  .gold-grid { grid-template-columns:1fr 1fr; gap:6px; }
  .gold-card { padding:10px; }
  .gold-card .price { font-size:.9rem; }
  .metals-row { grid-template-columns:1fr 1fr; }
  .fx-head { grid-template-columns:18px 1fr 44px 44px; gap:2px; padding:5px 6px; }
  .fx-row { grid-template-columns:18px 1fr 44px 44px; gap:2px; padding:5px 6px; }
  .fx-val { font-size:.55rem; }
  .fx-name { font-size:.6rem; }
  .fx-flag { width:14px; height:10px; }
  .ticker-item { padding:0 10px; font-size:.55rem; }
}
