/**
 * llmVPN - Единый стиль для всех страниц
 * Цветовая схема: Gold & Black
 */

:root {
  --sidebar-width: 280px;
  --gold: #d4af37;
  --gold-light: #f4cf57;
  --gold-dark: #b8941f;
  --gold-glow: rgba(212, 175, 55, 0.6);
  --black: #0a0a0a;
  --black-light: #1a1a1a;
  --black-card: #151515;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* Custom scrollbar for sidebar */
.sidebar-menu::-webkit-scrollbar {
  width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

body {
  background: linear-gradient(135deg, var(--black) 0%, var(--black-light) 50%, #0d0d0d 100%);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
  animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ==================== SIDEBAR ==================== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--black-card) 0%, var(--black) 100%);
  padding: 0; z-index: 1000;
  border-right: 1px solid rgba(212, 175, 55, 0.1);
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar-brand {
  padding: 30px 24px;
  display: flex; align-items: center; gap: 15px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, transparent 100%);
}

.brand-logo {
  width: 45px;
  height: 45px;
  position: relative;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(5deg); }
}

.logo-shield {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid var(--gold);
  border-radius: 50%;
  animation: shieldPulse 2s ease-in-out infinite;
}

@keyframes shieldPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--gold), 0 0 40px var(--gold-glow);
    opacity: 0.8;
  }
}

.logo-parts {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.logo-part {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 2px;
  animation: logoDisassemble 4s ease-in-out infinite;
}

.logo-part:nth-child(1) { top: -10px; left: 10px; animation-delay: 0s; }
.logo-part:nth-child(2) { top: 10px; right: -10px; animation-delay: 0.5s; }
.logo-part:nth-child(3) { bottom: -10px; left: 20px; animation-delay: 1s; }
.logo-part:nth-child(4) { bottom: 10px; right: 5px; animation-delay: 1.5s; }
.logo-part:nth-child(5) { top: 5px; left: -5px; animation-delay: 2s; }

@keyframes logoDisassemble {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  25% {
    transform: translate(15px, -15px) scale(0.5);
    opacity: 0.5;
  }
  50% {
    transform: translate(-10px, 20px) scale(0.8);
    opacity: 0.7;
  }
  75% {
    transform: translate(20px, 10px) scale(0.6);
    opacity: 0.6;
  }
}

.brand-text {
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-menu {
  padding: 20px 0;
  overflow-y: auto;
  max-height: calc(100vh - 140px);
}

.sidebar-menu a {
  color: var(--text-muted); padding: 14px 24px;
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; transition: all 0.3s ease;
  position: relative; overflow: hidden;
  border-left: 3px solid transparent;
}

.sidebar-menu a::before {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
  transform: translateX(-100%); transition: transform 0.3s ease;
}

.sidebar-menu a:hover::before { transform: translateX(0); }
.sidebar-menu a:hover, .sidebar-menu a.active {
  color: var(--gold); background: rgba(212, 175, 55, 0.05);
  border-left-color: var(--gold);
}
.sidebar-menu a:hover i { transform: scale(1.1) rotate(5deg); }
.sidebar-menu a i { font-size: 1.2rem; transition: transform 0.3s ease; }

/* ==================== MAIN CONTENT ==================== */
.main-content {
  margin-left: var(--sidebar-width); padding: 30px;
  position: relative; z-index: 10;
}

/* Sidebar Toggle Button (Hamburger) */
.sidebar-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--gold);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 10px;
  position: relative;
  overflow: hidden;
}

.sidebar-toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-toggle-btn:hover::before {
  opacity: 1;
}

.sidebar-toggle-btn:hover {
  color: var(--gold-light);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  transform: scale(1.05);
}

.sidebar-toggle-btn:active {
  transform: scale(0.95);
}

.sidebar-toggle-btn i {
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 30px; padding-bottom: 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title {
  font-size: 1.8rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex; align-items: center; gap: 12px;
}

.page-subtitle { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
  border-radius: 25px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.user-name {
  font-weight: 600;
  color: var(--gold-light);
  font-size: 0.95rem;
}

/* ==================== CARDS ==================== */
.card {
  background: linear-gradient(135deg, var(--black-card) 0%, rgba(26, 26, 26, 0.8) 100%);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-header {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  padding: 20px 24px; font-weight: 700; font-size: 1.1rem;
}

.card-footer {
  background: rgba(212, 175, 55, 0.03);
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.card-title { color: var(--gold); font-weight: 700; margin-bottom: 0; }

.stat-card {
  background: linear-gradient(135deg, var(--black-card) 0%, rgba(26, 26, 26, 0.8) 100%);
  border-radius: 16px; padding: 28px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative; overflow: hidden;
}

.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  background-size: 200% auto;
  animation: gradientShift 2s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.3);
}

.stat-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; transition: all 0.3s ease;
}

.stat-card:hover .stat-icon { transform: scale(1.1) rotate(5deg); }

.bg-gold { background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1)); }
.text-gold { color: var(--gold) !important; }
.bg-gold-light { background: linear-gradient(135deg, rgba(244, 207, 87, 0.15), rgba(244, 207, 87, 0.05)); }
.text-gold-light { color: var(--gold-light) !important; }

.stat-value {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label { color: var(--text-muted); font-size: 0.9rem; margin-top: 6px; font-weight: 500; }

/* Inbound Cards */
.inbound-card {
  background: linear-gradient(135deg, var(--black-card) 0%, rgba(26, 26, 26, 0.8) 100%);
  border-radius: 16px; border: 1px solid rgba(212, 175, 55, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px; overflow: hidden;
  transition: all 0.3s ease;
}

.inbound-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.2);
}

.inbound-header {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
  padding: 18px 22px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.inbound-title {
  font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--gold);
}

.inbound-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

.inbound-badge {
  background: rgba(212, 175, 55, 0.2);
  padding: 5px 14px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.inbound-body { padding: 20px; }

.inbound-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.inbound-stat {
  text-align: center; padding: 16px;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.inbound-stat:hover { transform: scale(1.05); }

.inbound-stat-value {
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.inbound-stat-label {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}

.stat-upload { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1)); }
.stat-download { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1)); }
.stat-total { background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1)); }
.stat-online { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1)); }
.stat-clients { background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.15)); }

/* ==================== TABLES ==================== */
.table { color: var(--text); --bs-table-bg: transparent; }

.table thead th {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold); font-weight: 700;
  text-transform: uppercase; font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  text-align: center !important;
  vertical-align: middle !important;
}

.table tbody td {
  text-align: center !important;
  vertical-align: middle !important;
}

.table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(212, 175, 55, 0.05);
}

.table tbody tr:hover { background: rgba(212, 175, 55, 0.05); }

.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.sortable:hover {
  background: rgba(212, 175, 55, 0.15) !important;
}

.sort-icon {
  margin-left: 6px;
  opacity: 0.3;
  transition: all 0.2s ease;
}

.sortable:hover .sort-icon {
  opacity: 0.7;
}

.sort-asc .sort-icon, .sort-desc .sort-icon {
  opacity: 1;
}

.sort-asc {
  background: rgba(212, 175, 55, 0.2) !important;
}

.sort-desc {
  background: rgba(212, 175, 55, 0.2) !important;
}

/* ==================== BUTTONS ==================== */
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none; color: var(--black);
  font-weight: 600; padding: 12px 28px;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.btn-outline-gold {
  background: transparent; border: 2px solid var(--gold);
  color: var(--gold); font-weight: 600;
  padding: 10px 26px; border-radius: 10px;
  transition: all 0.3s ease;
}

.btn-outline-gold:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.btn-outline-gold-copy {
  background: transparent; border: 1px solid var(--gold);
  color: var(--gold-light); font-weight: 500;
  padding: 8px 16px; border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.btn-outline-gold-copy:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  border-color: var(--gold-light);
}

.btn-sm { padding: 6px 14px; font-size: 0.875rem; }

/* ==================== STATUS DOT ==================== */
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50% { opacity: 0.5; box-shadow: 0 0 4px currentColor; }
}

.status-online { background: var(--success); }
.status-offline { background: var(--danger); }

/* ==================== PAGINATION ==================== */
.pagination .page-link {
  background: var(--black-card);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--gold);
  margin: 0 3px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-color: var(--gold);
  color: var(--black);
}

/* ==================== MODALS ==================== */
.modal-content {
  background: var(--black-card);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.modal-header { border-bottom: 1px solid rgba(212, 175, 55, 0.1); }
.modal-footer { border-top: 1px solid rgba(212, 175, 55, 0.1); }
.modal-title { color: var(--gold); font-weight: 700; }

.modal-body { color: var(--text); }

.form-control {
  background: var(--black-light);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--text);
}

.form-control:focus {
  background: var(--black-card);
  border-color: var(--gold);
  color: var(--text);
  box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}

.form-label {
  color: var(--text-muted);
  font-weight: 500;
}

/* ==================== BADGES ==================== */
.badge-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--black); font-weight: 600;
  padding: 6px 14px; border-radius: 8px;
}

.badge-gold-soft {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold); font-weight: 600;
  padding: 6px 14px; border-radius: 8px;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-light); }

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.5s ease forwards; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ==================== COPY BUTTON ==================== */
.copy-btn-container {
  margin-top: 12px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.copy-btn-container.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 2000;
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.7);
  }
  
  /* Ссылки в меню должны быть кликабельными */
  .sidebar-menu a {
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
  }
  
  .sidebar-menu {
    max-height: calc(100vh - 120px);
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-overlay {
    display: block;
    z-index: 1999;
  }

  .sidebar-toggle-btn {
    display: flex;
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
    z-index: 2001;
  }

  .main-content {
    margin-left: 0;
    padding: 20px 15px;
    z-index: 100;
    position: relative;
  }
  
  /* Кнопки и интерактивные элементы должны быть кликабельными */
  .main-content button,
  .main-content a,
  .main-content input,
  .main-content select {
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
  }
  
  /* Таблицы должны прокручиваться горизонтально */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .page-header-left {
    width: 100%;
    display: flex;
    align-items: center;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .user-info {
    align-self: flex-end;
  }

  .stat-card {
    margin-bottom: 16px;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .table-responsive {
    border-radius: 8px;
  }
}
