:root {
  --color-primary: #0078d4;
  --color-primary-rgb: 0, 120, 212;
  --color-primary-dark: #005a9e;
  --color-accent-orange: #d83b01;
  --color-accent-purple: #8764b8;
  --color-accent-green: #107c10;
  --color-accent-red: #d13438;
  --color-nav-bg: #1b2a3b;
  --color-sidebar-bg: #f7f7f7;
  --bs-primary: #0078d4;
  --bs-primary-rgb: 0, 120, 212;
  --bs-secondary: #6c757d;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f8f9fb 0%, #f0f4f8 100%);
  color: #333;
}

/* Navigation */
#main-navbar {
  background: var(--color-nav-bg) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.5px;
}

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

.nav-link {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9) !important;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--color-primary) !important;
}

.dropdown-menu {
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dropdown-item:hover {
  background: #E8F4FD;
  color: var(--color-primary);
}

/* Cards */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.card-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  border: none;
  font-weight: 600;
  padding: 1.25rem 1.5rem;
  border-bottom: 3px solid var(--color-accent-orange);
}

.card-title {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background: var(--color-sidebar-bg);
  border: none;
  padding: 1rem 1.5rem;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #005a9e 100%);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.4);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
}

.tool-share {
  border-color: #e5e7eb !important;
}

.tool-share .btn {
  min-width: 112px;
}

/* Badges */
.badge {
  border-radius: 6px;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
}

.badge.bg-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #005a9e 100%) !important;
}

.badge.bg-secondary {
  background: #6c757d !important;
}

.badge.bg-accent {
  background-color: var(--color-accent) !important;
  color: white !important;
}

/* Forms */
.form-control, .form-select {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 120, 212, 0.1);
}

.form-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
  border: none;
  border-radius: 10px;
  border-left: 4px solid;
}

.alert-info {
  background: #E8F4FD;
  border-left-color: var(--color-primary);
  color: #005a9e;
}

.alert-warning {
  background: #fff3cd;
  border-left-color: #ffc107;
  color: #856404;
}

.alert-success {
  background: #d4edda;
  border-left-color: #28a745;
  color: #155724;
}

/* Tables */
.table {
  border-radius: 10px;
  overflow: hidden;
}

.table th {
  background: #f0f4f8;
  border: none;
  font-weight: 600;
  padding: 1rem;
}

.table td {
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: #333;
  font-weight: 700;
  margin-bottom: 0.875rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Hero section */
.hero, .hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.hero h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.95;
}

/* Product Ads */
.product-ad-card {
  border-left: 4px solid var(--color-accent-orange) !important;
  background: white;
}

.product-ad-logo {
  max-height: 64px;
  max-width: 100%;
  object-fit: contain;
}

.ad-label {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  letter-spacing: 0.5px;
}

.product-ad-cta {
  border: 1px solid #e0e0e0;
}

.product-ad-logo-cta {
  max-height: 32px;
  max-width: 100%;
  object-fit: contain;
}

.ad-label-cta {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.product-ad-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Featured Images */
article img.img-fluid,
.article-wrapper img.img-fluid {
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  width: 100%;
  height: auto;
}

/* MSN-style card variants */
.card.news-card {
  border-top: 3px solid var(--color-accent-orange);
}

.card.weather-card {
  border-top: 3px solid #8764b8;
}

.card.tool-card {
  border-top: 3px solid var(--color-accent-green);
}

.card.article-card {
  border-top: 3px solid var(--color-primary);
}

/* Sidebar styling */
.sidebar-widget {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-widget .card-title {
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.sidebar-widget h3 {
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

/* Article links in sidebar */
.sidebar-widget a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.sidebar-widget a:last-child {
  border-bottom: none;
}

.sidebar-widget a:hover {
  color: var(--color-primary);
  padding-left: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .navbar-logo { height: 40px; }

  .product-ad-cta .col-auto {
    flex-basis: 100% !important;
  }
}
