/* ============================================================
   CloudHost Premium Dark Glassmorphism CSS Design System
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 45%);
  min-height: 100vh;
}

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

a:hover {
  color: #818cf8;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header & Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 20px var(--primary-glow);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
  color: #fff;
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

/* Hero Section */
.hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--border-glow);
  border-radius: 30px;
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.8rem;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 3rem;
}

/* Domain Search Box */
.domain-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  border-radius: var(--radius-lg);
  max-width: 760px;
  margin: 0 auto 4rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  gap: 10px;
}

.domain-box input {
  flex: 1;
  background: rgba(9, 13, 22, 0.6);
  border: 1px solid var(--border-color);
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1rem;
  outline: none;
  font-family: var(--font-sans);
}

.domain-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.tld-tags {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tld-tags span {
  color: #fff;
  font-weight: 600;
}

/* Cards & Glass Containers */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
}

/* Pricing Grid */
.pricing-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.toggle-switch {
  position: relative;
  width: 54px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  transform: translateX(26px);
  background: var(--accent-cyan);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.15) 0%, rgba(18, 24, 38, 0.85) 100%);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.2);
}

.popular-badge {
  position: absolute;
  top: -14px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-name {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.plan-price {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  margin: 1rem 0;
}

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

.plan-features {
  list-style: none;
  margin: 1.5rem 0 2rem;
  flex: 1;
}

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

.plan-features li .check {
  color: var(--success);
  font-weight: bold;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 0 2rem;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: var(--radius-md);
  text-align: left;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
}

/* Dashboard Layout (Client & Admin Panels) */
.dashboard-container {
  display: flex;
  min-height: calc(100vh - 73px);
}

.sidebar {
  width: 260px;
  background: rgba(12, 17, 29, 0.95);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  margin-top: 1rem;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
  border-left: 3px solid var(--primary);
}

.sidebar-menu .menu-icon {
  font-size: 1.1rem;
}

.dashboard-content {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border: 1px solid var(--border-glow);
}

.stat-info h3 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.custom-table th {
  background: rgba(9, 13, 22, 0.8);
  padding: 1rem 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

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

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-active, .badge-paid {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending, .badge-unpaid, .badge-open {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-suspended, .badge-cancelled, .badge-closed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-answered {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.4rem;
}

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

.form-control {
  width: 100%;
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--border-color);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

select.form-control option {
  background: #0f172a;
  color: #fff;
}

/* Alerts & Notifications */
.alert {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Ticket Chat Bubble */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chat-bubble {
  max-width: 80%;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.chat-bubble.admin-reply {
  align-self: flex-start;
  border-left: 4px solid var(--primary);
}

.chat-bubble.client-msg {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.1);
  border-right: 4px solid var(--accent-cyan);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

/* Printable Invoice Styling */
.invoice-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 3rem;
  border-radius: var(--radius-md);
  max-width: 850px;
  margin: 0 auto;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

/* Footer */
footer {
  background: rgba(9, 13, 22, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 4rem 2rem 2rem;
  color: var(--text-muted);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: #fff;
  margin-bottom: 1.2rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul a {
  color: var(--text-muted);
}

.footer-col ul a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  font-size: 0.9rem;
}

/* Mobile Navigation Toggle Button */
.mobile-toggle {
  display: none !important;
  background: transparent;
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 1.2rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Comprehensive Responsive Media Queries */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
  }

  .sidebar-menu {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-menu a {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .sidebar-title {
    display: none;
  }

  .dashboard-content {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.8rem 1rem;
    position: relative;
    justify-content: space-between;
  }

  .mobile-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(9, 13, 22, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 1rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    z-index: 1001;
  }

  .nav-links.active {
    display: flex !important;
  }

  .nav-actions {
    margin-left: auto;
    gap: 0.5rem;
  }

  .nav-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .hero {
    padding: 3rem 1rem 2rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

  .features-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

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

  .stat-card {
    padding: 1rem;
    gap: 0.8rem;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .stat-info h3 {
    font-size: 1.4rem;
  }

  .invoice-box {
    padding: 1.5rem 1rem;
  }

  .invoice-header {
    flex-direction: column;
    gap: 1.5rem;
  }

  .invoice-header > div:last-child {
    text-align: left !important;
  }

  .table-responsive {
    border-radius: var(--radius-sm);
    box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.5);
  }

  .custom-table th, .custom-table td {
    padding: 0.8rem 0.9rem;
    font-size: 0.85rem;
  }

  /* Modals on mobile */
  div[id^="planModal"], div[id^="editModal"], div[id^="invModal"], div[id^="userModal"] {
    padding: 1rem;
  }

  div[id^="planModal"] > div, div[id^="editModal"] > div, div[id^="invModal"] > div, div[id^="userModal"] > div {
    max-width: 96vw !important;
    margin: 2% auto !important;
    padding: 1.2rem !important;
    max-height: 92vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .dashboard-header .btn {
    width: 100%;
  }

  .brand-logo {
    font-size: 1.1rem;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
}
