/* ============================================
   IoTConnect - Unified Design System
   Világos és Sötét téma támogatással + MOBIL OPTIMALIZÁLÁS
   ============================================ */

/* ============================================
   SÖTÉT TÉMA (alapértelmezett)
   ============================================ */
:root {
  /* Fő színek - Logo alapú paletta */
  --primary: #5b8fa3;
  --primary-dark: #4a7489;
  --primary-light: #7babc0;
  --primary-glow: rgba(91, 143, 163, 0.25);
  
  --secondary: #6d6d6d;
  --secondary-dark: #4a4a4a;
  --secondary-light: #8f8f8f;
  
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.3);
  
  /* Háttér színek */
  --bg-primary: #0a0e17;
  --bg-secondary: #131824;
  --bg-tertiary: #1a2332;
  --bg-card: rgba(26, 35, 50, 0.8);
  --bg-card-hover: rgba(26, 35, 50, 0.95);
  
  /* Felületi elemek */
  --surface: rgba(91, 143, 163, 0.08);
  --surface-hover: rgba(91, 143, 163, 0.15);
  --border: rgba(91, 143, 163, 0.2);
  --border-light: rgba(91, 143, 163, 0.1);
  
  /* Szöveg színek */
  --text-primary: #e8f0f4;
  --text-secondary: #a8c5d4;
  --text-muted: #7a9aab;
  
  /* Státusz színek */
  --success: #00f5a0;
  --warning: #ffd60a;
  --danger: #ff006e;
  --info: #00d4ff;
  
  /* Árnyékok */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  /* Animációk */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Görbületek */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
}

/* ============================================
   VILÁGOS TÉMA
   ============================================ */
[data-theme="light"] {
  /* Fő színek */
  --primary: #4a7489;
  --primary-dark: #3a5f73;
  --primary-light: #5b8fa3;
  --primary-glow: rgba(74, 116, 137, 0.25);
  
  --secondary: #6d6d6d;
  --secondary-dark: #4a4a4a;
  --secondary-light: #8f8f8f;
  
  --accent: #0099cc;
  --accent-glow: rgba(0, 153, 204, 0.3);
  
  /* Háttér színek */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8ecf1;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: rgba(255, 255, 255, 1);
  
  /* Felületi elemek */
  --surface: rgba(74, 116, 137, 0.08);
  --surface-hover: rgba(74, 116, 137, 0.15);
  --border: rgba(74, 116, 137, 0.2);
  --border-light: rgba(74, 116, 137, 0.1);
  
  /* Szöveg színek */
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  /* Státusz színek */
  --success: #00c853;
  --warning: #ffa000;
  --danger: #d32f2f;
  --info: #0099cc;
  
  /* Árnyékok */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.16);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

/* ============================================
   Alapvető Reset és Typography
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Prevent horizontal overflow */
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
  /* Fix for mobile viewport */
  width: 100%;
  max-width: 100vw;
}

/* Futurisztikus háttér minta */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, var(--primary-glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.3s ease;
}

[data-theme="light"] body::before {
  opacity: 0.3;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(0deg, rgba(91, 143, 163, 0.03) 0px, transparent 1px, transparent 2px, rgba(91, 143, 163, 0.03) 3px),
    repeating-linear-gradient(90deg, rgba(91, 143, 163, 0.03) 0px, transparent 1px, transparent 2px, rgba(91, 143, 163, 0.03) 3px);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  /* Prevent text overflow on mobile */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* ============================================
   LOGIN PAGE - Szép bejelentkezési oldal
   ============================================ */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.login-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 0;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}

.bg-shape.shape-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.bg-shape.shape-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -5%;
  right: -5%;
  animation-delay: -5s;
}

.bg-shape.shape-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.login-container {
  width: 100%;
  max-width: 450px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.6s ease-out;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.logo-image {
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

.login-header h1 {
  font-size: 1.75rem;
  margin: 0;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Message Container */
#messageContainer {
  margin-bottom: 1.5rem;
}

.message {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  animation: slideInDown 0.3s ease-out;
  word-wrap: break-word;
}

.message-error {
  background: rgba(255, 0, 110, 0.1);
  border: 1px solid rgba(255, 0, 110, 0.3);
  color: var(--danger);
}

.message-success {
  background: rgba(0, 245, 160, 0.1);
  border: 1px solid rgba(0, 245, 160, 0.3);
  color: var(--success);
}

@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.input-wrapper {
  position: relative;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-base);
  /* Prevent zoom on iOS */
  font-size: 16px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-hover);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-control.error {
  border-color: var(--danger);
  background: rgba(255, 0, 110, 0.05);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.6;
  transition: opacity var(--transition-base);
  padding: 0.5rem;
  /* Better touch target */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  opacity: 1;
}

/* Remember Me Checkbox */
.remember-group {
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  /* Better touch target */
  padding: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  margin-right: 0.75rem;
  position: relative;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.checkbox-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Login Button */
.btn-login {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--primary-glow);
  /* Better touch target */
  min-height: 48px;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
  width: 400px;
  height: 400px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-login .loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Login Footer */
.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.login-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================
   Témaváltó Gomb
   ============================================ */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.theme-toggle-slider {
  width: 22px;
  height: 22px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle-slider {
  transform: translateX(30px);
}

.theme-icon {
  font-size: 0.875rem;
}

/* ============================================
   Navbar - Egységes Design + MOBIL
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--primary) 50%, 
    transparent 100%);
  opacity: 0.5;
}

.navbar-content,
.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* Hamburgeres menü gomb */
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  /* Better touch target */
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
}

.hamburger-btn span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-base);
  border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Brand - egységes minden oldalon */
.navbar-brand,
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.navbar-brand:hover,
.nav-brand:hover {
  transform: translateY(-2px);
}

.brand-logo,
.logo-icon {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 0 8px var(--primary-glow));
  transition: filter var(--transition-base);
}

[data-theme="light"] .brand-logo,
[data-theme="light"] .logo-icon {
  filter: drop-shadow(0 0 4px var(--primary-glow));
}

.navbar-brand:hover .brand-logo,
.nav-brand:hover .logo-icon {
  filter: drop-shadow(0 0 16px var(--primary-glow));
}

/* Navbar menü - egységes */
.navbar-menu,
.nav-menu {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
}

.nav-menu {
  padding: 0;
}

.nav-menu li {
  list-style: none;
}

.nav-link,
.nav-menu a {
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: inline-block;
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-link::before,
.nav-menu a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
  z-index: -1;
}

.nav-link:hover::before,
.nav-menu a:hover::before {
  transform: scaleX(1);
}

.nav-link:hover,
.nav-menu a:hover {
  color: var(--text-primary);
}

.nav-link.active,
.nav-menu a.active {
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Navbar actions - egységes */
.navbar-actions,
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Desktop only - logout button in navbar */
.navbar-actions .btn-logout {
  display: inline-flex;
}

/* Hide on tablet/mobile - available in hamburger menu instead */
@media (max-width: 968px) {
  .navbar-actions .btn-logout {
    display: none !important;
  }
}

/* Mobile menü overlay */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile sidebar */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  z-index: 1000;
  transition: left var(--transition-base);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

[data-theme="light"] .mobile-sidebar {
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
}

.mobile-sidebar.active {
  left: 0;
}

/* ============================================
   Gombok - Holografikus stílus + MOBIL
   ============================================ */
.btn,
button[class*="btn-"] {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  /* Better touch targets */
  min-height: 44px;
  touch-action: manipulation;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #c9004d 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 0, 110, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 0, 110, 0.4);
}

.btn-logout,
.btn-logout-sidebar {
  background: rgba(255, 0, 110, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 0, 110, 0.3);
  white-space: nowrap;
}

.btn-logout:hover,
.btn-logout-sidebar:hover {
  background: rgba(255, 0, 110, 0.2);
  border-color: var(--danger);
}

/* ============================================
   Container és Layout + MOBIL
   ============================================ */
.container,
.devices-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Page Header - egységes + MOBIL */
.page-header,
.devices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header::before,
.devices-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
}

.page-header h1,
.devices-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.page-header p,
.devices-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.header-actions,
.header-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================
   Responsive Design - KITERJESZTETT MOBIL
   ============================================ */

/* Tablet */
@media (max-width: 968px) {
  .hamburger-btn {
    display: flex;
  }
  
  .navbar-menu,
  .nav-menu {
    display: none;
  }
  
  .navbar-actions,
  .nav-user {
    gap: 0.5rem;
  }
  
  .user-badge span {
    display: none;
  }
  
  /* Hide logout button on mobile - it's in hamburger menu */
  .btn-logout {
    display: none;
  }
  
  .page-header,
  .devices-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  
  .header-actions,
  .header-right {
    width: 100%;
    flex-wrap: wrap;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
}

/* Mobile */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  
  .navbar-content,
  .nav-container {
    padding: 0.625rem 0.75rem;
  }
  
  .navbar-brand,
  .nav-brand {
    font-size: 1rem;
  }
  
  .navbar-brand span {
    font-size: 1rem;
  }
  
  .brand-logo,
  .logo-icon {
    height: 32px;
  }
  
  /* Smaller theme toggle on mobile */
  .theme-toggle {
    width: 48px;
    height: 26px;
  }
  
  .theme-toggle-slider {
    width: 20px;
    height: 20px;
  }
  
  [data-theme="light"] .theme-toggle-slider {
    transform: translateX(22px);
  }
  
  /* Smaller user avatar on mobile */
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  .user-badge {
    padding: 0.375rem 0.75rem;
  }
  
  .container,
  .devices-container {
    padding: 1rem 0.75rem;
  }
  
  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
  
  .login-card {
    padding: 1.5rem 1rem;
  }
  
  .login-header h1 {
    font-size: 1.5rem;
  }
  
  .page-header,
  .devices-header {
    padding: 1.25rem 0.875rem;
  }
  
  .page-header h1,
  .devices-header h1 {
    font-size: 1.5rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.125rem; }
  
  /* Make buttons full width on very small screens */
  .header-right .btn,
  .header-actions .btn {
    flex: 1;
    min-width: 0;
  }
  
  /* Improve form controls */
  .form-control {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Better spacing for mobile */
  .form-group {
    margin-bottom: 1rem;
  }
  
  /* Mobile-friendly navbar */
  .navbar-actions {
    gap: 0.5rem;
  }
}

/* Very small devices */
@media (max-width: 360px) {
  .navbar-brand span {
    display: none;
  }
  
  .login-card {
    padding: 1.25rem 0.875rem;
  }
  
  /* If logout button shows, make it icon only */
  .btn-logout {
    padding: 0.5rem;
    min-width: 44px;
  }
  
  .btn-logout span {
    display: none;
  }
  
  .btn-logout::after {
    content: '🚪';
    font-size: 1.125rem;
  }
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   Touch Improvements
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover effects on touch devices */
  .btn:hover,
  .nav-link:hover,
  .device-card:hover {
    transform: none;
  }
  
  /* But keep active states */
  .btn:active {
    transform: scale(0.98);
  }
  
  .nav-link:active,
  .device-card:active {
    transform: scale(0.99);
  }
}