/**
 * app.css – Kollégiumi App egyedi stílusok
 * ==========================================
 * Tailwind CSS-t egészíti ki: animációk, glassmorphism,
 * bottom nav, safe area, scrollbar, stb.
 */

/* ====================================================
   CSS VÁLTOZÓK (Design Tokens)
   ==================================================== */
:root {
  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-primary-glow: rgba(99, 102, 241, 0.25);
  --color-surface: rgba(30, 41, 59, 0.6);
  --color-surface-hover: rgba(51, 65, 85, 0.5);
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(148, 163, 184, 0.08);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bottomnav-height: 4.5rem;
  --topbar-height: 3.5rem;
  --sidebar-width: 18rem;
}

/* ====================================================
   ALAP STÍLUSOK
   ==================================================== */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Szelekció szín */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #e2e8f0;
}

/* ====================================================
   SCROLLBAR (Webkit)
   ==================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.3);
}

/* ====================================================
   GLASSMORPHISM FELÜLETEK
   ==================================================== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ====================================================
   MOBILE: BOTTOM NAVIGATION BAR
   ==================================================== */
.bottom-nav {
  padding-bottom: var(--safe-area-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.75rem;
  color: #64748b;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 3.5rem;
}

.bottom-nav-item svg {
  width: 1.35rem;
  height: 1.35rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-item.active {
  color: var(--color-primary-light);
}

.bottom-nav-item.active svg {
  transform: scale(1.1);
}

/* Aktív pont jelző */
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: -0.125rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 0.1875rem;
  background: var(--color-primary);
  border-radius: 0 0 0.25rem 0.25rem;
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

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

/* ====================================================
   DESKTOP: SIDEBAR NAVIGATION
   ==================================================== */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-nav-item:hover {
  background: var(--color-surface-hover);
  color: #e2e8f0;
}

.sidebar-nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-primary-light);
}

.sidebar-nav-item.active svg {
  color: var(--color-primary);
}

.sidebar-nav-item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* ====================================================
   FLASH / TOAST ÜZENETEK
   ==================================================== */
.flash-toast {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flash-toast.fade-out {
  animation: slideOutRight 0.3s ease forwards;
}

.flash-error   { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.25); color: #fca5a5; }
.flash-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.25); color: #86efac; }
.flash-warning { background: rgba(234, 179, 8, 0.15); border: 1px solid rgba(234, 179, 8, 0.25); color: #fde047; }
.flash-info    { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.25); color: #93c5fd; }

/* ====================================================
   GOMB STÍLUSOK
   ==================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: transparent;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--color-surface-hover);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.35);
}

/* ====================================================
   BADGE / CÍMKE STÍLUSOK
   ==================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-super_admin { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.badge-admin       { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.badge-user        { background: rgba(34, 197, 94, 0.15); color: #86efac; }

.badge-szakmai { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.badge-vacsora { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.badge-egyeb   { background: rgba(34, 197, 94, 0.15); color: #86efac; }

/* ====================================================
   STAT KÁRTYÁK
   ==================================================== */
.stat-card {
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

/* ====================================================
   ANIMÁCIÓK
   ==================================================== */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--color-primary-glow); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Késleltetett animációk kaszkád effekthez */
.delay-1 { animation-delay: 0.05s; opacity: 0; }
.delay-2 { animation-delay: 0.1s;  opacity: 0; }
.delay-3 { animation-delay: 0.15s; opacity: 0; }
.delay-4 { animation-delay: 0.2s;  opacity: 0; }
.delay-5 { animation-delay: 0.25s; opacity: 0; }

/* ====================================================
   NOTIFIKÁCIÓS BADGE (piros pont)
   ==================================================== */
.notif-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: #ef4444;
  border-radius: 9999px;
  animation: pulse-glow 2s infinite;
}

/* ====================================================
   OLDAL-SPECIFIKUS KIEGÉSZÍTÉSEK
   ==================================================== */

/* Üres állapot (empty state) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: #64748b;
}

.empty-state svg {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* Safe area bottom padding a tartalomhoz */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .safe-bottom {
    padding-bottom: calc(var(--bottomnav-height) + var(--safe-area-bottom) + 1rem);
  }
}

/* ====================================================
   RESPONSIVE KIEGÉSZÍTÉSEK
   ==================================================== */
@media (min-width: 1024px) {
  /* Desktop: nincs bottom nav, van sidebar */
  .safe-bottom {
    padding-bottom: 2rem;
  }
}

/* Reduced motion preferencia tiszteletben tartása */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
