/* ==========================================================================
   Dugoročna Vremenska Prognoza Srbije — Glavni stilovi
   ========================================================================== */

:root {
  --color-primary: #1976D2;
  --color-primary-dark: #125499;
  --color-secondary: #4FC3F7;
  --color-accent: #FFC107;
  --color-bg: #F5F9FC;
  --color-text: #1A1A1A;
  --color-card-bg: rgba(255, 255, 255, 0.65);
  --color-card-border: rgba(255, 255, 255, 0.35);
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --gradient-hero: linear-gradient(135deg, #1565C0 0%, #1976D2 40%, #4FC3F7 100%);
  --shadow-soft: 0 10px 30px rgba(25, 118, 210, 0.12);
  --shadow-hover: 0 16px 40px rgba(25, 118, 210, 0.2);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 76px;
}

[data-theme="dark"] {
  --color-bg: #0E1621;
  --color-text: #EAF2FA;
  --color-card-bg: rgba(30, 41, 59, 0.65);
  --color-card-border: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

img { max-width: 100%; height: auto; }

.container-xl { max-width: 1320px; margin: 0 auto; padding: 0 1rem; }

/* ---------- Page loader ---------- */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--gradient-hero);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.loaded { opacity: 0; visibility: hidden; }
.loader-sun {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 40px 10px rgba(255, 193, 7, 0.6);
  animation: pulse-sun 1.2s ease-in-out infinite;
}
@keyframes pulse-sun {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-height);
  display: flex; align-items: center;
  background: rgba(245, 249, 252, 0.75);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(25, 118, 210, 0.08);
  transition: var(--transition);
}
[data-theme="dark"] .site-header {
  background: rgba(14, 22, 33, 0.75);
  border-bottom-color: rgba(255,255,255,0.06);
}
.site-header.scrolled { box-shadow: var(--shadow-soft); }

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.25rem; }
.brand i { color: var(--color-primary); font-size: 1.5rem; }
.brand span.accent { color: var(--color-accent); }

.main-nav { display: flex; align-items: center; gap: 1.75rem; }
.main-nav a {
  font-weight: 500; position: relative; padding: 0.4rem 0; color: var(--color-text);
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background: var(--gradient-primary); transition: width 0.3s ease;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.theme-toggle, .navbar-toggler-custom {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-card-bg); border: 1px solid var(--color-card-border);
  cursor: pointer; transition: var(--transition);
}
.theme-toggle:hover { transform: rotate(20deg); box-shadow: var(--shadow-soft); }

/* ---------- Buttons ---------- */
.btn-gradient {
  background: var(--gradient-primary);
  color: #fff; border: none; border-radius: 50px;
  padding: 0.75rem 1.75rem; font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.btn-gradient:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: #fff;
}
.btn-outline-custom {
  border: 2px solid var(--color-primary); color: var(--color-primary);
  border-radius: 50px; padding: 0.7rem 1.7rem; font-weight: 600;
  background: transparent; transition: var(--transition);
}
.btn-outline-custom:hover { background: var(--color-primary); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--gradient-hero);
  color: #fff;
  padding: 7rem 0 6rem;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18) 0, transparent 45%),
                     radial-gradient(circle at 85% 75%, rgba(255,255,255,0.14) 0, transparent 40%);
}
.hero h1 { font-weight: 800; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.15; }
.hero p.lead { font-size: 1.15rem; opacity: 0.92; }

/* Weather animated background layer */
.weather-bg-layer { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cloud {
  position: absolute; background: rgba(255,255,255,0.5); border-radius: 50%;
  filter: blur(2px); animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
@keyframes drift {
  from { transform: translateX(-15vw); }
  to { transform: translateX(115vw); }
}
.raindrop {
  position: absolute; width: 2px; height: 14px; background: rgba(255,255,255,0.5);
  border-radius: 2px; animation: fall linear infinite;
}
@keyframes fall {
  from { transform: translateY(-10vh); opacity: 0; }
  10% { opacity: 0.8; }
  to { transform: translateY(110vh); opacity: 0.2; }
}
.snowflake {
  position: absolute; color: rgba(255,255,255,0.85); animation: snowfall linear infinite;
}
@keyframes snowfall {
  from { transform: translateY(-10vh) rotate(0deg); }
  to { transform: translateY(110vh) rotate(360deg); }
}

/* ---------- Search ---------- */
.search-wrap { position: relative; max-width: 560px; margin: 2rem auto 0; }
.search-input-group {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.95); border-radius: 50px;
  padding: 0.4rem 0.4rem 0.4rem 1.4rem; box-shadow: var(--shadow-hover);
}
.search-input-group i { color: var(--color-primary); font-size: 1.1rem; }
.search-input-group input {
  border: none; outline: none; flex: 1; font-size: 1rem; padding: 0.6rem 0; background: transparent; color: #1A1A1A;
}
.search-input-group button {
  border: none; background: var(--gradient-primary); color: #fff;
  border-radius: 50px; padding: 0.7rem 1.5rem; font-weight: 600; transition: var(--transition);
}
.search-input-group button:hover { filter: brightness(1.08); }
.autocomplete-list {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-hover);
  overflow: hidden; z-index: 50; display: none; max-height: 320px; overflow-y: auto;
}
[data-theme="dark"] .autocomplete-list { background: #1E293B; }
.autocomplete-list.show { display: block; }
.autocomplete-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 1.2rem;
  cursor: pointer; color: var(--color-text); transition: background 0.15s ease;
}
.autocomplete-item:hover, .autocomplete-item.active { background: rgba(25,118,210,0.08); }
.autocomplete-item i { color: var(--color-secondary); }
.autocomplete-item small { color: #7a8a99; margin-left: auto; }

/* ---------- Section titles ---------- */
.section-pad { padding: 5rem 0; }
.section-title { font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.5rem; }
.section-sub { color: #5b6b7a; max-width: 640px; margin: 0 auto 3rem; }
[data-theme="dark"] .section-sub { color: #9fb2c3; }
.text-center-wrap { text-align: center; }

/* ---------- Glass cards ---------- */
.glass-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.glass-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

/* Popular city chip cards */
.city-chip {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.2rem; border-radius: var(--radius-md);
  background: var(--color-card-bg); border: 1px solid var(--color-card-border);
  backdrop-filter: blur(14px);
  transition: var(--transition);
}
.city-chip:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.city-chip .city-icon {
  width: 46px; height: 46px; border-radius: 50%; background: var(--gradient-primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.city-chip .city-temp { margin-left: auto; font-weight: 700; color: var(--color-primary); }

/* Weather forecast day card */
.weather-card {
  padding: 1.5rem 1.2rem; border-radius: var(--radius-lg); text-align: center;
  background: var(--color-card-bg); border: 1px solid var(--color-card-border);
  backdrop-filter: blur(18px);
  transition: var(--transition);
  height: 100%;
}
.weather-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-hover); }
.weather-card .day-name { font-weight: 700; text-transform: capitalize; margin-bottom: 0.3rem; }
.weather-card .day-date { font-size: 0.8rem; color: #7a8a99; margin-bottom: 0.8rem; }
.weather-card .weather-icon { font-size: 2.6rem; color: var(--color-primary); margin: 0.4rem 0; transition: transform 0.4s ease; }
.weather-card:hover .weather-icon { transform: scale(1.15) rotate(-4deg); }
.weather-card .temp-max { font-size: 1.4rem; font-weight: 800; }
.weather-card .temp-min { color: #7a8a99; font-weight: 500; margin-left: 0.4rem; }
.weather-card .meta-row {
  display: flex; justify-content: space-between; font-size: 0.8rem; color: #5b6b7a;
  margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed rgba(25,118,210,0.15);
}
[data-theme="dark"] .weather-card .meta-row { color: #9fb2c3; }

/* Current weather hero card */
.current-weather-card {
  border-radius: var(--radius-lg);
  background: var(--gradient-hero);
  color: #fff; padding: 2.5rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow-hover);
}
.current-weather-card .big-temp { font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 800; line-height: 1; }
.current-weather-card .big-icon { font-size: clamp(3.5rem, 7vw, 5.5rem); opacity: 0.95; }
.stat-pill {
  background: rgba(255,255,255,0.16); border-radius: var(--radius-sm);
  padding: 0.9rem 1rem; text-align: center; backdrop-filter: blur(6px);
}
.stat-pill i { font-size: 1.3rem; margin-bottom: 0.4rem; display: block; }
.stat-pill .stat-value { font-weight: 700; font-size: 1.05rem; }
.stat-pill .stat-label { font-size: 0.75rem; opacity: 0.85; }

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, rgba(25,118,210,0.08) 25%, rgba(25,118,210,0.16) 37%, rgba(25,118,210,0.08) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-card { height: 220px; }

/* FAQ accordion */
.accordion-item.glass-card { border: 1px solid var(--color-card-border); margin-bottom: 1rem; overflow: hidden; }
.accordion-button {
  background: transparent; color: var(--color-text); font-weight: 600; box-shadow: none !important;
}
.accordion-button:not(.collapsed) { background: rgba(25,118,210,0.06); color: var(--color-primary); }
.accordion-button::after { filter: hue-rotate(180deg); }
.accordion-body { color: #5b6b7a; }
[data-theme="dark"] .accordion-body { color: #9fb2c3; }

/* CTA */
.cta-section {
  background: var(--gradient-primary); border-radius: var(--radius-lg);
  color: #fff; padding: 3.5rem 2rem; text-align: center; position: relative; overflow: hidden;
}

/* Footer */
.site-footer { background: #0E1621; color: #cdd9e5; padding: 4rem 0 1.5rem; margin-top: 4rem; }
.site-footer h5 { color: #fff; font-weight: 700; margin-bottom: 1.2rem; }
.site-footer a { color: #a9bccf; transition: color 0.2s ease; }
.site-footer a:hover { color: var(--color-secondary); }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center; margin-right: 0.5rem;
  transition: var(--transition);
}
.footer-social a:hover { background: var(--gradient-primary); transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 2.5rem; padding-top: 1.5rem; font-size: 0.85rem; }

/* Back to top */
#back-to-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 900;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gradient-primary); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  box-shadow: var(--shadow-hover); opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: var(--transition);
}
#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { transform: translateY(-4px); }

/* Breadcrumb */
.breadcrumb-wrap { font-size: 0.9rem; padding: 1rem 0; color: #5b6b7a; }
[data-theme="dark"] .breadcrumb-wrap { color: #9fb2c3; }
.breadcrumb-wrap a { color: var(--color-primary); }

/* Chart containers */
.chart-card { padding: 1.5rem; border-radius: var(--radius-lg); }
.chart-container { position: relative; height: 300px; }

/* Nearby city links */
.tag-link {
  display: inline-block; padding: 0.5rem 1.1rem; border-radius: 50px;
  background: rgba(25,118,210,0.08); color: var(--color-primary); font-weight: 600;
  margin: 0.25rem; transition: var(--transition); font-size: 0.9rem;
}
.tag-link:hover { background: var(--gradient-primary); color: #fff; transform: translateY(-2px); }

/* Content article */
.article-content h2 { font-weight: 700; font-size: 1.5rem; margin-top: 2.2rem; }
.article-content h3 { font-weight: 700; font-size: 1.15rem; margin-top: 1.5rem; }
.article-content p { color: #3a4a59; line-height: 1.75; }
[data-theme="dark"] .article-content p { color: #c3d2e0; }

/* Table */
.table-weather { border-radius: var(--radius-md); overflow: hidden; }
.table-weather thead { background: var(--gradient-primary); color: #fff; }

/* Utility */
.fade-in-up { animation: fadeInUp 0.7s ease both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.badge-soft {
  background: rgba(255,193,7,0.18); color: #a06c00; border-radius: 50px;
  padding: 0.35rem 0.9rem; font-weight: 600; font-size: 0.8rem;
}
[data-theme="dark"] .badge-soft { color: var(--color-accent); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-secondary); border-radius: 10px; }
