/* ==========================================
   DIZAJN SISTEM & VARIJABLE (Premium HSL)
   ========================================== */
:root {
  --font-family: 'Inter', sans-serif;
  
  --bg-app: hsl(222, 47%, 11%); /* Duboka ponoćna plava */
  --bg-card: hsla(223, 47%, 16%, 0.7); /* Poluprovidna staklena karta */
  --border-glass: hsla(223, 40%, 25%, 0.5);
  
  --primary: hsl(210, 100%, 56%); /* Električno plava */
  --primary-hover: hsl(210, 100%, 66%);
  --primary-glow: hsla(210, 100%, 56%, 0.3);
  
  --success: hsl(142, 72%, 43%); /* Smaragdno zelena */
  --success-hover: hsl(142, 72%, 53%);
  --success-glow: hsla(142, 72%, 43%, 0.3);
  
  --warning: hsl(38, 92%, 50%); /* Amber žuta */
  --error: hsl(350, 89%, 60%); /* Rubin crvena */
  
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 20%, 75%);
  --text-dark: hsl(222, 47%, 11%);
  
  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --radius-lg: 16px;
  --radius-md: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & BAZNI STILOVI
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

/* ==========================================
   APLIKATIVNI KONTEJNER (Mobilno-centriran)
   ========================================== */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ==========================================
   LOOC UČITAVANJE (LOADER)
   ========================================== */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-app);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.loader-container.hide {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid hsla(210, 100%, 56%, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================
   EKRANI (SCREENS)
   ========================================== */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  width: 100%;
  flex-direction: column;
  height: 100%;
  padding-bottom: 40px;
}
.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   1. LOGIN EKRAN
   ========================================== */
#login-section {
  justify-content: center;
  min-height: calc(100vh - 40px);
}
.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  padding: 30px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  text-align: center;
}
.logo-area {
  margin-bottom: 30px;
}
.logo-icon {
  font-size: 50px;
  margin-bottom: 10px;
  animation: bounce 2s infinite alternate;
}
@keyframes bounce {
  to { transform: translateY(-8px); }
}
.logo-area h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-area h1 span {
  color: var(--primary);
}
.logo-area p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ==========================================
   2. KONTROLNA TABLA (DASHBOARD)
   ========================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 25px 0;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 20px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  font-size: 28px;
  background: hsla(210, 100%, 56%, 0.15);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid hsla(210, 100%, 56%, 0.3);
}
.user-info h3 {
  font-size: 16px;
  font-weight: 600;
}
.user-info p {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.info-banner {
  background: hsla(210, 100%, 56%, 0.1);
  border: 1px solid hsla(210, 100%, 56%, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
}
.banner-icon {
  font-size: 16px;
}

.dashboard-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-main);
  text-align: center;
  margin-bottom: 20px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.dashboard-card.active-card {
  display: flex;
}
.card-icon {
  font-size: 45px;
}
.dashboard-card h2 {
  font-size: 20px;
  font-weight: 700;
}
.dashboard-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Stanje aktivne vožnje */
.status-trip-card {
  border-color: var(--success);
  position: relative;
  overflow: hidden;
}
.trip-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--success);
  color: var(--text-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.trip-summary-box {
  width: 100%;
  background: hsla(222, 47%, 11%, 0.6);
  border-radius: var(--radius-md);
  padding: 15px;
  text-align: left;
  border: 1px solid var(--border-glass);
}
.trip-summary-box p {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}
.trip-summary-box p:last-child {
  margin-bottom: 0;
}
.trip-summary-box p strong {
  color: var(--text-muted);
}
.pulse-text {
  font-size: 12px !important;
  color: var(--success) !important;
  font-weight: 500;
  animation: pulse 1.8s infinite alternate;
}
@keyframes pulse {
  to { opacity: 0.5; }
}

.secondary-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================
   FORME, DUGMAD & INPUTI
   ========================================== */
.screen-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 0 20px 0;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-glass);
}
.btn-back {
  background: hsla(222, 47%, 18%, 0.8);
  border: 1px solid var(--border-glass);
  font-size: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-main);
  cursor: pointer;
}

.step-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-step {
  display: none;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}
.form-step.active {
  display: flex;
}
.step-progress {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: -5px;
}
.step-progress .current {
  font-size: 14px;
}
.form-step h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-group.half {
  flex: 1;
}

label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  font-family: var(--font-family);
  background-color: hsla(222, 47%, 10%, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-main);
  font-size: 16px; /* Sprečava iOS auto-zoom */
  width: 100%;
  outline: none;
  transition: var(--transition);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-help {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

/* DUGMAD */
.btn {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
  width: 100%;
}
.btn-primary {
  background-color: var(--primary);
  color: var(--text-main);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:active {
  background-color: var(--primary-hover);
  transform: scale(0.98);
}
.btn-success {
  background-color: var(--success);
  color: var(--text-dark);
  font-weight: 700;
  box-shadow: 0 4px 12px var(--success-glow);
}
.btn-success:active {
  background-color: var(--success-hover);
  transform: scale(0.98);
}
.btn-secondary {
  background-color: hsla(222, 47%, 18%, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}
.btn-secondary:active {
  background-color: hsla(222, 47%, 24%, 0.8);
  transform: scale(0.98);
}
.btn-outline {
  background: transparent;
  border: 2px dashed var(--border-glass);
  color: var(--text-muted);
}
.btn-outline:active {
  background: hsla(222, 47%, 15%, 0.5);
  border-color: var(--primary);
  color: var(--text-main);
}
.btn-lg {
  padding: 18px 24px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}
.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  background: hsla(222, 47%, 18%, 0.8);
  border: 1px solid var(--border-glass);
  font-size: 18px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

/* ==========================================
   DVOSTRUKI PREKIDAČ (Radio Cards)
   ========================================== */
.radio-toggle-group {
  display: flex;
  gap: 12px;
  width: 100%;
}
.radio-option {
  flex: 1;
  cursor: pointer;
}
.radio-option input[type="radio"] {
  display: none;
}
.radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: hsla(222, 47%, 10%, 0.6);
  transition: var(--transition);
  text-align: center;
}
.radio-icon {
  font-size: 26px;
  margin-bottom: 6px;
}
.radio-label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text-main);
}
.radio-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.radio-option input[type="radio"]:checked + .radio-card {
  border-color: var(--primary);
  background: hsla(210, 100%, 56%, 0.1);
  box-shadow: 0 0 0 1px var(--primary);
}

/* ==========================================
   TRANZITNE DRŽAVE (ČIPOVI)
   ========================================== */
.transit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}
.chip {
  padding: 10px 14px;
  background: hsla(222, 47%, 16%, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.chip.active {
  background: var(--primary);
  color: var(--text-main);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--primary-glow);
}

/* ==========================================
   UPOZORENJA I ALERTI
   ========================================== */
.warning-alert {
  background: hsla(38, 92%, 50%, 0.1);
  border: 1.5px solid hsla(38, 92%, 50%, 0.3);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}
.alert-icon {
  font-size: 22px;
}
.alert-body h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 4px;
}
.alert-body p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================
   UOTPREMANJE GORIVA & FOTO
   ========================================== */
.camera-capture-box {
  width: 100%;
}
.image-preview {
  position: relative;
  margin-top: 15px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  max-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}
.image-preview img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}
.btn-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* ==========================================
   MODALNI DIJALOG
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-main);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon {
  font-size: 40px;
  margin-bottom: 15px;
}
.modal-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.modal-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* POMOĆNE KLASE */
.hide {
  display: none !important;
}
.error-msg {
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  margin-top: 5px;
  min-height: 18px;
}
