/* === Concept Sites Styles === */

:root {
  --navy-dark: #1a1a2e;
  --navy-mid: #16213e;
  --navy-light: #0f3460;
  --red-accent: #dc2626;
  --red-dark: #991b1b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ══════════════════════════════
   SPINNER (shared)
   ══════════════════════════════ */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--navy-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* ══════════════════════════════
   HOME PAGE
   ══════════════════════════════ */
.home-body {
  background: var(--white);
}

.home-hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 80px 24px 64px;
}

.home-hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.home-hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

.home-sites-section {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.home-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 20px;
}

.home-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.home-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.home-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.home-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 6px;
}

.home-card-client {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 20px;
}

.home-empty {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
  color: var(--gray-400);
  font-size: 16px;
}

.home-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.home-footer {
  text-align: center;
  padding: 24px;
  color: var(--gray-400);
  font-size: 13px;
  border-top: 1px solid var(--gray-200);
}

/* ══════════════════════════════
   PIN MODAL (home page)
   ══════════════════════════════ */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.pin-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 360px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}

.pin-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
}

.pin-close:hover {
  color: var(--gray-800);
}

.pin-modal h2 {
  font-size: 22px;
  color: var(--navy-dark);
  margin-bottom: 8px;
}

.pin-desc {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.pin-input-wrap {
  margin-bottom: 20px;
}

.pin-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.pin-input:focus {
  border-color: var(--navy-light);
}

.pin-error {
  color: var(--red-accent);
  font-size: 13px;
  margin-top: 8px;
}

.pin-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

/* ══════════════════════════════
   PIN GATE (c.html full-page)
   ══════════════════════════════ */
.pin-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}

.pin-gate-inner {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.pin-gate-inner h2 {
  font-size: 22px;
  color: var(--navy-dark);
  margin-bottom: 8px;
}

/* ══════════════════════════════
   ACCESS DENIED
   ══════════════════════════════ */
.access-denied {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--navy-dark);
  color: var(--white);
}

.access-denied h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.access-denied p {
  color: var(--gray-400);
  font-size: 16px;
}

/* ══════════════════════════════
   ADMIN DASHBOARD
   ══════════════════════════════ */
.dash-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-light));
  color: var(--white);
  padding: 40px 32px 32px;
}

.dash-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.dash-header h1 {
  font-size: 28px;
  font-weight: 700;
}

.badge {
  background: var(--red-accent);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}

.dash-subtitle {
  color: rgba(255,255,255,0.65);
  font-size: 15px;
}

.dash-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-600);
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h2 {
  font-size: 22px;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
  max-width: 400px;
}

/* Sites Grid */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* Site Card */
.site-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-count {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
}

.status-draft {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-shared {
  background: #dcfce7;
  color: #166534;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
  color: var(--red-accent);
  background: #fef2f2;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--navy-dark);
}

.card-client {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.card-dates {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 12px;
}

/* PIN field in admin card */
.card-pin {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.card-pin label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

.pin-field {
  flex: 1;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: monospace;
  letter-spacing: 1px;
}

.pin-field:focus {
  border-color: var(--navy-light);
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ══════════════════════════════
   BUTTONS
   ══════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--navy-light), var(--navy-dark));
  color: var(--white);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-600);
}

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

.btn-outline {
  background: transparent;
  color: var(--navy-light);
  border: 1px solid var(--gray-200);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--navy-light);
}

/* ══════════════════════════════
   TOAST
   ══════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy-dark);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */
@media (max-width: 600px) {
  .home-hero {
    padding: 56px 16px 44px;
  }

  .home-hero h1 {
    font-size: 30px;
  }

  .home-hero-sub {
    font-size: 15px;
  }

  .home-main {
    padding: 28px 12px 60px;
  }

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

  .dash-header {
    padding: 28px 16px 24px;
  }

  .dash-header h1 {
    font-size: 22px;
  }

  .dash-main {
    padding: 20px 12px;
  }

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

  .card-dates {
    flex-direction: column;
    gap: 4px;
  }

  .card-pin {
    flex-wrap: wrap;
  }

  .pin-field {
    width: 100%;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn {
    width: 100%;
  }
}