/* ==========================================================================
   SON KALE EGM - ELEKTRONİK BELGE YÖNETİM SİSTEMİ (EBYS)
   Ultra-Modern Next-Gen Cyber-Luxury Design System & Core Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Cyber-Obsidian & Gold Luxury Theme */
  --bg-main: #060913;
  --bg-secondary: #0a0f1d;
  --bg-sidebar: rgba(8, 13, 26, 0.96);
  --bg-topbar: rgba(8, 13, 26, 0.88);
  --bg-card: rgba(13, 20, 38, 0.75);
  --bg-card-hover: rgba(18, 28, 52, 0.9);
  --bg-card-solid: #0d1426;
  --bg-input: rgba(15, 23, 44, 0.8);
  --bg-input-focus: rgba(20, 32, 60, 0.98);
  
  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-highlight: rgba(0, 210, 255, 0.28);
  --border-gold: #d4af37;
  --border-gold-subtle: rgba(212, 175, 55, 0.35);
  
  /* Accent Colors */
  --gold-primary: #e6a23c;
  --gold-light: #f5b041;
  --gold-dark: #b8860b;
  --gold-glow: rgba(230, 162, 60, 0.4);
  --gold-gradient: linear-gradient(135deg, #f5b041 0%, #d4af37 50%, #aa7c11 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(230, 162, 60, 0.18) 0%, rgba(212, 175, 55, 0.04) 100%);
  
  --cyan-primary: #00d2ff;
  --cyan-light: #38bdf8;
  --cyan-glow: rgba(0, 210, 255, 0.45);
  --cyan-gradient: linear-gradient(135deg, #00d2ff 0%, #2563eb 100%);
  --cyan-gradient-soft: linear-gradient(135deg, rgba(0, 210, 255, 0.15) 0%, rgba(37, 99, 235, 0.05) 100%);
  
  --purple-primary: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.35);
  --purple-gradient: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
  
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  --emerald-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
  
  --amber-primary: #f59e0b;
  --rose-primary: #f43f5e;
  --blue-primary: #3b82f6;
  
  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #f5b041;
  --text-cyan: #38bdf8;
  
  /* Status Badges */
  --badge-success-bg: rgba(16, 185, 129, 0.15);
  --badge-success-text: #34d399;
  --badge-success-border: rgba(16, 185, 129, 0.3);
  
  --badge-info-bg: rgba(0, 210, 255, 0.15);
  --badge-info-text: #38bdf8;
  --badge-info-border: rgba(0, 210, 255, 0.35);
  
  --badge-warning-bg: rgba(245, 158, 11, 0.15);
  --badge-warning-text: #fbbf24;
  --badge-warning-border: rgba(245, 158, 11, 0.35);
  
  --badge-danger-bg: rgba(244, 63, 94, 0.15);
  --badge-danger-text: #fb7185;
  --badge-danger-border: rgba(244, 63, 94, 0.35);
  
  /* Shadows & Glassmorphism 2.0 */
  --shadow-card: 0 12px 35px -5px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-card-hover: 0 18px 45px -5px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 210, 255, 0.15), 0 0 0 1px rgba(0, 210, 255, 0.3);
  --shadow-glow-gold: 0 0 30px rgba(230, 162, 60, 0.3);
  --shadow-glow-blue: 0 0 30px rgba(0, 210, 255, 0.3);
  --backdrop-blur: blur(20px);
  
  /* Layout Dimensions */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 78px;
  --topbar-height: 72px;
  --border-radius-xs: 6px;
  --border-radius-sm: 10px;
  --border-radius-md: 14px;
  --border-radius-lg: 18px;
  --border-radius-xl: 24px;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(0, 210, 255, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(230, 162, 60, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(88, 101, 242, 0.03) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* Ambient Canvas Particles Background */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.65;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(6, 9, 19, 0.9);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-primary);
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */
#app {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  backdrop-filter: var(--backdrop-blur);
  transition: width var(--transition-smooth);
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.4);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo-text-group,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .support-label,
.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.sidebar-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.logo-badge {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--border-radius-sm);
  background: radial-gradient(circle, rgba(230, 162, 60, 0.25) 0%, rgba(14, 22, 40, 0.9) 100%);
  border: 1.5px solid var(--border-gold-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--gold-glow);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-spring);
}

.logo-badge img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.logo-title span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px var(--gold-glow);
}

.logo-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 0.85rem 0.75rem 0.35rem 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.14) 0%, rgba(37, 99, 235, 0.05) 100%);
  color: #ffffff;
  border-color: rgba(0, 210, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  height: 64%;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--cyan-gradient);
  box-shadow: 0 0 10px var(--cyan-primary);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: inherit;
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  color: var(--cyan-primary);
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.nav-label {
  flex: 1;
  white-space: nowrap;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 9, 19, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-support {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-support:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-collapse {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-collapse:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ==========================================================================
   Main Content & Topbar Area (Corrected Wrapper Width & Margin)
   ========================================================================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  transition: margin-left var(--transition-smooth), width var(--transition-smooth);
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

/* Topbar Styles */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: var(--backdrop-blur);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-box-container {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  width: 260px;
}

.search-box-container:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 210, 255, 0.35);
  color: var(--text-primary);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.15);
}

.search-icon {
  display: flex;
  align-items: center;
  color: inherit;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  width: 100%;
  cursor: pointer;
}

.search-badge-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.12rem 0.45rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Discord Status Pill */
.discord-topbar-status-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.35);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.discord-topbar-status-pill:hover {
  background: rgba(88, 101, 242, 0.22);
  border-color: #5865f2;
  box-shadow: 0 0 15px rgba(88, 101, 242, 0.35);
}

.discord-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  position: relative;
}

.btn-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.btn-icon-badge:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

.badge-counter {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--rose-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #070a13;
}

/* User Profile Chip In Topbar */
.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--transition-fast);
  max-height: 48px;
}

.user-profile-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(230, 162, 60, 0.4);
}

.user-avatar-wrap {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  border: 1.5px solid var(--gold-primary);
  overflow: hidden !important;
  box-shadow: 0 0 10px var(--gold-glow);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar, #topbar-user-avatar {
  width: 100% !important;
  height: 100% !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  display: block;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
  max-width: 160px;
}

.user-name, #topbar-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-rank, #topbar-user-rank {
  font-size: 0.68rem;
  color: var(--gold-light);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-chevron {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* Main Content Body */
.content-body {
  flex: 1;
  padding: 2rem 2.25rem 3rem 2.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  .sidebar .logo-text-group,
  .sidebar .nav-label,
  .sidebar .nav-section-title,
  .sidebar .support-label,
  .sidebar .nav-badge {
    display: none;
  }
  .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
  }
  .search-box-container {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .btn-menu-toggle {
    display: flex;
  }
  .topbar {
    padding: 0 1rem;
  }
  .content-body {
    padding: 1.25rem;
  }
  .search-box-container {
    display: none;
  }
}
