/* ============================================================
   ROOT VARIABLES & BASE TOKENS
   ============================================================ */
:root {
  --theme-color: #f65314;
  --header-gradient-start: #ff6016;
  --header-gradient-end: #ff823a;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #eaeaea;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.11);
  --transition-speed: 0.3s;
  --font-telugu: "Noto Sans Telugu", "Helvetica Neue", Arial, sans-serif;
  --font-english: "Helvetica Neue", Arial, sans-serif;
  --icon-size-base: 24px;

  /* Added for gradient buttons */
  --theme-color-dark: #e55a15;
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */
html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  box-sizing: border-box;
  font-family: var(--font-telugu);
}

body {
  padding-top: 1rem;
  color: var(--text-dark);
  line-height: 1.6;
}

.page-wrapper {
  padding: 0 0.5%;
}

.text-theme {
  color: var(--theme-color) !important;
}

.btn-theme {
  background: var(--theme-color) !important;
  color: #fff !important;
  border: none;
  transition: var(--transition-speed);
}

.btn-theme:hover {
  background: #d8430c !important;
  transform: translateY(-1px);
}

/* ============================================================
   ICON UTILITIES
   ============================================================ */
.ve-icon {
  width: var(--icon-size-base);
  height: var(--icon-size-base);
  vertical-align: middle;
}

.ve-icon-12 { width: 12px; height: 12px; }
.ve-icon-16 { width: 16px; height: 16px; }
.ve-icon-20 { width: 20px; height: 20px; }
.ve-icon-24 { width: 24px; height: 24px; }
.ve-icon-28 { width: 28px; height: 28px; }
.ve-icon-32 { width: 32px; height: 32px; }
.ve-icon-36 { width: 36px; height: 36px; }
.ve-icon-mr-2 { margin-right: 2px; }
.ve-icon-mr-4 { margin-right: 4px; }
.ve-icon-mr-6 { margin-right: 6px; }

.ve-hidden {
  display: none !important;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: linear-gradient(90deg, var(--header-gradient-start), var(--header-gradient-end));
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition-speed);
  z-index: 1040;
}

.site-header.scrolled {
  background: linear-gradient(90deg, #e65314, #ff6016);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 0.3rem 1rem;
}

.fixed-top {
  position: fixed;
  top: 0; left: 0; right: 0;
}

/* Logo */
.site-logo-link {
  display: inline-block;
  transition: var(--transition-speed);
}

.site-logo {
  transform-origin: top left;
  transition: transform 0.2s ease;
  object-fit: contain;
  background: rgba(255,255,255,0.95);
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-speed);
}

.site-header.scrolled .site-logo {
  transform: scale(0.85);
}

/* Tagline */
.site-tagline {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.4rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
.main-content {
  background: #fff;
  border-radius: 0.8rem;
  padding: 2.2rem 1.5rem;
  margin-top: 120px;
  box-shadow: 0 2px 16px rgba(90, 70, 30, 0.08);
}

/* Page heading */
h2.text-theme {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
}

h2.text-theme small {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ============================================================
   CATEGORY CARDS (Home + Category List)
   ============================================================ */
.ve-cat-card {
  min-height: 380px; /* restored original height look */
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: #fff;
  transition: var(--transition-speed);
  box-shadow: var(--shadow-sm);
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: 380px auto;
}

.ve-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== 4:3 Aspect Ratio (No CLS) ===== */
.ve-cat-img-container {
  width: 100%;
  aspect-ratio: 4 / 3;     /* HERO FIX */
  height: auto;            /* allow ratio to determine height */
  overflow: hidden;
  border-radius: 12px;
  background: #f2f2f2;
  position: relative;
  flex-shrink: 0;
}

.ve-cat-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  will-change: opacity;
  background: #f0f0f0;
  transition: opacity 0.25s ease-out;
  opacity: 0;
}

.ve-cat-img-loaded {
  opacity: 1;
}

.ve-cat-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
}

/* Titles and text */
.ve-cat-title {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  margin: 0.25rem 0;
  color: var(--text-dark);
  min-height: 24px; /* avoids jump when Telugu wraps */
}

/* Workers count */
.category-workers {
  font-size: 17px;
  font-weight: 600;
}

/* ============================================================
   PROVIDER BADGE COLORS (MISSING EARLIER)
   ============================================================ */
.provider-zero {
  background: #ffe5e5 !important;
  color: #c62828 !important;
}

.provider-low {
  background: #fff7d6 !important;
  color: #a67a00 !important;
}

.provider-high {
  background: #e0f6e9 !important;
  color: #1b8a3d !important;
}

/* ============================================================
   DESCRIPTION LINK FIX
   ============================================================ */
.category-description-link,
.ve-cat-desc-link {
  color: var(--theme-color);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.category-description-link:hover,
.ve-cat-desc-link:hover {
  text-decoration: underline;
}

/* ============================================================
   TOOLTIP FIX — ADD SCROLL CONTAINER
   ============================================================ */
/* ===== Tooltip Stable: No CLS ===== */
.ve-cat-tooltip {
  position: absolute;
  inset: 0;
  aspect-ratio: 4 / 3;                 /* Matches image shape */
  contain: strict;                     /* Prevents layout reflow */
  contain-intrinsic-size: 160px 120px; /* Reserve space */
  background: rgba(0,0,0,0.92);
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  z-index: 9999;

  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Scrollable content */
.ve-cat-tooltip-content {
  height: 100%;
  overflow-y: auto;
  padding-right: 6px;
}

.ve-cat-tooltip-visible {
  opacity: 1;
  transform: scale(1);
}

/* Scrollbar style */
.ve-cat-tooltip-content::-webkit-scrollbar { width: 6px; }
.ve-cat-tooltip-content::-webkit-scrollbar-thumb {
  background: #777;
  border-radius: 8px;
}

/* ============================================================
   RESTORED ORIGINAL BUTTON STYLE (GRADIENT)
   ============================================================ */
.ve-cat-btn,
.category-card .btn,
.btn-primary {
  background: linear-gradient(135deg, var(--theme-color), var(--theme-color-dark)) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.ve-cat-btn:hover,
.category-card .btn:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--theme-color-dark), var(--theme-color)) !important;
  transform: translateY(-1px);
}

.ve-cat-btn-disabled {
  background: #ccc !important;
  color: #fff !important;
  cursor: not-allowed;
}

/* Card footer spacing */
.card-footer {
  background: #fff !important;
  padding-top: 0.4rem !important;
  padding-bottom: 1rem !important;
}

/* ============================================================
   ALERTS + STATUS MESSAGES
   ============================================================ */
.alert {
  border-radius: 0.5rem;
  font-family: var(--font-telugu);
}

.alert-warning {
  background: #fff4e5;
  color: #a65a00;
  border: 1px solid #ffe0b2;
}

.alert-danger {
  background: #ffe5e5;
  color: #c62828;
  border: 1px solid #ffb3b3;
}

#loading p,
#no-results,
#error-alert {
  font-family: var(--font-telugu);
  font-weight: 600;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-bg {
  background: linear-gradient(90deg, var(--header-gradient-start), var(--header-gradient-end));
  color: #fff;
  padding-top: 1rem;
}

.footer-heading {
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-link {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-link:hover {
  color: #ffe0d6;
  border-bottom-color: #ffe0d6;
}

.footer-social {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.footer-social-link {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-speed);
}

.footer-social-link:hover {
  background: #fff;
  color: var(--theme-color);
  transform: translateY(-3px) scale(1.1);
}

/* Bottom strip */
.footer-bottom {
  background: rgba(0,0,0,0.2);
  padding: 0.7rem 0;
  font-size: 0.95rem;
  font-weight: 600;
}

/* App download buttons */
.btn-footer-app {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  align-items: center;
}

.btn-footer-app:hover {
  background: #ffffff;
  color: var(--theme-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Footer bottom links */
.footer-bottom-link {
  color: #ffffff;
  cursor: pointer;
  transition: color var(--transition-speed) ease;
}

/* ============================================================
   PROVIDER DETAILS PAGE
   ============================================================ */
.provider-photo-container {
  max-width: 300px;
  margin: 0 auto;
}

.detail-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
}

.review-card {
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 12px;
  transition: var(--transition-speed);
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.review-comment {
  font-family: var(--font-telugu);
  color: var(--text-dark);
}

.star-rating-input .star {
  cursor: pointer;
  transition: 0.2s ease;
}
.star-rating-input .star:hover {
  transform: scale(1.1);
}

.helpful-btn {
  font-family: var(--font-telugu);
  transition: 0.2s ease;
}
.helpful-btn:hover {
  transform: translateY(-1px);
}

.helpful-count {
  font-weight: 600;
}

.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--theme-color);
  outline-offset: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   RESPONSIVE (Updated: transform-scale instead of resizing logo)
   ============================================================ */

@media (max-width: 767px) {

  /* Base size for mobile */
  .site-logo {
    height: 60px;
    width: auto;
    transform-origin: top left;
    transition: transform 0.25s ease;
    transform: scale(0.80); /* 160px → approx 128px */
  }

  /* Scrolled: shrink smoothly */
  .site-header.scrolled .site-logo {
    transform: scale(0.72); /* 150px → approx 108px */
  }

  .main-content {
    margin-top: 110px;
    padding: 1.5rem 1rem;
  }

  .ve-cat-card {
    min-height: 350px;
  }
}

@media (max-width: 576px) {

  /* Slightly smaller on very small screens */
  .site-logo {
    transform: scale(0.70); /* ~150px → 105px approx */
  }

  .site-header.scrolled .site-logo {
    transform: scale(0.63); /* ~140px → 90px approx */
  }
}

