/* ==========================================================================
   VAL DI FIEMME 26/27 - CORE DESIGN SYSTEM & THEME
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Dolomites Alpine Palette */
  --bg-deep: #060913;
  --bg-surface: #0c1424;
  --bg-surface-light: #131d34;
  --bg-glass: rgba(14, 23, 42, 0.72);
  --bg-glass-hover: rgba(22, 36, 65, 0.85);
  --bg-card: rgba(18, 29, 52, 0.8);
  
  --primary: #38bdf8;
  --primary-light: #7dd3fc;
  --primary-dark: #0284c7;
  --primary-glow: rgba(56, 189, 248, 0.25);
  
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.2);
  --emerald: #10b981;
  --rose: #f43f5e;
  --indigo: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(56, 189, 248, 0.4);
  --border-glass: rgba(255, 255, 255, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 35px var(--primary-glow);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Alpine Ambient Background Glows */
body::before {
  content: '';
  position: fixed;
  top: -15%;
  left: 20%;
  width: 65vw;
  height: 55vh;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.06) 50%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: 5%;
  right: -5%;
  width: 50vw;
  height: 45vh;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.08) 0%, rgba(14, 165, 233, 0.05) 50%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Navigation Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: transform var(--transition-bounce);
}

.brand-badge:hover .brand-logo-icon {
  transform: scale(1.06) rotate(-2deg);
}

.brand-logo-icon img {
  width: 28px;
  height: 28px;
}

.brand-text-block h1 {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-season-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  color: #fff;
  letter-spacing: 0.8px;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Header Controls (Tabs & Language) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-tabs {
  display: flex;
  background: rgba(10, 16, 30, 0.7);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.nav-tab-btn.active {
  background: var(--primary);
  color: #060913;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

.nav-tab-btn:not(.active):hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab-badge {
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.nav-tab-btn.active .nav-tab-badge {
  background: rgba(6, 9, 19, 0.3);
  color: #060913;
}

/* Language Selector */
.lang-selector {
  display: flex;
  background: rgba(10, 16, 30, 0.7);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.lang-btn {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Hero Panoramic Banner */
.hero-banner {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 30px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  filter: brightness(0.85);
  transition: transform 1.2s ease-out;
}

.hero-banner:hover .hero-banner-img {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 9, 19, 0.2) 0%,
    rgba(8, 14, 28, 0.6) 50%,
    rgba(7, 11, 20, 0.95) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 32px;
}

.hero-badge-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--primary-light);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  backdrop-filter: blur(10px);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.hero-desc {
  font-size: 0.95rem;
  color: #e2e8f0;
  max-width: 650px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Main Content Grid */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-light);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 0.88rem;
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-success {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(16px);
}

.toast.toast-error {
  border-color: var(--rose);
  background: rgba(244, 63, 94, 0.15);
  backdrop-filter: blur(16px);
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex-grow: 1;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive Breakpoints */

a.nav-tab-btn {
  text-decoration: none;
}

/* Landing page */
.hero-banner.hero-landing {
  height: 280px;
}

.landing-lead {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 16px;
  letter-spacing: 0.2px;
}

.landing-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.landing-highlight {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  backdrop-filter: blur(16px);
}

.landing-highlight h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.landing-highlight p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.landing-actions {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 16px;
}

.landing-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 26px 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  transition: transform var(--transition-bounce), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.landing-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-bright);
  box-shadow: var(--shadow-glow);
}

.landing-card-primary {
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.18), rgba(18, 29, 52, 0.9));
  border-color: rgba(56, 189, 248, 0.4);
}

.landing-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.landing-card h3 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

.landing-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.landing-card-arrow {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-light);
}

/* Instructions / Upute */
.guide-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  margin-bottom: 16px;
}

.guide-card h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.guide-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.guide-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.page-main {
  display: block;
}

.prijava-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 6px;
  backdrop-filter: blur(16px);
}

.prijava-mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.prijava-mode-btn.active {
  background: var(--primary);
  color: #060913;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

.edit-lookup-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  margin-bottom: 16px;
  backdrop-filter: blur(16px);
}

.edit-lookup-card.open {
  display: block;
}

.edit-loaded-banner {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.84rem;
  font-weight: 600;
}

.edit-loaded-banner.open {
  display: block;
}

.trofej-panel {
  display: none;
}

.trofej-panel.open {
  display: block;
}

.trofej-panel.open .wizard-step-body {
  display: block;
}

.wizard-card .edit-lookup-card.open {
  display: block;
  margin-bottom: 22px;
  background: rgba(6, 9, 19, 0.4);
}

.trofej-panel .edit-lookup-card {
  display: block;
  background: rgba(6, 9, 19, 0.4);
}

.trofej-success {
  display: none;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #d1fae5;
}

.trofej-success.open {
  display: block;
}

.trofej-success strong {
  color: #fff;
  font-size: 1.2rem;
}

@media (max-width: 840px) {
  .app-container {
    padding: 14px 12px 60px;
  }
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }
  .header-actions {
    justify-content: space-between;
  }
  .hero-banner {
    height: 190px;
  }
  .hero-banner.hero-landing {
    height: 210px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-overlay {
    padding: 18px;
  }
  .landing-highlights,
  .landing-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .nav-tabs {
    flex-wrap: wrap;
    flex-grow: 1;
  }
  .nav-tab-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}
