:root {
  /* Brand Colors */
  --primary: #1e3a8a; /* Navy Blue (Lacivert) */
  --primary-dark: #1e3a8a; /* Dark Navy */
  --primary-light: #3b82f6;
  --secondary: #f97316; /* Orange (Turuncu) */
  --secondary-dark: #ea580c;
  
  /* Neutral Colors */
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --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);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --surface-color: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #cbd5e1; /* Increased contrast for muted text */
  --border-color: #334155;
  --primary: #60a5fa; /* Brighter primary for dark mode */
  --primary-dark: #3b82f6;
  --primary-light: #93c5fd;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.6);
}

[data-theme="dark"] body {
  background-color: var(--bg-color);
  color: var(--text-main);
}

/* Aggressively override all light/hardcoded backgrounds in dark mode */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background: rgba(255, 255, 255"],
[data-theme="dark"] [style*="background:rgba(255, 255, 255"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #fff1f2"], /* Pinkish widgets */
[data-theme="dark"] [style*="background:#fff1f2"],
[data-theme="dark"] [style*="background: #fffcee"], /* Yellowish widgets */
[data-theme="dark"] [style*="background:#fffcee"],
[data-theme="dark"] [style*="background: linear-gradient(145deg, #ffffff"],
[data-theme="dark"] .glass-panel,
[data-theme="dark"] .item-card,
[data-theme="dark"] .market-card,
[data-theme="dark"] .discount-card,
[data-theme="dark"] .confession-card,
[data-theme="dark"] .news-card,
[data-theme="dark"] .widget,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .t-modal-content,
[data-theme="dark"] .add-event-box,
[data-theme="dark"] .add-event-box form,
[data-theme="dark"] .quick-menu,
[data-theme="dark"] .navbar {
  background: var(--surface-color) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

/* Ensure child elements like titles and muted text inherit correct colors in dark mode */
[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] .market-title,
[data-theme="dark"] .item-title,
[data-theme="dark"] .brand-name,
[data-theme="dark"] .quick-title {
  color: var(--text-main) !important;
}

[data-theme="dark"] p, 
[data-theme="dark"] span:not(.badge), 
[data-theme="dark"] .text-muted,
[data-theme="dark"] .market-loc,
[data-theme="dark"] .item-loc,
[data-theme="dark"] .brand-desc,
[data-theme="dark"] .event-meta {
  color: var(--text-muted) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-control {
  background-color: var(--bg-color) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .navbar.scrolled {
  background: rgba(15, 23, 42, 0.95) !important;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title i {
  color: var(--secondary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(15, 118, 110, 0.39);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.5);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.39);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition);
  padding: 1rem 0;
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-logo img {
  height: 38px;
  background: #ffffff;
  padding: 0.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  object-fit: contain;
}
.nav-logo:hover img {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12), 0 2px 5px rgba(0, 0, 0, 0.08);
}
.nav-logo span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--secondary);
  transition: var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding-top: 8rem;
  padding-bottom: 2rem;
}
.hero-slider {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  height: 400px;
  box-shadow: var(--shadow-xl);
}
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  background-size: cover;
  background-position: center;
}
.slide.active {
  opacity: 1;
}
.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.2));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  color: white;
}
.slide-category {
  background: var(--secondary);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  align-self: flex-start;
  margin-bottom: 1rem;
}
.slide-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.slide-desc {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
}
.slider-controls {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  gap: 1rem;
}
.slider-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.slider-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Quick Menu */
.quick-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: -3rem;
  position: relative;
  z-index: 10;
}
.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-main);
}
.quick-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary-light);
}
.quick-icon {
  width: 4rem;
  height: 4rem;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}
.quick-item:hover .quick-icon {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}
.quick-title {
  font-weight: 600;
  font-size: 1rem;
}

/* Layout Grid */
.home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

/* News Feed */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.news-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  transition: var(--transition);
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.news-img {
  width: 160px;
  height: 120px;
  border-radius: 0.75rem;
  object-fit: cover;
}
.news-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.news-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.news-tag {
  color: var(--primary);
  font-weight: 600;
}
.news-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.news-excerpt {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  flex-grow: 1;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.widget {
  background: #fff;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.widget-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Today's Events */
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.event-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.event-date {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
  border-radius: 0.5rem;
  text-align: center;
  min-width: 60px;
  padding: 0.5rem;
}
.event-day {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}
.event-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 0.25rem;
}
.event-details h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.event-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Cafeteria Menu Widget */
.food-menu-list {
  list-style: none;
}
.food-menu-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.food-menu-list li:last-child {
  border-bottom: none;
}
.food-menu-list li i {
  color: var(--secondary);
  font-size: 0.875rem;
}

/* Footer */
.footer {
  background-color: #0f172a;
  color: #fff;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  display: inline-block;
  margin-bottom: 1rem;
}
.footer-logo span {
  color: var(--secondary);
}
.footer-about {
  color: #94a3b8;
  margin-bottom: 1.5rem;
}
.social-links {
  display: flex;
  gap: 1rem;
}
.social-links a {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: var(--transition);
  text-decoration: none;
}
.social-links a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}
.footer-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #fff;
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 0.75rem;
}
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--secondary);
  padding-left: 0.25rem;
}
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 992px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: #fff;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    transition: var(--transition);
  }
  .nav-links.active {
    left: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
  
  .slide-title {
    font-size: 1.75rem;
  }
  .slide-overlay {
    padding: 1.5rem;
  }
  
  .news-card {
    flex-direction: column;
  }
  .news-img {
    width: 100%;
    height: 200px;
  }
}
