/* 
 * Nokta Haber - Main Stylesheet (Vanilla CSS)
 * Premium Dark/Light UI, Responsive Layout, Animations
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --accent: #ff2d4b;
  --accent-hover: #e11d48;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 72px;
}

[data-theme="dark"] {
  --bg-primary: #09090b;
  --bg-secondary: #18181b;
  --bg-card: #1f1f23;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #27272a;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Utility Elements */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

/* Ticker (Son Dakika) */
.breaking-ticker {
  height: 36px;
  position: relative;
  z-index: 100;
  overflow: hidden;
  background: #111827;
  color: #fff;
  font-size: 0.8rem;
  user-select: none;
}

.breaking-ticker-inner {
  height: 100%;
  display: flex;
  align-items: center;
}

.breaking-label {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 2;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-content {
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ticker-track {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 44px;
  white-space: nowrap;
  animation: ticker 25s linear infinite;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-weight: 500;
}

.ticker-item::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.ticker-item:hover {
  color: #fecdd3;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-main {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.logo {
  flex: 0 0 auto;
  max-width: 240px;
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.logo img {
  display: block;
  max-width: 100%;
  max-height: 46px;
  object-fit: contain;
}

.logo span {
  margin-left: 0.12em;
  color: var(--accent);
}

.header-nav-wrap {
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.nav-menu {
  position: relative;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  list-style: none;
}

.nav-item {
  position: relative;
  min-width: 0;
}

.nav-link {
  position: relative;
  display: block;
  padding: 12px 13px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.mega-menu {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  width: min(750px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: 200px 1fr;
  padding: 20px;
  z-index: 95;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.nav-item:hover .mega-menu,
.nav-item:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-item:nth-last-child(-n+3) .mega-menu {
  right: 0;
  left: auto;
  transform: translateY(8px);
}

.nav-item:nth-last-child(-n+3):hover .mega-menu,
.nav-item:nth-last-child(-n+3):focus-within .mega-menu {
  transform: translateY(0);
}

.mega-categories {
  padding-right: 15px;
  border-right: 1px solid var(--border-color);
}

.mega-categories h4,
.mega-news h4 {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mega-categories ul {
  list-style: none;
}

.mega-categories li {
  margin-bottom: 5px;
}

.mega-categories a {
  display: block;
  padding: 4px 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.mega-categories a:hover,
.mega-news-card:hover h5 {
  color: var(--accent);
}

.mega-news {
  padding-left: 20px;
}

.news-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background-color: #000;
}

.news-card-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.widget-news-item img {
  flex-shrink: 0;
}

.mega-news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.mega-news-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.mega-news-card h5 {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

.header-actions {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-search {
  position: relative;
  width: min(300px, 30vw);
  margin-right: 6px;
}

.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.86rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.header-search input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgb(255 45 75 / 0.12);
}

.header-search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-icon-btn:hover {
  border-color: var(--border-color);
  background: var(--bg-secondary);
}

.header-auth-btn,
.header-user-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.header-auth-btn {
  background: var(--accent);
  color: #fff;
}

.header-auth-btn:hover {
  background: var(--accent-hover);
}

.header-user-btn {
  max-width: 180px;
  border: 1px solid var(--border-color);
}

.header-user-btn:hover {
  border-color: var(--text-muted);
  background: var(--bg-secondary);
}

.header-user-btn img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.header-user-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-toggle {
  display: none;
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle-lines {
  position: relative;
}

.menu-toggle-lines::before,
.menu-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-lines::before {
  top: -6px;
}

.menu-toggle-lines::after {
  top: 6px;
}

.menu-toggle.is-open .menu-toggle-lines {
  background: transparent;
}

.menu-toggle.is-open .menu-toggle-lines::before {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle-lines::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* Reading Progress Bar */
.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 99;
  pointer-events: none;
}

#reading-progress {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s ease-out;
}

/* Footer */
.site-footer {
  background-color: #0b0f19;
  color: #94a3b8;
  padding: 60px 0 30px;
  border-top: 1px solid #1e293b;
  margin-top: 50px;
}

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

.footer-col h3 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #fff;
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background-color: #1e293b;
  color: #fff;
  border-radius: 50%;
}
.social-link:hover {
  background-color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Animations */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

@keyframes ticker {
  0% { transform: translate3d(100%, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Responsive */
@media (max-width: 992px) {
  .header-main {
    gap: 18px;
  }

  .logo {
    max-width: 190px;
    font-size: 1.4rem;
  }

  .header-search {
    width: min(240px, 32vw);
  }

  .header-nav-wrap {
    border-top: 0;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - var(--header-height));
    padding: 10px 20px 16px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }

  .nav-menu.is-open {
    display: block;
  }

  .nav-list {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-item:last-child {
    border-bottom: 0;
  }

  .nav-link {
    padding: 12px 4px;
    font-size: 0.9rem;
    white-space: normal;
  }

  .nav-link::after {
    display: none;
  }

  .mega-menu {
    display: none !important;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 14px;
  }

  .breaking-ticker-inner {
    padding-left: 0;
  }

  .breaking-label {
    padding: 0 11px;
    font-size: 0.7rem;
  }

  .ticker-track {
    gap: 30px;
  }

  .header-main {
    gap: 10px;
  }

  .logo {
    max-width: 150px;
    font-size: 1.3rem;
  }

  .header-actions {
    gap: 4px;
  }

  .header-search {
    display: none;
  }

  .header-icon-btn {
    width: 38px;
    height: 38px;
  }

  .header-user-btn,
  .header-auth-btn {
    height: 38px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .nav-menu {
    padding-right: 14px;
    padding-left: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 64px;
  }

  .breaking-ticker {
    height: 32px;
  }

  .breaking-label {
    max-width: 78px;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
  }

  .logo {
    max-width: 118px;
    font-size: 1.14rem;
  }

  .theme-toggle {
    display: none;
  }

  .header-user-btn {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-auth-btn {
    height: 36px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

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