/* ============================================================
   ÜRETIM TAKIP - MAIN STYLES
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-900: #0F172A;
  --bg-800: #1E293B;
  --bg-700: #334155;
  --bg-600: #475569;

  --card-bg: rgba(30, 41, 59, 0.98);
  --card-bg-hover: rgba(51, 65, 85, 0.98);
  --card-border: rgba(148, 163, 184, 0.1);
  --card-border-hover: rgba(148, 163, 184, 0.22);

  --green: #22C55E;
  --green-dark: #16A34A;
  --green-dim: rgba(34, 197, 94, 0.12);
  --green-glow: 0 0 20px rgba(34, 197, 94, 0.25);

  --blue: #3B82F6;
  --blue-dark: #2563EB;
  --blue-dim: rgba(59, 130, 246, 0.12);

  --amber: #F59E0B;
  --amber-dark: #D97706;
  --amber-dim: rgba(245, 158, 11, 0.12);

  --red: #EF4444;
  --red-dark: #DC2626;
  --red-dim: rgba(239, 68, 68, 0.12);

  --purple: #8B5CF6;
  --purple-dim: rgba(139, 92, 246, 0.12);

  --text-100: #F1F5F9;
  --text-300: #CBD5E1;
  --text-400: #94A3B8;
  --text-600: #64748B;

  --header-h: 56px;
  --nav-h: 64px;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);

  --t-fast: 0.15s ease;
  --t-normal: 0.25s ease;
  --t-slow: 0.4s ease;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-900);
  color: var(--text-100);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
img, svg { display: block; }
ul, ol { list-style: none; }

/* ---- App Layout ---- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 768px;
  margin: 0 auto;
}

/* ---- Header ---- */
#app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 768px;
  height: var(--header-h);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon { font-size: 22px; line-height: 1; }

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-100);
  letter-spacing: -0.02em;
}

/* ---- User Badge ---- */
.user-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--r-full);
  background: var(--bg-800);
  border: 1px solid var(--card-border);
  transition: all var(--t-fast);
  max-width: 180px;
}

.user-badge-btn:hover, .user-badge-btn:active {
  background: var(--bg-700);
  border-color: var(--card-border-hover);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-badge-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.user-badge-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-100);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.user-badge-role {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-400);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-badge-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-400);
  flex-shrink: 0;
  transition: transform var(--t-fast);
}

.user-badge-btn.open .user-badge-chevron { transform: rotate(180deg); }

/* ---- Main Content ---- */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  -webkit-overflow-scrolling: touch;
}

/* ---- Bottom Navigation ---- */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 768px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  min-height: var(--nav-h);
  max-height: calc(var(--nav-h) + var(--safe-bottom));
  overflow: hidden;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 4px;
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  position: relative;
  color: var(--text-600);
}

.nav-item:active { transform: scale(0.88); }
.nav-item.active { color: var(--green); }

.nav-icon { font-size: 20px; line-height: 1; transition: transform var(--t-fast); }
.nav-item.active .nav-icon { transform: scale(1.15); }

.nav-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-badge {
  position: absolute;
  top: 0px;
  right: calc(50% - 18px);
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--r-full);
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  border: 1.5px solid var(--bg-900);
}

.nav-badge.hidden { display: none; }

/* ---- Login Screen ---- */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-900);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 197, 94, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 197, 94, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(34, 197, 94, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-xl), 0 0 80px rgba(34, 197, 94, 0.06);
  backdrop-filter: blur(24px);
}

.login-logo { text-align: center; margin-bottom: 32px; }

.login-logo-icon {
  font-size: 60px;
  display: block;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-100);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.login-subtitle { font-size: 14px; color: var(--text-400); }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-error {
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-600);
  margin-top: 18px;
}

.login-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-600);
  font-size: 12px;
  font-weight: 500;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bg-700);
}

/* İlk giriş ad ekranı */
#firstname-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-900);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden;
}

.btn-arrow { margin-left: 4px; }

/* ---- Profile Menu ---- */
#profile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.profile-menu {
  position: absolute;
  top: calc(var(--header-h) + 6px);
  right: 12px;
  width: 230px;
  background: var(--bg-800);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideDown var(--t-fast);
  z-index: 301;
}

.profile-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-700);
}

.profile-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.profile-menu-name { font-size: 14px; font-weight: 700; color: var(--text-100); }
.profile-menu-role { font-size: 11px; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.profile-menu-divider { height: 1px; background: var(--card-border); }

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-300);
  transition: all var(--t-fast);
  text-align: left;
}

.profile-menu-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-400); }
.profile-menu-item:hover, .profile-menu-item:active { background: var(--bg-700); color: var(--text-100); }
.profile-menu-logout { color: #FC8181; }
.profile-menu-logout svg { color: #FC8181; }
.profile-menu-logout:hover { background: var(--red-dim); }

/* ---- Loading Overlay ---- */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  gap: 16px;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--card-border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text { font-size: 14px; color: var(--text-400); font-weight: 500; }

/* ---- Confetti Canvas ---- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ---- View Container ---- */
.view-page {
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}

.page-header-text { flex: 1; min-width: 0; }

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-100);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-400);
  margin-top: 2px;
  font-weight: 400;
}

/* ---- Animations ---- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 80px; margin-bottom: 8px; }
  to { opacity: 0; transform: translateX(110%); max-height: 0; margin-bottom: 0; }
}

@keyframes checkPop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---- Utilities ---- */
.hidden { display: none !important; }

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--text-400); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
