/*
  QR Kód Generátor – Stílusok
  - Modern, letisztult UI Inter betűtípussal
  - Változók, sötét/világos támogatás
  - Üveg (glassmorphism) kártyák, lebegő animációk
  - Finom belépő animáció és hover effektek
  - Reszponzív grid
*/

:root {
  --bg: #0b1020;
  --bg-soft: #0e1530;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #e8ecf1;
  --muted: #a9b3c6;
  --primary: #4f46e5;  /* indigo-600 */
  --primary-500: #6366f1;
  --primary-400: #818cf8;
  --accent: #22d3ee;   /* cyan-400 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --blur: 14px;
  --ring: 0 0 0 2px rgba(99, 102, 241, 0.4), 0 0 0 8px rgba(99, 102, 241, 0.08);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% 0%, #17203a 0%, transparent 60%),
              radial-gradient(1000px 500px at 90% 10%, #1c2a5a 0%, transparent 55%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Subtle noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.15;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(10, 15, 32, 0.85) 0%, rgba(10, 15, 32, 0.55) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.nav-logo i {
  color: var(--accent);
  filter: drop-shadow(0 4px 16px rgba(34, 211, 238, 0.35));
}

.nav-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.18) 0%, rgba(79, 70, 229, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.nav-home-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--ring);
}

/* Main container */
.main-container {
  max-width: 1200px;
  margin: 24px auto 80px auto;
  padding: 0 20px;
}

/* Hero */
.hero-section {
  text-align: center;
  margin: 34px 0 22px 0;
  animation: fadeInUp .6s ease both;
}

.hero-title {
  font-size: clamp(28px, 4vw, 48px);
  margin: 0 0 8px 0;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.hero-title i {
  color: var(--primary-400);
  margin-right: 10px;
  filter: drop-shadow(0 6px 18px rgba(99, 102, 241, 0.35));
}

.hero-subtitle {
  color: var(--muted);
  margin: 0;
}

/* Categories grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 28px;
}

/* Card */
.category-card {
  grid-column: span 6;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.04) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: cardPop .55s ease both;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(600px 200px at -10% -20%, rgba(99, 102, 241, 0.25), transparent 60%),
              radial-gradient(400px 120px at 120% -30%, rgba(34, 211, 238, 0.18), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  border-color: rgba(129, 140, 248, 0.6);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px 18px;
}

.category-header h2 {
  margin: 0;
  font-size: 18px;
}

.category-header p {
  margin: 2px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

.category-icon {
  color: var(--accent);
  margin-right: 10px;
  font-size: 20px;
}

/* QR type items */
.qr-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px 18px 14px;
}

.qr-type {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  border-radius: 12px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.qr-type i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #eaf2ff;
  background: linear-gradient(135deg, var(--primary-500), var(--accent));
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25), inset 0 0 8px rgba(34, 211, 238, 0.35);
}

.qr-type span { flex: 1; font-weight: 500; }

.qr-type:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(99,102,241,0.14), rgba(34,211,238,0.05));
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 8px 26px rgba(79, 70, 229, 0.25);
}

.qr-type:active {
  transform: translateY(0);
}

/* Page containers */
.page { display: none; }
.page.active { display: block; animation: fadeIn .35s ease both; }

/* Dynamic content area */
#content-pages {
  margin-top: 26px;
  animation: fadeIn .4s ease both;
}

/* Generator Page Layout */
.generator-page {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.page-header { text-align: center; margin-bottom: 16px; }
.page-title { margin: 0; font-size: clamp(22px, 3.2vw, 34px); letter-spacing: -0.3px; }
.page-title i { color: var(--primary-400); margin-right: 10px; filter: drop-shadow(0 4px 14px rgba(99,102,241,0.35)); }
.page-subtitle { margin: 8px 0 0 0; color: var(--muted); }

.generator-container { display: block; }
.generator-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

/* Form section */
.form-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.form-group label { font-size: 13px; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"], input[type="datetime-local"], input[type="date"], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(10, 15, 32, 0.45);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

textarea { min-height: 120px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(10, 15, 32, 0.55);
}

/* Preview / QR section */
.qr-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qr-container {
  display: grid;
  place-items: center;
  padding: 16px;
  background: linear-gradient(180deg, rgba(15, 20, 45, 0.6), rgba(10, 15, 32, 0.6));
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  position: relative;
  min-height: 240px;
}

.qr-image {
  border-radius: 10px;
  transition: transform .18s ease, filter .2s ease;
  will-change: transform, filter;
}

.qr-image.qr-updating { filter: blur(2px) brightness(0.9); }

.qr-loader {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(129, 140, 248, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  display: none;
}

.qr-loader.loading { display: block; }

.preview-info { text-align: center; }
.info-text { color: var(--muted); font-size: 13px; margin: 0; }

/* QR customization */
.qr-customization { margin-top: 6px; }
.qr-customization h3 { margin: 0 0 10px 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.qr-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* Actions */
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  font-weight: 600; letter-spacing: .2px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary-500), var(--accent)); color: #fff; box-shadow: 0 10px 24px rgba(99,102,241,.35); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(99,102,241,.45); }
.btn-secondary { background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04)); color: var(--text); border-color: rgba(148,163,184,.25); }
.btn-secondary:hover { border-color: rgba(129,140,248,.5); box-shadow: 0 8px 22px rgba(79,70,229,.22); }

/* Batch grid overrides (JS inline style fallback marad, ez pedig a vizuális finomhangolás) */
.qr-batch-grid { background: rgba(12, 18, 36, 0.65) !important; border-radius: 12px !important; }
.qr-batch-item { background: rgba(255,255,255,0.85) !important; }
.qr-batch-item button { background: #667eea !important; }

/* Animated QR helpers */
.animated-fade { animation: qrFade 2.2s ease-in-out infinite; }
.animated-pulse { animation: qrPulse 1.8s ease-in-out infinite; }
.animated-rotate { animation: qrRotate 6s linear infinite; transform-origin: center; }
.animated-wave { animation: qrWave 2.6s ease-in-out infinite; transform-origin: center; }

.speed-slow { animation-duration: 3s !important; }
.speed-normal { animation-duration: 1.8s !important; }
.speed-fast { animation-duration: 1s !important; }

@keyframes qrFade { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }
@keyframes qrPulse { 0%, 100% { transform: scale(.98); filter: drop-shadow(0 0 0 rgba(99,102,241,0)); } 50% { transform: scale(1); filter: drop-shadow(0 8px 20px rgba(99,102,241,.35)); } }
@keyframes qrRotate { to { transform: rotate(360deg); } }
@keyframes qrWave { 0%, 100% { transform: rotate(-1deg) scale(0.99); } 50% { transform: rotate(1deg) scale(1.01); } }

/* Printing */
body.printing * { animation: none !important; transition: none !important; box-shadow: none !important; }
@media print {
  body { background: #fff; }
  .navbar, .nav-container, .nav-logo, .nav-home-btn, .hero-section, .categories-grid, .actions, .qr-customization, .preview-info, #home-page { display: none !important; }
  .generator-page, .qr-section, .qr-container { border: none; box-shadow: none; background: #fff; }
  .qr-image { page-break-inside: avoid; }
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 20, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.loading-overlay.show { display: flex; }

.loading-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(129, 140, 248, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite, glow 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1) inset;
}

/* Small utility styles */
.hidden { display: none !important; }
.center { display: grid; place-items: center; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardPop {
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  60% { opacity: 1; transform: translateY(0) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.15); }
}

/* Responsive */
@media (max-width: 1024px) {
  .category-card { grid-column: span 12; }
}

@media (max-width: 720px) {
  .nav-container { padding: 12px 14px; }
  .qr-types { grid-template-columns: 1fr; }
  .main-container { margin: 16px auto 60px auto; }
}

/* Footer */
.footer {
  position: relative;
  margin-top: 60px;
  padding: 20px 0;
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 15, 32, 0.4) 50%, rgba(10, 15, 32, 0.8) 100%);
  border-top: 1px solid var(--card-border);
}

.footer-content {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-400);
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}
