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

/* ================================================================
   Google Ad Bars
   ================================================================ */
.ad-bar {
  background: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 10px;
  padding: 20px 14px;
  text-align: center;
  max-width: 520px;
  margin: 12px auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.ad-bar--bottom {
  margin-top: 1rem;
  margin-bottom: 12px;
}

.ad-bar .adsbygoogle {
  margin: 0 auto;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.ad-placeholder__label {
  font-size: 1rem;
  color: #888;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@media (max-width: 576px) {
  .ad-bar {
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
  }
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #BC6C25;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--vaal-bg-light);
  font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

main {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
}

/* ================================================================
   SIDEBAR NAVIGATION WITH AUTO-HIDE
   ================================================================ */

/* Top Brand Bar */
.top-brand-bar {
  background-color: var(--vaal-primary);
  color: white;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 998;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
}

.brand-logo {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo:hover {
  color: var(--vaal-accent);
}

.brand-text {
  font-family: 'Playfair Display', serif;
}

.menu-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--vaal-accent);
}

/* Sidebar Navigation */
.sidebar-nav {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background-color: var(--vaal-primary);
  color: white;
  padding-top: 0;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar-nav.active {
  transform: translateX(0);
}

/* Auto-hide on mouse leave */
@media (min-width: 992px) {
  .sidebar-nav:not(.active):hover {
    transform: translateX(0);
  }

  .sidebar-nav:not(.active):not(:hover) {
    transform: translateX(-100%);
  }
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  color: white;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Playfair Display', serif;
}

.sidebar-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease, transform 0.3s ease;
}

.sidebar-close:hover {
  color: var(--vaal-accent);
  transform: rotate(90deg);
}

/* Navigation Menu */
.nav-menu {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  color: white !important;
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white !important;
  border-left-color: var(--vaal-accent);
}

.nav-link i {
  min-width: 24px;
  text-align: center;
  font-size: 1.1rem;
}

.nav-link span {
  flex: 1;
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  border-left-color: var(--vaal-accent);
  font-weight: 600;
}

.nav-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 0.75rem 1rem;
}

.nav-section-title {
  padding: 0.5rem 1.25rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-section-title i {
  font-size: 0.875rem;
}

.user-link {
  font-weight: 500;
  color: white !important;
}

.logout-link {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: white !important;
}

.logout-link:hover {
  color: white !important;
}

.nav-form {
  padding: 0;
  margin: 0;
}

.signup-link {
  background-color: var(--vaal-accent);
  border-left-color: var(--vaal-accent);
  font-weight: 600;
  color: white !important;
}

.signup-link:hover {
  background-color: var(--vaal-secondary);
  color: white !important;
}

/* Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  z-index: 1000;
  transition: background-color 0.3s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* Main Content */
.main-content {
  flex: 1;
}

/* Responsive Design */
@media (max-width: 991px) {
  .sidebar-nav {
    width: 250px;
  }

  .sidebar-nav:not(.active):not(:hover) {
    transform: translateX(-100%);
  }
}

@media (max-width: 576px) {
  .sidebar-nav {
    width: 100%;
    max-width: 280px;
  }

  .brand-text {
    display: none;
  }
}

/* Links in body content */
a {
  color: var(--vaal-primary);
  transition: color 0.3s ease;
}

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

/* Headings - ensure Playfair Display is used */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  color: var(--vaal-text-dark);
  font-weight: 700;
}

/* Paragraphs */
p {
  color: var(--vaal-text-light);
  line-height: 1.8;
}

/* Code blocks and pre */
code, pre {
  background-color: var(--vaal-bg-lighter);
  border: 1px solid var(--vaal-border);
  border-radius: 6px;
  color: var(--vaal-text-dark);
}

/* Tables */
.table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border-top: 4px solid var(--vaal-primary);
}

.table thead th {
  background: linear-gradient(135deg, var(--vaal-secondary) 0%, var(--vaal-secondary-light) 100%);
  border: none;
  font-weight: 600;
  color: white;
  padding: 1rem;
}

.table tbody tr {
  border-bottom: 1px solid var(--vaal-border);
}

.table tbody tr:hover {
  background-color: var(--vaal-bg-lighter);
}

/* List styling */
.list-group-item {
  border-color: var(--vaal-border);
  background-color: white;
}

.list-group-item:hover {
  background-color: var(--vaal-bg-lighter);
}

.list-group-item.active {
  background-color: var(--vaal-primary);
  border-color: var(--vaal-primary);
}

/* HR lines */
hr {
  border-color: var(--vaal-border);
  opacity: 1;
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--vaal-primary) 0%, var(--vaal-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

.shadow-lg {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.rounded-lg {
  border-radius: 8px;
}

/* Divider/separator styles */
.divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--vaal-border);
  z-index: 0;
}

.divider span {
  background: var(--vaal-bg-light);
  padding: 0 1rem;
  position: relative;
  z-index: 1;
  color: var(--vaal-text-light);
}

/* Loading animations */
.spinner-border {
  color: var(--vaal-primary);
}

.spinner-grow {
  background-color: var(--vaal-primary);
}

/* Emphasis blocks */
.highlight {
  background-color: var(--vaal-accent-light);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--vaal-text-dark);
  font-weight: 500;
}

/* Quote styles */
blockquote {
  border-left: 4px solid var(--vaal-primary);
  padding-left: 1.5rem;
  margin-left: 0;
  color: var(--vaal-text-light);
  font-style: italic;
}

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .hero-section {
    height: 400px !important;
  }
  
  .hero-content h1 {
    font-size: 1.8rem !important;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .service-card {
    margin-bottom: 1rem;
  }
  
  .container {
    padding: 0 1rem;
  }
}

/* Clickable service cards */
a.service-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

a.service-card-link:hover,
a.service-card-link:focus {
  text-decoration: none;
  color: inherit;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

a.service-card-link:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

a.service-card-link .card-title {
  color: var(--vaal-primary, #283618);
}

a.service-card-link:hover .card-title {
  color: var(--vaal-accent, #BC6C25);
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 1.5rem !important;
  }
  
  .hero-content p {
    font-size: 1rem !important;
  }
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus states for keyboard navigation */
a:focus, button:focus, input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--vaal-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  body {
    color: var(--vaal-text-dark);
  }
  
  a {
    text-decoration: underline;
  }
  
  .card {
    border: 2px solid var(--vaal-text-dark);
  }
}

/* Print styles */
@media print {
  body {
    background-color: white;
  }
  
  header, footer, .no-print {
    display: none;
  }
  
  main {
    min-height: auto;
    padding: 0;
  }
}
