/* BestOwl VPN - Вариант B: Лендинг + Дашборд */

:root {
  --purple: #9D4EDD;
  --orange: #FF6B35;
  --light-purple: #C77DFF;
  --light-orange: #FF9E6D;
  --bg-dark: #0F0F23;
  --bg-card: #1A1A2E;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A0;
  --success: #4CAF50;
  --error: #F44336;
  --warning: #FF9800;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: 
    radial-gradient(140% 120% at 20% 10%, rgba(157, 78, 221, 0.1), transparent),
    radial-gradient(140% 120% at 80% 30%, rgba(255, 107, 53, 0.1), transparent),
    radial-gradient(140% 120% at 50% 70%, rgba(199, 125, 255, 0.08), transparent),
    var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(157, 78, 221, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 107, 53, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Шапка */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid rgba(157, 78, 221, 0.2);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--purple), 
    var(--orange), 
    transparent
  );
  opacity: 0.5;
}

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

.logo {
  font-size: 2rem;
}

.title {
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.user-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
}


/* Кнопки */
.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--orange));
  color: white;
  border: 1px solid rgba(157, 78, 221, 0.5);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 0 20px rgba(157, 78, 221, 0.5),
    0 0 30px rgba(255, 107, 53, 0.3),
    0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid rgba(157, 78, 221, 0.3);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--purple);
  background: rgba(157, 78, 221, 0.15);
  box-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
  transform: translateY(-1px);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
}

/* Основной контент */
.main {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Статистика */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(157, 78, 221, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  border-radius: 12px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(157, 78, 221, 0.5);
  transform: translateY(-4px);
  box-shadow: 
    0 0 20px rgba(157, 78, 221, 0.3),
    0 0 30px rgba(255, 107, 53, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

.stat-card:hover::before {
  opacity: 0.3;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.stat-sub {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Секции */
.section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Карточки */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(157, 78, 221, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(157, 78, 221, 0.4);
  box-shadow: 
    0 0 15px rgba(157, 78, 221, 0.2),
    0 6px 20px rgba(0, 0, 0, 0.3);
}

.empty-state {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

/* Конфигурации */
.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(157, 78, 221, 0.1);
}

.config-item:last-child {
  border-bottom: none;
}

.config-info {
  flex: 1;
}

.config-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.config-details {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.config-actions {
  display: flex;
  gap: 0.5rem;
}

/* Тарифы */
.tariff-item {
  padding: 1.5rem;
  border: 1px solid rgba(157, 78, 221, 0.2);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  position: relative;
}

.tariff-item::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  border-radius: 12px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tariff-item:hover {
  border-color: rgba(157, 78, 221, 0.5);
  transform: translateY(-2px);
  box-shadow: 
    0 0 20px rgba(157, 78, 221, 0.3),
    0 0 30px rgba(255, 107, 53, 0.2),
    0 4px 15px rgba(0, 0, 0, 0.3);
}

.tariff-item:hover::before {
  opacity: 0.2;
}

.tariff-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.tariff-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.tariff-price {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tariff-details {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Серверы */
.server-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(157, 78, 221, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.server-item:last-child {
  border-bottom: none;
}

.server-info {
  flex: 1;
}

.server-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.server-status {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Рефералка */
.referral-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.referral-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.referral-item label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.referral-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.referral-link-row code {
  flex: 1;
  background: rgba(157, 78, 221, 0.1);
  padding: 0.5rem;
  border-radius: 6px;
  word-break: break-all;
  font-size: 0.85rem;
}

/* Ожидание оплаты */
.payment-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(157, 78, 221, 0.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Модалки */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 35, 0.9);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid rgba(157, 78, 221, 0.3);
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 0 40px rgba(157, 78, 221, 0.4),
    0 0 60px rgba(255, 107, 53, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  border-radius: 16px;
  z-index: -1;
  opacity: 0.4;
  filter: blur(15px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(157, 78, 221, 0.2);
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(157, 78, 221, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(157, 78, 221, 0.2);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Формы */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(157, 78, 221, 0.1);
  border: 1px solid rgba(157, 78, 221, 0.3);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.1);
}

/* QR код */
#qr-canvas {
  display: block;
  margin: 1rem auto;
  background: white;
  border-radius: 8px;
  padding: 1rem;
}

/* Футер */
.footer {
  background: var(--bg-card);
  border-top: 1px solid rgba(157, 78, 221, 0.2);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Адаптивность */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }


  .main {
    padding: 1rem;
  }

  .stats-section {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
  }

  .config-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .config-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
