/* HJDating Web — Dark Theme
   Colors from iOS AppTheme (config.ts THEME object) */

/* ================================================================
   CSS CUSTOM PROPERTIES
   ================================================================ */
:root {
  --bg: #000000;
  --surface-primary: #262629;
  --surface-secondary: #333336;
  --surface-tertiary: #404043;
  --accent: #A6A6AB;
  --text-primary: #EDEDF0;
  --text-secondary: #9999A1;
  --text-tertiary: #6E6E75;
  --coral: #FF6B6B;
  --teal: #4DD9C7;
  --gold: #FFD133;
  --basic-pink: #E68CA6;
  --divider: #2C2C2E;
  --border: #3A3A3C;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  --transition: 180ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--coral); }
a.btn:hover { color: inherit; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

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

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: 2rem 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ================================================================
   NAVIGATION
   ================================================================ */
.navbar {
  background: var(--surface-primary);
  border-bottom: 1px solid var(--divider);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}

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

.navbar-brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

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

.navbar-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .navbar-toggle { display: block; }
  .navbar-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface-primary);
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--divider);
    gap: 1rem;
  }
  .navbar-links.open { display: flex; }
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), opacity var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { filter: brightness(0.85); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-coral   { background: var(--coral); color: #fff; }
.btn-teal    { background: var(--teal); color: #000; }
.btn-gold    { background: var(--gold); color: #000; }
.btn-pink    { background: var(--basic-pink); color: #000; }
.btn-surface { background: var(--surface-secondary); color: var(--text-primary); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-danger { background: var(--coral); color: #fff; }
.btn-success { background: var(--teal); color: #000; }
.btn-warning { background: var(--gold); color: #000; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface-primary);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition);
}

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

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

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

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

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--divider);
}

/* Stat cards for admin dashboard */
.stat-card {
  background: var(--surface-primary);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.stat-card.coral .stat-value { color: var(--coral); }
.stat-card.teal .stat-value  { color: var(--teal); }
.stat-card.gold .stat-value  { color: var(--gold); }
.stat-card.pink .stat-value  { color: var(--basic-pink); }

/* Grid for cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control::placeholder { color: var(--text-tertiary); }

.form-control:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(77, 217, 199, 0.15);
}

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239999A1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--teal);
}

.form-inline {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-inline .form-group { margin-bottom: 0; flex: 1; }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--divider);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--surface-secondary);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

td {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--divider);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--surface-primary);
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  vertical-align: middle;
}

.badge-coral  { background: rgba(255, 107, 107, 0.18); color: var(--coral); }
.badge-teal   { background: rgba(77, 217, 199, 0.18); color: var(--teal); }
.badge-gold   { background: rgba(255, 209, 51, 0.18); color: var(--gold); }
.badge-pink   { background: rgba(230, 140, 166, 0.18); color: var(--basic-pink); }
.badge-accent { background: rgba(166, 166, 171, 0.18); color: var(--accent); }
.badge-free   { background: rgba(150, 150, 160, 0.18); color: var(--text-secondary); }

.badge-low      { background: rgba(77, 217, 199, 0.18); color: var(--teal); }
.badge-medium   { background: rgba(255, 209, 51, 0.18); color: var(--gold); }
.badge-high     { background: rgba(255, 107, 107, 0.18); color: var(--coral); }
.badge-critical { background: rgba(255, 60, 60, 0.25); color: #ff4444; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid;
}

.alert-success {
  background: rgba(77, 217, 199, 0.1);
  border-color: rgba(77, 217, 199, 0.3);
  color: var(--teal);
}

.alert-error {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.3);
  color: var(--coral);
}

.alert-warning {
  background: rgba(255, 209, 51, 0.1);
  border-color: rgba(255, 209, 51, 0.3);
  color: var(--gold);
}

.alert-info {
  background: rgba(166, 166, 171, 0.1);
  border-color: rgba(166, 166, 171, 0.3);
  color: var(--accent);
}

/* ================================================================
   ADMIN / SUPPORT DASHBOARD LAYOUT
   ================================================================ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--surface-primary);
  border-right: 1px solid var(--divider);
  padding: 1rem 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 1.25rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--divider);
  margin-bottom: 0.75rem;
}

.sidebar-brand img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

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

.sidebar-nav li a {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
  background: var(--surface-secondary);
  color: var(--text-primary);
}

.sidebar-nav li a.active {
  color: var(--teal);
  background: rgba(77, 217, 199, 0.06);
  border-left-color: var(--teal);
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--divider);
  margin-top: auto;
}

.dashboard-main {
  flex: 1;
  padding: 1.5rem 2rem;
  min-width: 0;
  background: var(--bg);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--divider);
}

.dashboard-header h1 {
  font-size: 1.5rem;
}

/* Tab panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -220px;
    top: 0;
    z-index: 200;
    transition: left var(--transition);
  }
  .sidebar.open { left: 0; }
  .dashboard-main { padding: 1rem; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
  }
  .sidebar.open ~ .sidebar-overlay { display: block; }
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
  text-align: center;
  padding: 4rem 1rem;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-xl);
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ================================================================
   FEATURE CARDS
   ================================================================ */
.features {
  padding: 3rem 0;
}

.features h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface-primary);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.feature-card .feature-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ================================================================
   AUTH CARD (login pages)
   ================================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}

.auth-card {
  background: var(--surface-primary);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-card .auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-card .auth-brand img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.auth-card .auth-brand h1 {
  font-size: 1.35rem;
}

.auth-card .auth-brand p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ================================================================
   PHOTO GRID (flagged photos)
   ================================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.photo-card {
  background: var(--surface-primary);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.photo-card .photo-actions {
  padding: 0.6rem;
  display: flex;
  gap: 0.5rem;
}

.photo-card .photo-actions .btn { flex: 1; }

/* ================================================================
   SEARCH
   ================================================================ */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.search-bar .form-control { flex: 1; }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: var(--surface-primary);
  border-top: 1px solid var(--divider);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer a {
  color: var(--text-secondary);
  margin: 0 0.5rem;
}

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

/* ================================================================
   LEGAL PAGES
   ================================================================ */
.legal {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.legal h1 {
  margin-bottom: 0.5rem;
}

.legal .last-updated {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 2rem;
}

.legal h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.legal h3 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.legal p, .legal li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal ul, .legal ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal li { margin-bottom: 0.35rem; }

/* ================================================================
   CONTACT FORM
   ================================================================ */
.contact-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ================================================================
   UTILITY
   ================================================================ */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none !important; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.loading {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
