/* 🎨 X-Power Mobil Kliens Design Rendszer - Közös Stílusok */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-speed: 0.3s;
  --transition-bezier: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 🌙 Sötét mód változók (Alapértelmezett) */
[data-theme="dark"] {
  --bg-color: #101418;
  --bg-gradient: linear-gradient(135deg, #101418 0%, #161d21 100%);
  --panel-bg: rgba(22, 29, 33, 0.7);
  --panel-bg-solid: #161d21;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #ecf0f1;
  --text-muted: #9ca3af;
  
  --accent-gradient: linear-gradient(135deg, #3D78A8 0%, #2c3e50 100%);
  --accent-color: #3D78A8;
  --accent-light: rgba(61, 120, 168, 0.15);
  
  --stock-avail-color: #74c69d;
  --stock-res-color: #ff8787;
  --price-color: #ffffff;
  --search-icon-color: rgba(255, 255, 255, 0.7);
  
  --cash-color: #10b981;
  --cash-bg: rgba(16, 185, 129, 0.12);
  --cash-glow: rgba(16, 185, 129, 0.2);
  
  --card-color: #3D78A8;
  --card-bg: rgba(61, 120, 168, 0.12);
  --card-glow: rgba(61, 120, 168, 0.2);

  --danger-color: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  
  --input-bg: rgba(17, 24, 39, 0.6);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --drawer-bg: #111827;
  --header-bg: rgba(16, 20, 24, 0.85);
  
  --glass-glow: 0 0 15px rgba(61, 120, 168, 0.1);
}

/* ☀️ Világos mód változók */
[data-theme="light"] {
  --bg-color: #f3f4f6;
  --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  --panel-bg: rgba(255, 255, 255, 0.85);
  --panel-bg-solid: #ffffff;
  --border-color: rgba(0, 0, 0, 0.06);
  --text-main: #1f2937;
  --text-muted: #6b7280;
  
  --accent-gradient: linear-gradient(135deg, #3D78A8 0%, #2c3e50 100%);
  --accent-color: #3D78A8;
  --accent-light: rgba(61, 120, 168, 0.1);
  
  --stock-avail-color: #2d6a4f;
  --stock-res-color: #c0392b;
  --price-color: var(--text-main);
  --search-icon-color: var(--text-muted);
  
  --cash-color: #059669;
  --cash-bg: rgba(5, 150, 105, 0.1);
  --cash-glow: rgba(5, 150, 105, 0.05);
  
  --card-color: #2c3e50;
  --card-bg: rgba(44, 62, 80, 0.08);
  --card-glow: rgba(44, 62, 80, 0.05);

  --danger-color: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  
  --input-bg: #ffffff;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --drawer-bg: #ffffff;
  --header-bg: rgba(243, 244, 246, 0.85);
  
  --glass-glow: none;
}

/* 🌐 Alapbeállítások */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background var(--transition-speed) var(--transition-bezier), color var(--transition-speed) var(--transition-bezier);
}

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

/* 🔒 LOGIN PANEL STYLING */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.login-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg), var(--glass-glow);
  text-align: center;
  transition: all var(--transition-speed) var(--transition-bezier);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.login-logo-icon {
  font-size: 28px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-logo-text {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.5px;
}

.login-logo-text .power {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 25px;
  font-weight: 500;
}

/* PIN indikátor golyók */
.pin-indicators {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 30px 0;
}

.pin-indicators .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-indicators .dot.filled {
  background: var(--accent-gradient);
  border-color: transparent;
  transform: scale(1.3);
  box-shadow: 0 0 12px var(--accent-color);
}

/* PIN-pad billentyűzet */
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s var(--transition-bezier);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.pin-btn:hover {
  background: var(--panel-bg-solid);
  border-color: var(--text-muted);
}

.pin-btn:active {
  transform: scale(0.88);
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 15px var(--accent-color);
}

.pin-btn.empty-btn {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

.pin-btn.back-btn {
  font-size: 20px;
  color: var(--text-muted);
}

.pin-btn.back-btn:active {
  background: var(--danger-bg);
  color: var(--danger-color);
  border-color: transparent;
  box-shadow: none;
}

/* Hiba visszajelzés */
.error-message {
  color: var(--danger-color);
  font-size: 13px;
  margin-top: 15px;
  min-height: 20px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.error-message.show {
  opacity: 1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.login-card.shake {
  animation: shake 0.4s var(--transition-bezier);
}

/* 📱 STICKY HEADER STYLING */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  transition: background var(--transition-speed), border-color var(--transition-speed);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-logo .logo-xp {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 22px;
  color: var(--text-main);
}

.header-logo .logo-power {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 22px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 4 főmenü ikon középen */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-main);
  transition: all 0.2s var(--transition-bezier);
  border: 1px solid transparent;
}

.nav-item:active {
  transform: scale(0.9);
}

.nav-item.active {
  color: #ffffff;
  background: var(--accent-gradient);
  box-shadow: 0 4px 12px var(--accent-light);
}

.nav-item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Hamburger gomb jobbra */
.menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--transition-bezier);
}

.menu-toggle:active {
  transform: scale(0.9);
  background: var(--border-color);
}

/* 🍔 HAMBURGER SIDE DRAWER */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--transition-bezier);
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  color: #1f2937;
}

.drawer.open {
  right: 0;
}

/* Drawer Header */
.drawer-header {
  padding: 30px 24px 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.drawer-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
}

.drawer-close-btn:active {
  background: rgba(0, 0, 0, 0.05);
  color: #1f2937;
}

.drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.1);
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
}

.drawer-username {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
  color: #1f2937;
}

.drawer-role {
  font-size: 12px;
  color: #6b7280;
}

/* Drawer Menus */
.drawer-menu-list {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-menu-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 10px;
}

.drawer-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  transition: all 0.15s ease;
}

.drawer-menu-item:active {
  background: rgba(0, 0, 0, 0.04);
}

.drawer-menu-item i {
  font-size: 16px;
  color: #6b7280;
  width: 20px;
  text-align: center;
}

/* Kosár tartalma panel */
.drawer-cart-box {
  margin: 10px 14px;
  padding: 16px;
  background: #f3f4f6;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.cart-title span {
  font-family: var(--font-title);
}

.cart-badge {
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.cart-empty {
  text-align: center;
  color: #6b7280;
  font-size: 12px;
  padding: 10px 0;
}

/* Téma váltó a menüben */
.drawer-theme-box {
  margin: 10px 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.theme-label i {
  font-size: 16px;
  color: #3D78A8;
}

/* iOS stílusú csúszka */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: .3s var(--transition-bezier);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s var(--transition-bezier);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background: var(--accent-gradient);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.drawer-footer {
  margin-top: auto;
  padding: 20px 14px 30px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  width: 100%;
  border: none;
  cursor: pointer;
}

.logout-btn:active {
  transform: scale(0.98);
  opacity: 0.8;
}

/* 🔄 LOADING SPINNER OVERLAY */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loader-overlay.show {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 🔔 TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #1f2937;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 10002;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast i {
  font-size: 16px;
}

.toast.success i {
  color: #059669;
}

.toast.error i {
  color: #dc2626;
}
