/* ==========================================================================
   AI PULSE / TAHA AI NEWS - Minimalist & Responsive Stylesheet
   ========================================================================== */

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

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #fcfcfd;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f5f7;
  --border-color: #e5e7eb;
  --border-focus: #111827;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff6ff;
  --accent-glow: rgba(37, 99, 235, 0.12);
  
  --badge-bg: #f1f5f9;
  --badge-text: #334155;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --container-max: 1120px;
}

[data-theme="dark"] {
  /* Color Palette - Dark Mode */
  --bg-primary: #090d16;
  --bg-surface: #111827;
  --bg-subtle: #1a2234;
  --border-color: #242f45;
  --border-focus: #3b82f6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: #1e293b;
  --accent-glow: rgba(59, 130, 246, 0.18);
  
  --badge-bg: #1e293b;
  --badge-text: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

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

button, input {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(252, 252, 253, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .header {
  background-color: rgba(9, 13, 22, 0.85);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Header Date Badge */
.live-date {
  font-size: 0.825rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* Icon Buttons */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent);
  color: #ffffff;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

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

/* Hero Section */
.hero {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  border: 1px solid var(--accent-glow);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Controls Bar (Filter Pills & Search) */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  padding: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-group::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-chip:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.filter-chip.active {
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.9rem;
  min-width: 240px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  font-size: 0.875rem;
  color: var(--text-main);
}

.search-box input::placeholder {
  color: var(--text-light);
}

/* News Section & Empty State */
.news-section {
  flex: 1;
  padding-bottom: 4rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Empty State Card */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4.5rem 2rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 1rem;
}

.empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.empty-state h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 440px;
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

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

/* Card Style (Ready for when news is added) */
.news-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.card-tag {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-date {
  font-size: 0.775rem;
  color: var(--text-light);
  font-family: 'JetBrains Mono', monospace;
}

.news-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.news-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-light);
}

.read-more-link {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.read-more-link:hover {
  gap: 0.45rem;
}

/* Quick Add Modal (Helper for User) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.close-modal {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  background: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

/* Newsletter Box */
.newsletter-card {
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-subtle));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
}

.newsletter-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.newsletter-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.newsletter-form {
  display: flex;
  max-width: 440px;
  margin: 0 auto;
  gap: 0.5rem;
}

.newsletter-form input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  color: var(--text-main);
}

.newsletter-form input:focus {
  border-color: var(--accent);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  background: var(--bg-surface);
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-main);
  color: var(--bg-surface);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: var(--transition);
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .hero {
    padding: 2.5rem 0 1.5rem;
  }
  
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }
  
  .filter-group {
    width: 100%;
  }

  .live-date {
    display: none;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
