:root {
  --bg-color: #ffffff;
  --text-color: #1a1a24;
  --text-muted: #6b7280;
  --accent-color: #E63946;
  --accent-hover: #d62828;
  --card-bg: #f8f9fa;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg-color: #0B0C10;
  --text-color: #F8F9FA;
  --text-muted: #9CA3AF;
  --accent-color: #E63946;
  --accent-hover: #FF4D5A;
  --card-bg: #15161C;
  --border-color: #2D2F3A;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.6), 0 4px 10px -2px rgba(0, 0, 0, 0.4);
}



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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }

/* Grid Layouts */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
@media (max-width: 768px) {
  .grid-cols-2 { grid-template-columns: 1fr; }
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 1rem;
}
.text-center { text-align: center; }
.text-4xl { font-size: 3rem; }
.text-2xl { font-size: 1.8rem; }
.text-xl { font-size: 1.25rem; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: bold; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }

/* UI Components */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-color);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: var(--transition);
}
.input-field:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
}

/* Sidebar Specifics */
.main-wrapper {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.main-content {
  flex: 1;
  padding: 4rem 2rem;
  overflow-y: auto;
  transition: var(--transition);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .sidebar-overlay { display: none; }
}

/* Markdown formatting for News */
.prose { line-height: 1.7; }
.prose p { margin-bottom: 1rem; }
.prose strong { color: var(--accent-color); }

.footer-link {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}
.footer-link:hover {
  color: var(--accent-color);
}

/* Force tables from WYSIWYG editor to adapt to themes */
.prose table {
    width: 100% !important;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
}
.prose th, .prose td {
    border: 1px solid var(--border-color) !important;
    padding: 0.75rem;
    background: transparent !important;
}

/* Override harsh inline black/white colors inserted by editors to maintain theme */
.prose [style*="color: #000000"], 
.prose [style*="color: rgb(0, 0, 0)"],
.prose [style*="color: #ffffff"],
.prose [style*="color: rgb(255, 255, 255)"] {
    color: var(--text-color) !important;
}

.prose [style*="background-color: #ffffff"],
.prose [style*="background-color: rgb(255, 255, 255)"],
.prose [style*="background-color: #000000"],
.prose [style*="background-color: rgb(0, 0, 0)"] {
    background-color: transparent !important;
}
