/* 
 * 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: 70px;
}

[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;
}

.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 {
  background-color: var(--accent);
  color: #fff;
  height: 40px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
  font-size: 0.85rem;
  overflow: hidden;
  user-select: none;
}

.breaking-label {
  background-color: #000;
  color: #fff;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  animation: pulse 1.5s infinite;
  z-index: 2;
}

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

.ticker-track {
  display: flex;
  white-space: nowrap;
  position: absolute;
  animation: ticker 25s linear infinite;
  padding-left: 0;
}

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

.ticker-item {
  color: #fff;
  font-weight: 500;
  margin-right: 50px;
  display: inline-flex;
  align-items: center;
}
.ticker-item:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  min-height: var(--header-height);
  height: auto;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  padding: 10px 24px;
}

/* Reading Progress Bar (Attached to bottom of header) */
.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: transparent;
  z-index: 99;
  pointer-events: none;
}

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

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

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 26px;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  min-width: 120px;
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
}

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

.logo span {
  color: var(--accent);
}

/* Navigation & Mega Menu */
.nav-menu {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0 10px;
  list-style: none;
  min-width: 0;
  flex-wrap: wrap;
  align-content: center;
}

.nav-item {
  position: relative;
  padding: 6px clamp(5px, 0.55vw, 10px);
  min-width: 0;
}

.nav-link {
  font-weight: 600;
  font-size: clamp(0.78rem, 0.78vw, 0.9rem);
  color: var(--text-secondary);
  display: block;
  white-space: nowrap;
}

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

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

.nav-item:hover .mega-menu {
  display: grid;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

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

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

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

.mega-categories h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

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

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

.mega-categories a {
  font-size: 0.9rem;
  font-weight: 500;
}

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

.mega-news h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.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 Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.header-search {
  display: flex;
  align-items: center;
  flex: 0 1 160px;
  min-width: 110px;
}

.header-search .form-control {
  width: 100%;
  min-width: 0;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
}

.header-user-btn,
.header-auth-btn {
  gap: 8px;
  padding: 6px 12px;
  white-space: nowrap;
}

.theme-toggle, .search-btn, .menu-toggle {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle:hover, .search-btn:hover {
  background-color: var(--bg-secondary);
}

.menu-toggle {
  display: none;
}

/* 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: 1180px) {
  .header-inner {
    gap: 10px 16px;
  }

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

  .header-search {
    flex-basis: 140px;
    min-width: 90px;
  }

  .header-user-btn,
  .header-auth-btn {
    padding: 6px 10px;
    font-size: 0.84rem;
  }
}

@media (max-width: 1320px) {
  .header-search {
    flex-basis: 150px;
  }
}

@media (max-width: 1080px) {
  .header-search {
    flex-basis: 130px;
  }
}

@media (max-width: 992px) {
  .site-header {
    height: auto;
    min-height: var(--header-height);
  }

  .header-inner {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    position: relative;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .nav-menu {
    display: none;
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
  }

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

  .nav-item {
    padding: 0;
    width: 100%;
  }

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

  .mega-menu {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
    flex: 1 1 auto;
    flex-wrap: wrap;
  }

  .header-search {
    display: flex;
    order: 10;
    flex: 0 0 100%;
    width: 100%;
    margin-top: 8px;
  }
}

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

  .logo {
    min-width: 0;
    max-width: 45vw;
    font-size: 1.25rem;
  }

  .header-actions {
    gap: 6px;
  }

  .header-search {
    display: flex;
    order: 4;
    flex: 0 0 100%;
    width: 100%;
  }

  .theme-toggle, .search-btn, .menu-toggle {
    padding: 7px;
  }

  .header-user-btn,
  .header-auth-btn {
    padding: 6px 9px;
    font-size: 0.82rem;
  }

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

@media (max-width: 480px) {
  .header-user-btn {
    max-width: 115px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-auth-btn {
    max-width: 86px;
  }

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