/* =========================
   RESET & BASE
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Dark Theme Palette */
  --bg: #0f172a; /* Updated to match dashboard request */
  --surface: #1E293B; /* Slightly lighter for cards */
  --surface-hover: #334155;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #334155;

  --primary: #3b82f6; /* Bright Blue */
  --primary-hover: #2563eb;

  --accent-teal: #2dd4bf; /* For "Real Visitors" text */

  --danger: #ef4444;

  --radius: 12px;
  --radius-sm: 8px;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  /* Grid Pattern Background */
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Ubuntu, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================
   TYPOGRAPHY
========================= */
h1,
h2, 
h3, 
h4 {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

p {
  margin: 0.25rem 0;
  color: var(--text-muted);
}

.text-highlight {
  color: var(--accent-teal);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}

/* =========================
   LAYOUT
========================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    flex: 1; /* Allow content to grow and push footer down */
    width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

main {
    flex: 1; /* Ensure main takes up remaining space */
    display: flex;
    flex-direction: column;
    padding-bottom: 6rem; /* Add internal spacing above footer */
}

/* Admin Wrapper Spacing */
.admin-wrapper {
    /* padding-bottom removed to keep sidebar correct, main content handles padding via 'main' selector */
}

/* =========================
   TOP BAR (Landing Page)
========================= */
.topbar {
  background: transparent; /* Transparent to show grid */
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.topbar .container {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand img {
    height: 32px;
    width: auto;
}

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

/* =========================
   DASHBOARD HEADER & NAV
========================= */
.top-header {
    background: #0f172a;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
}

.top-header__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-bar {
    background: #1e293b;
    padding: 1rem 0;
    border-bottom: 2px solid #0ea5e9; /* Light blue accent line */
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
    gap: 0.5rem;
    transition: color 0.2s;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
}

.nav-link.active, .nav-link:hover {
    color: #fff;
    border-bottom-color: #0ea5e9;
}

.nav-icon {
    font-size: 1.25rem;
    background: #334155;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}
.nav-link.active .nav-icon {
    color: #0ea5e9;
}

.btn-logout {
    background: #dc2626;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
}

/* =========================
   BUTTONS
========================= */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover {
  color: #fff;
}

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

.action-btn {
    background: none; border: 1px solid #d1d5db; border-radius: 6px; padding: 0.5rem;
    cursor: pointer;
    color: var(--text);
}
.action-btn:hover {
    background: var(--surface-hover);
}
.action-btn.delete:hover { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* =========================
   HERO
========================= */
.hero {
  padding: 4rem 0 6rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero p.lead {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

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

/* =========================
   HOW IT WORKS & STEPS
========================= */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.step-card {
  background: rgba(30, 41, 59, 0.5); /* Semi-transparent surface */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
  height: 100%;
}

.step-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.step-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
}

.step-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.step-card p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* =========================
   DASHBOARD CARDS (STATS)
========================= */
.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}
.stat-icon-box {
    background: #334155;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #0ea5e9;
}
.stat-info h4 {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}
.stat-info .value {
    margin: 0.25rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* =========================
   PRICING & LIST CARDS (Dark Mode)
========================= */
.price-card, .profile-card, #sitesListContainer {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.price-card__name { color: var(--text) !important; }
.price-card__price { color: var(--text) !important; }
.price-card__features { color: var(--text-muted) !important; }

/* Table/List Styles for My Websites */
.list-header {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.75rem;
  font-weight: 600;
  color: var(--text-muted) !important;
  border-bottom: 2px solid var(--border) !important;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.site-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--border) !important;
  align-items: center;
  color: var(--text);
}

.site-url { color: var(--primary) !important; }

/* =========================
   FORMS (Enhanced)
========================= */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background-color: #0f172a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background-color: #111827;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

/* =========================
   FOOTER
========================= */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    background-color: var(--bg);
}

footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================
   AUTH MODAL & FORMS
========================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.85); /* Dark overlay */
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.overlay__header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overlay__body {
  padding: 2rem;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.field__label {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.field__input {
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.field__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* =========================
   PROFILE LAYOUT REDESIGN
========================= */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

/* Sidebar */
.profile-sidebar {
  /* Removed background to match 'clean' look or use subtle border */
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.user-summary {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.user-summary__avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  margin-bottom: 1rem;
}

.user-summary__name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.user-summary__link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* Sidebar Menu */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}

.sidebar-nav__item:hover,
.sidebar-nav__item.active {
  background: var(--surface);
  color: var(--text);
}

.sidebar-nav__item.active {
  font-weight: 600;
  border-left: 3px solid var(--primary);
  background: rgba(59, 130, 246, 0.05); /* Very subtle tint */
}

/* Main Profile Content */
.profile-content {
  min-width: 0; /* Prevent flex/grid blowout */
}

.settings-header {
  margin-bottom: 2rem;
}

.settings-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Tabs */
.settings-tabs {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.settings-tab {
  padding-bottom: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.2s;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-size: 1rem;
}

.settings-tab:hover,
.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Settings List (Rows) */
.settings-list {
  display: flex;
  flex-direction: column;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

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

.setting-info {
  flex: 1;
}

.setting-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  display: block;
}

.setting-value {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.setting-action {
  margin-left: 2rem;
  font-size: 0.9rem;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-weight: 600;
}

/* System Messages Styling Update */
.system-messages {
    background: transparent;
    border: none;
    border-radius: 0;
}
.message-item {
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    border-radius: 8px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  h1 {
      font-size: 2.25rem;
  }
  
  .list-header, .site-row {
      grid-template-columns: 1fr 1fr; /* Simplified for mobile */
      gap: 0.5rem;
  }
  .list-header > *:nth-child(n+3), .site-row > *:nth-child(n+3) {
      display: none; /* Hide extra columns on mobile for now */
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }
  
  .profile-sidebar {
      border-right: none;
      border-bottom: 1px solid var(--border);
      padding-bottom: 1.5rem;
      margin-bottom: 1.5rem;
  }
}
