/* GreatVPN Cabinet Styles */

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

:root {
  --bg-primary: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --telegram: #0088cc;
  --success: #2ea043;
  --warning: #d29922;
  --danger: #da3633;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --modal-overlay: rgba(0, 0, 0, 0.6);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-primary);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.logout-btn {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.logout-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* Hamburger Button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1003;
  position: relative;
}

.hamburger-btn:hover {
  opacity: 0.8;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  pointer-events: none;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-overlay);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  max-width: 80vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 1002;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.mobile-menu-close:hover {
  background: var(--bg-primary);
}

.close-icon {
  position: relative;
  width: 16px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

.close-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mobile-menu-content {
  padding: 20px;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.mobile-nav-link {
  display: block;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.mobile-nav-link:hover {
  background: var(--bg-primary);
  color: var(--accent);
}

.mobile-user-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mobile-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.mobile-user-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mobile-user-email {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.mobile-menu-btn {
  display: block;
  padding: 12px 16px;
  text-align: center;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: var(--bg-primary);
}

.mobile-logout:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* Main Container */
.main-container {
  padding-top: 80px;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.card-body form {
  margin-top: 24px; /* Отступ от карточек до формы */
}

/* Status Badge */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  background: rgba(46, 160, 67, 0.15);
  color: var(--success);
  border: 1px solid rgba(46, 160, 67, 0.3);
}

.status-inactive {
  background: rgba(218, 54, 51, 0.15);
  color: var(--danger);
  border: 1px solid rgba(218, 54, 51, 0.3);
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.info-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}

.btn-primary:hover {
  opacity: 0.9;
  background: var(--accent);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Quick Actions Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.action-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.action-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(46, 160, 67, 0.15);
  color: var(--success);
  border: 1px solid rgba(46, 160, 67, 0.3);
}

.alert-error {
  background: rgba(218, 54, 51, 0.15);
  color: var(--danger);
  border: 1px solid rgba(218, 54, 51, 0.3);
}

.alert-info {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.alert-warning {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.error-list {
  margin: 0;
  padding-left: 20px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

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

.auth-form {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.form-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

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

.link-secondary:hover {
  color: var(--accent);
}

.link-primary {
  color: var(--accent);
  font-weight: 500;
}

.link-primary:hover {
  color: var(--text-primary);
}

.auth-footer {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Subscription Plans */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.plan-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}

.plan-card:hover {
  border-color: var(--accent);
}

.plan-card.current {
  border-color: var(--success);
  background: rgba(46, 160, 67, 0.05);
}

.plan-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.plan-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.plan-price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.plan-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.plan-features {
  list-style: none;
  margin-bottom: 20px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.plan-features li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
}

/* Keys Page */
.key-container {
  text-align: center;
  padding: 32px;
}

.key-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.key-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.key-description {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.copy-container {
  max-width: 500px;
  margin: 0 auto;
}

.copy-url-btn {
  width: 100%;
  padding: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-url-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #0d1117;
}

.copy-url-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  color: var(--text-primary);
}

.table tr:hover {
  background: var(--bg-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 14px 16px;
  }

  .header-container {
    flex-wrap: nowrap;
  }

  .desktop-nav,
  .desktop-menu {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .mobile-menu-overlay,
  .mobile-menu {
    display: block;
  }

  .container {
    padding: 16px;
  }

  .card {
    padding: 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 8px 12px;
  }
}
