/* ============================================================
   Dayamond Matchmakers — Global Styles
   Palette: deep navy (#1a1a2e), gold (#c9a84c), cream (#faf7f2)
   ============================================================ */

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

:root {
  --navy:   #1a1a2e;
  --navy-2: #16213e;
  --gold:   #c9a84c;
  --gold-l: #e8d08a;
  --cream:  #faf7f2;
  --cream-2:#f0ebe3;
  --text:   #2d2d2d;
  --muted:  #6c757d;
  --red:    #c0392b;
  --green:  #27ae60;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.10);
  --nav-h:  80px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Georgia', serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: 'Georgia', serif; color: var(--navy); line-height: 1.25; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { line-height: 1.7; }

/* ---- Layout helpers ---- */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.main-content { flex: 1; padding: 2rem 0; }

/* ---- Navbar ---- */
.navbar {
  background: var(--navy);
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.navbar-brand {
  color: var(--gold);
  font-size: 1.4rem;
  font-weight: bold;
  letter-spacing: .04em;
}
.navbar-brand:hover { text-decoration: none; color: var(--gold-l); }
.navbar-nav { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.navbar-nav a { color: #ccc; font-size: .95rem; transition: color .2s; }
.navbar-nav a:hover { color: var(--gold); text-decoration: none; }
.navbar-nav .btn-nav {
  background: var(--gold);
  color: var(--navy);
  padding: .4rem 1rem;
  border-radius: var(--radius);
  font-weight: bold;
}
.navbar-nav .btn-nav:hover { background: var(--gold-l); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--navy);  color: #fff; }
.btn-gold     { background: var(--gold);  color: var(--navy); font-weight: bold; }
.btn-outline  { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-danger   { background: var(--red);   color: #fff; }
.btn-sm       { padding: .35rem .9rem; font-size: .875rem; }
.btn-block    { display: block; width: 100%; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.1rem; }
label { display: block; margin-bottom: .35rem; font-weight: bold; font-size: .9rem; color: var(--navy); }
.form-control {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid #ccc;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,.2); }
.form-control.is-invalid { border-color: var(--red); }
.invalid-feedback { color: var(--red); font-size: .82rem; margin-top: .25rem; }

/* ---- Cards ---- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body  { padding: 1.5rem; }
.card-title { font-size: 1.1rem; margin-bottom: .5rem; }
.card-img-top { width: 100%; height: 220px; object-fit: cover; }

/* ---- Alerts ---- */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ---- Auth pages ---- */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h) - 60px);
  padding: 2rem 1rem;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.auth-card .subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-divider { text-align: center; color: var(--muted); margin: 1rem 0; font-size: .85rem; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #0f3460 100%);
  color: #fff;
  padding: 5rem 1.25rem;
  text-align: center;
}
.hero h1 { color: var(--gold); font-size: 2.8rem; margin-bottom: 1rem; }
.hero p   { font-size: 1.15rem; opacity: .85; max-width: 580px; margin: 0 auto 2rem; }

/* ---- Profile grid ---- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.profile-card { transition: transform .2s, box-shadow .2s; }
.profile-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.profile-card .meta { color: var(--muted); font-size: .83rem; margin-top: .35rem; }
.profile-card .avatar-placeholder {
  width: 100%;
  height: 220px;
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--muted);
}

/* ---- Profile view ---- */
.profile-view { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; align-items: start; }
.profile-view .photo-stack img { width: 100%; border-radius: var(--radius); margin-bottom: .5rem; }
.profile-detail-list { list-style: none; }
.profile-detail-list li {
  display: flex;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--cream-2);
  font-size: .95rem;
}
.profile-detail-list li .label { color: var(--muted); min-width: 140px; font-size: .85rem; }

/* ---- Photo grid ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: .75rem; margin: 1rem 0; }
.photo-thumb { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .photo-actions {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  opacity: 0;
  transition: opacity .2s;
}
.photo-thumb:hover .photo-actions { opacity: 1; }
.photo-thumb .badge-primary {
  position: absolute; top: 6px; left: 6px;
  background: var(--gold); color: var(--navy);
  font-size: .7rem; font-weight: bold;
  padding: 2px 7px; border-radius: 20px;
}

/* ---- Stars ---- */
.stars { color: var(--gold); font-size: 1.1rem; letter-spacing: .1em; }

/* ---- Dashboard stats ---- */
.stat-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.stat-card {
  flex: 1; min-width: 150px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.stat-card .stat-number { font-size: 2rem; font-weight: bold; color: var(--navy); }
.stat-card .stat-label  { color: var(--muted); font-size: .85rem; margin-top: .25rem; }

/* ---- Search bar ---- */
.search-bar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.search-bar .form-control { flex: 1; min-width: 140px; }

/* ---- Footer ---- */
footer {
  background: var(--navy);
  color: #aaa;
  text-align: center;
  padding: 1.2rem;
  font-size: .85rem;
  margin-top: auto;
}
footer a { color: var(--gold-l); }

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-gold   { color: var(--gold); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }

/* ---- Date input fix: prevent type=date from overflowing its grid cell ---- */
input[type="date"].form-control {
  min-width: 0;
  width: 100%;
}

/* ---- Hamburger button ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  z-index: 200;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: #ccc;
  border-radius: 2px;
  transition: all .25s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p  { font-size: 1rem; }
  .profile-view { grid-template-columns: 1fr; }
  .stat-row { flex-direction: column; }

  /* Dashboard: profile photo + details stacks vertically */
  .dashboard-summary-grid {
    grid-template-columns: 1fr !important;
  }

  /* Profile edit form: two-column pairs collapse to one column */
  .profile-form-row {
    grid-template-columns: 1fr !important;
  }

  /* Navbar mobile */
  .nav-toggle { display: flex; }

  .navbar { height: auto; min-height: var(--nav-h); flex-wrap: wrap; }
  .navbar .container { flex-wrap: wrap; align-items: center; padding-top: .75rem; padding-bottom: .75rem; }

  .navbar-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    background: var(--navy-2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .35s ease, opacity .3s ease, padding .3s ease;
    padding: 0;
  }
  .navbar-nav.open {
    max-height: 400px;
    opacity: 1;
    padding: .5rem 0 1.25rem;
  }
  .navbar-nav li {
    width: 100%;
    padding: .65rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    transform: translateY(-6px);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
  }
  .navbar-nav.open li {
    transform: translateY(0);
    opacity: 1;
  }
  .navbar-nav.open li:nth-child(1) { transition-delay: .05s; }
  .navbar-nav.open li:nth-child(2) { transition-delay: .1s; }
  .navbar-nav.open li:nth-child(3) { transition-delay: .15s; }
  .navbar-nav.open li:nth-child(4) { transition-delay: .2s; }
  .navbar-nav.open li:nth-child(5) { transition-delay: .25s; }
  .navbar-nav.open li:nth-child(6) { transition-delay: .3s; }
  .navbar-nav li:last-child { border-bottom: none; }
  .navbar-nav a { font-size: 1rem; display: block; }
  .navbar-nav .btn-nav { display: inline-block; }

  /* Navbar brand text smaller on mobile */
  .navbar-brand span { font-size: 1rem; }
}

@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.25rem; }
  .navbar-brand span { font-size: .9rem; }
  .navbar-brand img { height: 42px; }
}
