@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #1478BE;
  --primary-hover: #0F639E;
  --primary-light: #E8F6FF;
  --navy: #0A2F52;
  --navy-light: #164269;
  --secondary-text: #3F6485;
  --sky-bg: #E8F6FF;
  --light-sky: #CDEBFB;
  --wave-blue: #8FD0F2;
  --sand: #F7E4B5;
  --sand-dark: #E6CE93;
  --sun-yellow: #FFD27A;
  --sun-gold: #F5A623;
  --coral: #FF8A5B;
  --card-bg: #FFFFFF;
  --card-shadow: 0 10px 30px rgba(10, 47, 82, 0.08);
  --card-shadow-hover: 0 16px 36px rgba(10, 47, 82, 0.12);
  --border-radius: 20px;
  --pill-radius: 9999px;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--sky-bg);
  color: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Background Wave Accents */
.bg-wave-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 240px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* Header & Top Bar */
header.top-bar {
  background: linear-gradient(135deg, #1478BE 0%, #0A2F52 100%);
  color: white;
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(10, 47, 82, 0.15);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.brand-app-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: #FFFFFF;
}

.brand-sun-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--sun-yellow) 0%, var(--coral) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(255, 210, 122, 0.6);
  font-size: 20px;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-text span {
  font-size: 12px;
  font-weight: 500;
  color: var(--light-sky);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.api-pill {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--pill-radius);
  font-size: 13px;
  font-weight: 500;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.logout-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 8px 18px;
  border-radius: var(--pill-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Main Container */
main.container {
  max-width: 1300px;
  margin: 28px auto;
  padding: 0 24px;
  flex: 1;
  width: 100%;
  position: relative;
  z-index: 10;
}

/* Beach Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #1478BE 0%, #1A8BD9 60%, #4FAEEA 100%);
  border-radius: var(--border-radius);
  color: white;
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(20, 120, 190, 0.25);
  margin-bottom: 30px;
}

.hero-sun {
  display: none !important;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: var(--pill-radius);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.hero-content h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-content p {
  font-size: 15px;
  color: #E2F3FF;
  line-height: 1.5;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(205, 235, 251, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: var(--sky-bg);
  color: var(--primary);
}

.stat-icon.green {
  background: #E8FDF5;
  color: var(--success);
}

.stat-icon.gold {
  background: #FEF7E6;
  color: var(--sun-gold);
}

.stat-icon.sand {
  background: #FFF8E7;
  color: #B58414;
}

.stat-details h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.stat-details .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.stat-details .stat-sub {
  font-size: 12px;
  color: var(--secondary-text);
  margin-top: 4px;
}

/* Control & Filter Bar */
.control-bar {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 18px 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(205, 235, 251, 0.6);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--sky-bg);
  border: 1px solid var(--light-sky);
  color: var(--navy);
  padding: 8px 18px;
  border-radius: var(--pill-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: #DCF0FA;
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(20, 120, 190, 0.3);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  background: var(--sky-bg);
  border: 1.5px solid var(--light-sky);
  border-radius: var(--pill-radius);
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy);
  outline: none;
  min-width: 220px;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  background: white;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0F639E 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--pill-radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(20, 120, 190, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(20, 120, 190, 0.45);
}

/* Servers Table Card */
.table-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(205, 235, 251, 0.6);
  overflow: hidden;
  margin-bottom: 40px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.server-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.server-table th {
  background: #F4FAFD;
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--light-sky);
}

table.server-table td {
  padding: 18px 20px;
  font-size: 14px;
  border-bottom: 1px solid rgba(205, 235, 251, 0.4);
  vertical-align: middle;
}

table.server-table tr:last-child td {
  border-bottom: none;
}

table.server-table tr:hover td {
  background: #FAFDFF;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--pill-radius);
  font-size: 12px;
  font-weight: 700;
}

.badge-country {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--navy);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.badge-country.us {
  background: #FFD27A;
}

.badge-country.sg {
  background: #FFB38A;
}

.badge-country.in {
  background: #A7F3D0;
}

.badge-country.ca {
  background: #CDEBFB;
}

.badge-status-active {
  background: #E8FDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.badge-status-soon {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.badge-status-disabled {
  background: #F3F4F6;
  color: #6B7280;
  border: 1px solid #E5E7EB;
}

.badge-tier-free {
  background: var(--sky-bg);
  color: var(--primary);
  border: 1px solid var(--light-sky);
}

.badge-tier-premium {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1px solid #FCD34D;
}

.badge-protocol {
  background: #EFF6FF;
  color: #1E40AF;
  font-family: monospace;
  font-size: 11px;
}

/* Action Buttons */
.btn-action {
  background: var(--sky-bg);
  border: 1px solid var(--light-sky);
  color: var(--navy);
  padding: 6px 12px;
  border-radius: var(--pill-radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.15s;
}

.btn-action:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: 0.25s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
  background-color: var(--primary);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 47, 82, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(10, 47, 82, 0.25);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--navy) 100%);
  color: white;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--light-sky);
  background: #FAFDFF;
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  background: white;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

textarea.form-control {
  font-family: monospace;
  font-size: 12px;
  min-height: 140px;
  resize: vertical;
}

.modal-footer {
  padding: 16px 28px;
  background: #F4FAFD;
  border-top: 1px solid var(--light-sky);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background: white;
  border: 1.5px solid var(--light-sky);
  color: var(--secondary-text);
  padding: 10px 20px;
  border-radius: var(--pill-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--navy);
  color: white;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(10, 47, 82, 0.2);
  animation: toastIn 0.3s;
}

.toast.success {
  background: #065F46;
  border-left: 4px solid var(--success);
}

.toast.error {
  background: #7F1D1D;
  border-left: 4px solid var(--danger);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Login View Styling */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #E8F6FF 0%, #CDEBFB 100%);
  position: relative;
}

.login-card {
  background: white;
  border-radius: 28px;
  max-width: 420px;
  width: 100%;
  padding: 40px 36px;
  box-shadow: 0 20px 45px rgba(10, 47, 82, 0.12);
  border: 1px solid rgba(205, 235, 251, 0.8);
  text-align: center;
  position: relative;
  z-index: 10;
}

.login-logo {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--sun-yellow) 0%, var(--coral) 100%);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
  box-shadow: 0 0 24px rgba(255, 210, 122, 0.7);
}

.login-app-icon {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(20, 120, 190, 0.25);
  border: 1px solid rgba(205, 235, 251, 0.9);
  background: #FFFFFF;
}

.login-card h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.login-card p {
  font-size: 14px;
  color: var(--secondary-text);
  margin-bottom: 28px;
}

.login-footer-copy {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary-text);
  letter-spacing: 0.2px;
}

/* Admin Panel Bottom Footer */
.admin-footer {
  margin-top: auto;
  padding: 24px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(20, 120, 190, 0.1);
}

.admin-footer p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary-text);
  letter-spacing: 0.2px;
}
/* ==========================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================== */

/* Tablets and small laptops (<= 992px) */
@media (max-width: 992px) {
  header.top-bar {
    padding: 14px 20px;
  }

  main.container {
    padding: 0 16px;
    margin: 20px auto;
  }

  .hero-banner {
    padding: 26px 24px;
  }

  .hero-content h2 {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .control-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px;
  }

  .action-group {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .search-input {
    width: 100%;
    min-width: 0;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile smartphones (<= 600px - iPhone, Android, ELI-AN00) */
@media (max-width: 600px) {
  header.top-bar {
    padding: 12px 14px;
  }

  .header-container {
    gap: 8px;
  }

  .brand-sun-icon {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .brand-text h1 {
    font-size: 17px;
  }

  .brand-text span {
    font-size: 10px;
  }

  .api-pill {
    display: none; /* Hide on small phone screens to keep header clean */
  }

  .logout-btn {
    padding: 6px 14px;
    font-size: 12px;
  }

  main.container {
    padding: 0 12px;
    margin: 14px auto;
  }

  .hero-banner {
    padding: 20px 18px;
    border-radius: 16px;
    margin-bottom: 20px;
  }

  .hero-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .hero-content h2 {
    font-size: 20px;
  }

  .hero-content p {
    font-size: 13px;
    line-height: 1.45;
  }

  /* Single Column Stats on Mobile */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 16px 18px;
    border-radius: 16px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
  }

  .stat-details .stat-value {
    font-size: 24px;
  }

  /* Horizontal swipeable filters */
  .filter-group {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    gap: 6px;
  }

  .filter-group::-webkit-scrollbar {
    height: 4px;
  }

  .filter-group::-webkit-scrollbar-thumb {
    background: var(--light-sky);
    border-radius: 4px;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 13px;
  }

  /* Table styling on mobile */
  .table-card {
    border-radius: 16px;
    margin-bottom: 24px;
  }

  table.server-table th {
    padding: 12px 14px;
    font-size: 12px;
    white-space: nowrap;
  }

  table.server-table td {
    padding: 14px 14px;
    font-size: 13px;
  }

  .server-location {
    gap: 8px;
  }

  .country-name {
    font-size: 13px;
  }

  .city-name {
    font-size: 11px;
  }

  /* Modal responsive collapse to 1 column */
  .modal-overlay {
    padding: 12px;
  }

  .modal-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 20px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-body {
    padding: 18px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-footer {
    padding: 14px 20px;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .modal-footer button {
    width: 100%;
    justify-content: center;
  }

  /* Login Card Mobile */
  .login-card {
    padding: 32px 24px;
    border-radius: 22px;
    margin: 16px;
  }

  .login-logo {
    width: 56px;
    height: 56px;
    font-size: 26px;
  }

  .login-card h2 {
    font-size: 22px;
  }
}