/* --- CORE VARIABLES --- */
:root {
  --bg-body: #F8FAFC; --bg-surface: #FFFFFF; --bg-header: rgba(255, 255, 255, 0.95);
  --primary: #0F172A; --secondary: #64748B; --border: #E2E8F0;
  --accent: #2563EB; --accent-light: #EFF6FF;
  --success: #10B981; --success-bg: #ECFDF5;
  --warning: #F59E0B; --danger: #EF4444;
  --font-ui: 'Inter', sans-serif; --font-head: 'Space Grotesk', sans-serif; --font-data: 'JetBrains Mono', monospace;
  --container: 1200px; --header-h: 70px; --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg-body);
  color: var(--primary);
  font-family: var(--font-ui);
  line-height: 1.6;
  padding-top: calc(var(--header-h) + 36px);
  font-size: 15px;
  overflow-x: hidden; /* FIX: mobile overflow */
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- UTILITY --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.grid { display: grid; gap: 30px; min-width: 0; } /* FIX: grid overflow */
.flex { display: flex; align-items: center; min-width: 0; } /* FIX */
.justify-between { justify-content: space-between; }
.items-start { align-items: flex-start; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden-mobile { display: block; } /* referenced in templates */
.badge { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-live { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-blue { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(37, 99, 235, 0.2); }
.live-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; display: inline-block; box-shadow: 0 0 0 rgba(16, 185, 129, 0.4); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

/* FIX: long words/domains wrap globally (safe, does not break home) */
td, th, .news-content, .blog-excerpt, .article-content p, .article-content li, .domain-flow, .old-d, .new-d {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* --- TICKER --- */
.ticker-wrap { position: fixed; top: var(--header-h); left: 0; width: 100%; height: 36px; background: var(--primary); color: white; z-index: 900; overflow: hidden; display: flex; align-items: center; }
.ticker { display: inline-block; white-space: nowrap; animation: ticker 40s linear infinite; will-change: transform; }
.ticker-item { display: inline-block; padding: 0 30px; font-size: 13px; font-family: var(--font-data); }
@keyframes ticker { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* --- HEADER --- */
header { position: fixed; top: 0; left: 0; width: 100%; height: var(--header-h); background: var(--bg-header); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); z-index: 1000; }
.header-inner { height: 100%; flex-wrap: wrap; gap: 10px; } /* FIX: prevent overflow */
.brand { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; white-space: nowrap; }
.brand span { color: var(--accent); }
.nav-links { gap: 30px; font-size: 14px; font-weight: 500; flex-wrap: wrap; }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.btn-primary { background: var(--primary); color: white; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 13px; transition: transform 0.2s; display: inline-flex; align-items: center; justify-content: center; max-width: 100%; }
.btn-primary:hover { transform: translateY(-2px); background: #1E293B; }

/* --- HERO METRICS --- */
.hero-metrics { grid-template-columns: repeat(4, 1fr); margin: 30px 0; }
.metric-card { background: var(--bg-surface); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.metric-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); }
.metric-card:nth-child(1)::before { background: var(--accent); }
.metric-card:nth-child(2)::before { background: var(--warning); }
.metric-card:nth-child(3)::before { background: var(--success); }
.m-label { font-size: 12px; font-weight: 700; color: var(--secondary); text-transform: uppercase; }
.m-value { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--primary); margin-top: 8px; }
.m-sub { font-size: 12px; margin-top: 4px; color: var(--secondary); }

/* --- MAIN LAYOUT --- */
.main-grid { grid-template-columns: 2.8fr 1.2fr; align-items: start; min-width: 0; }

/* 1. LIVE TABLE COMPONENT */
.monitor-container { background: var(--bg-surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 40px; max-width: 100%; }
.table-header { padding: 20px 24px; border-bottom: 1px solid var(--border); background: #F9FAFB; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.table-title h2 { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 16px 24px; background: #F1F5F9; color: var(--secondary); font-size: 12px; font-weight: 700; text-transform: uppercase; }
td { padding: 16px 24px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--primary); vertical-align: middle; }
.site-cell { display: flex; align-items: center; gap: 12px; font-weight: 600; min-width: 0; }
.site-icon { width: 32px; height: 32px; border-radius: 8px; background: #F1F5F9; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--secondary); flex: 0 0 auto; }
.domain-flow { font-family: var(--font-data); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.old-d { text-decoration: line-through; color: #94A3B8; font-size: 13px; }
.new-d { color: var(--accent); font-weight: 700; background: #EFF6FF; padding: 4px 8px; border-radius: 4px; border: 1px solid #DBEAFE; }
.btn-sm { padding: 6px 12px; background: var(--primary); color: white; border-radius: 6px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; max-width: 100%; }

/* 2. BLOG LIST COMPONENT (NEW) */
.blog-section-title { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin-bottom: 20px; border-left: 4px solid var(--accent); padding-left: 15px; }
.blog-list { display: grid; gap: 20px; }
.blog-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; gap: 20px; transition: transform 0.2s; min-width: 0; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.blog-thumb { width: 100px; height: 100px; background: #F1F5F9; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: #CBD5E1; flex-shrink: 0; }
.blog-content { flex: 1; min-width: 0; }
.blog-meta { font-size: 12px; color: var(--secondary); margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.blog-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.blog-excerpt { font-size: 14px; color: var(--secondary); margin-bottom: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-link { font-size: 13px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }

/* SIDEBAR */
.widget { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); max-width: 100%; }
.widget-title { font-family: var(--font-head); font-size: 16px; font-weight: 700; border-bottom: 2px solid var(--border); padding-bottom: 12px; margin-bottom: 16px; }
.news-item { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.news-item:last-child { border: none; padding: 0; margin: 0; }
.news-content { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--primary); display: block; }
.news-content:hover { color: var(--accent); }
.cta-telegram { background: linear-gradient(135deg, #229ED9 0%, #1E88E5 100%); color: white; border: none; padding: 24px; text-align: center; }
.btn-white { background: white; color: #229ED9; padding: 10px 20px; border-radius: 6px; font-weight: 700; width: 100%; display: block; }

/* FOOTER */
footer { background: #0F172A; color: #94A3B8; padding: 60px 0 20px; margin-top: 60px; font-size: 14px; }
.footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; margin-bottom: 40px; min-width: 0; }
.footer-brand { color: white; font-family: var(--font-head); font-size: 22px; font-weight: 700; display: block; margin-bottom: 12px; }
.f-head { color: white; font-weight: 600; margin-bottom: 20px; display: block; }
.f-links li { margin-bottom: 10px; }
.copyright { border-top: 1px solid #1E293B; padding-top: 20px; text-align: center; font-size: 13px; }

/* RESPONSIVE */
@media (max-width: 1024px) { .main-grid { grid-template-columns: 1fr; } .ticker-wrap { display: none; } body { padding-top: var(--header-h); } }
@media (max-width: 768px) { .hero-metrics { grid-template-columns: 1fr 1fr; } .blog-card { flex-direction: column; } .blog-thumb { width: 100%; height: 150px; } .hidden-mobile { display: none; } .footer-grid { grid-template-columns: 1fr; gap: 30px; } .container { padding: 0 16px; } .article-box { padding: 20px; } th { padding: 12px 14px; font-size: 11px; } td { padding: 12px 14px; font-size: 13px; } .table-header { padding: 14px 14px; } .brand { font-size: 20px; } .btn-primary { padding: 9px 14px; } }
@media (max-width: 420px) { .hero-metrics { grid-template-columns: 1fr; } .container { padding: 0 14px; } .new-d { padding: 4px 6px; font-size: 12px; } }

/* Flash Animation */
@keyframes flashRow { 0% { background-color: #FEF3C7; } 100% { background-color: transparent; } }
.flash-row { animation: flashRow 2s ease-out; }

/* --- 5. FIRM PAGE LAYOUT (ÖZEL KISIM) --- */
.firm-layout { grid-template-columns: 320px 1fr; align-items: start; margin-top: 40px; min-width: 0; }

.firm-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; text-align: center; box-shadow: var(--shadow); position: sticky; top: 120px; }
.firm-logo { width: 100px; height: 100px; background: #F1F5F9; border-radius: 16px; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; color: #94A3B8; border: 1px solid var(--border); }
.firm-name { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.firm-rating { color: var(--warning); font-weight: 700; font-size: 14px; margin-bottom: 20px; }

.btn-visit-lg { display: block; background: var(--success); color: white; font-weight: 700; padding: 16px; border-radius: 8px; font-size: 16px; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); transition: transform 0.2s; max-width: 100%; }
.btn-visit-lg:hover { transform: translateY(-2px); background: #059669; }

.firm-meta { text-align: left; border-top: 1px solid var(--border); padding-top: 20px; font-size: 14px; }
.meta-row { display: flex; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.meta-label { color: var(--secondary); }
.meta-val { font-weight: 600; color: var(--primary); text-align: right; }

.content-section { margin-bottom: 40px; }
.section-header { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--primary); }

/* Table (Firm Specific) */
.monitor-container { background: var(--bg-surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; max-width: 100%; }

/* Blog Cards (Firm Specific) */
.firm-blog-grid { display: grid; gap: 20px; }

/* SEO Article */
.article-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); max-width: 100%; }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #F8FAFC; }
.faq-btn { width: 100%; padding: 15px 20px; text-align: left; background: none; border: none; font-weight: 600; color: var(--primary); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.faq-body { padding: 0 20px 20px; display: none; color: var(--secondary); font-size: 15px; }
.faq-item.active .faq-body { display: block; }
.faq-item.active { background: white; border-color: var(--accent); }

/* --- POST DETAIL EXTRAS --- */
.post-header-meta { display:flex; flex-wrap:wrap; gap:10px; font-size:12px; color: var(--secondary); margin-bottom: 10px; }
.post-header-meta .dot { color:#CBD5E1; }
.author-box { display:flex; gap:16px; align-items:center; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.author-avatar { width:48px; height:48px; border-radius: 12px; background:#F1F5F9; display:flex; align-items:center; justify-content:center; font-weight:800; color:#94A3B8; flex: 0 0 auto; }
.author-meta { font-size:12px; color: var(--secondary); margin-top: 2px; }

/* Breadcrumb */
.breadcrumb { margin-top: 20px; font-size: 13px; color: var(--secondary); overflow-wrap: anywhere; }
.breadcrumb a { color: inherit; }
.breadcrumb .sep { margin: 0 5px; }
.breadcrumb .current { color: var(--primary); font-weight: 600; }

/* Mobile Bottom Navigation */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: 58px; background: rgba(255,255,255,0.98); border-top: 1px solid var(--border); display: none; z-index: 1200; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size: 11px; color: var(--secondary); gap:4px; min-width: 0; }
.bottom-nav a.active { color: var(--accent); font-weight: 600; }
.bottom-nav .ico { font-size: 16px; line-height: 1; }

@media (max-width: 768px) {
  body { padding-bottom: 70px; }
  .bottom-nav { display: flex; }
}

/* =======================================================================
   FIRM DETAIL 
   ======================================================================= */
@media (max-width: 1024px) {
  .firm-layout { grid-template-columns: 1fr !important; }
  .firm-card { position: static !important; top: auto !important; }
}

@media (max-width: 768px) {
  .firm-layout { grid-template-columns: 1fr !important; gap: 18px; margin-top: 24px; }
  .firm-layout > aside,
  .firm-layout > main { width: 100%; min-width: 0; }

  .firm-card { padding: 18px; }
  .firm-logo { width: 84px; height: 84px; font-size: 34px; }
  .firm-name { font-size: 20px; }
  .btn-visit-lg { padding: 14px; font-size: 15px; }

  .meta-row { flex-wrap: wrap; }
  .meta-val { text-align: left; }

  .article-box { padding: 18px; }
  .content-section { margin-bottom: 28px; }

  /* Only firm page table scroll fix (scoped) */
  .firm-layout .monitor-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .firm-layout .monitor-container table { min-width: 620px; }
}

@media (max-width: 420px) {
  .firm-layout .monitor-container table { min-width: 700px; }
}

