/* ============================================================
   THESEIRA.COM.AU — Main Stylesheet
   Family Portal | Perth, Western Australia
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800;900&display=swap');

/* ============ CSS VARIABLES (Theme) ============ */
:root {
  /* Brand colours — Ocean (default) */
  --primary:        #1B9AAA;
  --primary-dark:   #0D7A87;
  --primary-light:  #DCF3F6;

  --accent:         #F4A261;
  --accent-dark:    #D9803E;
  --accent-light:   #FEE9D6;

  --coral:          #E76F51;

  /* Neutrals */
  --bg:             #FFFCF7;
  --surface:        #FFFFFF;
  --text:           #1E293B;
  --text-muted:     #64748B;
  --border:         #E2E8F0;

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow:     0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.14);

  /* Shape */
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Layout */
  --nav-height: 68px;
  --font:       'Nunito', sans-serif;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); }

/* ============ LAYOUT ============ */
.container    { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 760px;  margin: 0 auto; padding: 0 24px; }

/* ============ NAVIGATION ============ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255,252,247,0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
}
.nav-logo span { color: var(--primary); }
.nav-logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem; font-weight: 900;
  flex-shrink: 0;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
}
.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.18s;
}
.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active { color: var(--primary); background: var(--primary-light); }
.nav-user {
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--primary-light);
  flex-shrink: 0;
}
.avatar-initials {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 0.8rem;
  border: 2px solid var(--primary-light);
  flex-shrink: 0;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.92rem; font-weight: 700;
  cursor: pointer; transition: all 0.18s;
  border: 2px solid transparent;
  text-decoration: none; white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 2px 10px rgba(27,154,170,0.28);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark); color: white;
  box-shadow: 0 4px 18px rgba(27,154,170,0.38);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent); color: white;
  box-shadow: 0 2px 10px rgba(244,162,97,0.28);
}
.btn-accent:hover:not(:disabled) {
  background: var(--accent-dark); color: white;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent; border-color: var(--border); color: var(--text);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent; color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--primary-light); color: var(--primary);
}

.btn-danger {
  background: #FEE2E2; color: #DC2626;
}
.btn-danger:hover:not(:disabled) {
  background: #DC2626; color: white;
}

.btn-google {
  background: white; border-color: var(--border); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-google:hover:not(:disabled) {
  box-shadow: var(--shadow); transform: translateY(-2px);
}

.btn-lg  { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm  { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-icon {
  padding: 8px; border-radius: 8px; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.22s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-body { padding: 24px; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-weight: 700; font-size: 0.85rem;
  color: var(--text); margin-bottom: 6px;
}
.form-input,
.form-textarea,
.form-select {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius); font-family: var(--font);
  font-size: 0.92rem; color: var(--text);
  background: var(--surface); transition: border-color 0.18s; outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,154,170,0.12);
}
.form-textarea { resize: vertical; min-height: 100px; }

/* ============ LOADING ============ */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; gap: 16px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen p { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }

/* ============ TOAST ============ */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 700;
  box-shadow: var(--shadow-lg); color: white;
  background: var(--text);
  animation: toastIn 0.28s ease; max-width: 320px;
}
.toast.success { background: #10B981; }
.toast.error   { background: #DC2626; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px;
  max-height: 88vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: none; background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.1rem; transition: all 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 28px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--surface); z-index: 2;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============ INDEX PAGE HERO ============ */
.hero-section {
  padding: 90px 24px 80px;
  background: linear-gradient(160deg, #FFF9F0 0%, #E6F4F8 55%, #FFF0E8 100%);
  text-align: center; position: relative; overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; top: -100px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(27,154,170,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute; bottom: -100px; right: -80px;
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(244,162,97,0.09) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary);
  padding: 5px 16px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 800;
  margin-bottom: 20px; letter-spacing: 0.03em;
}
.hero-section h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900; line-height: 1.12;
  margin-bottom: 18px;
}
.hero-section h1 span { color: var(--primary); }
.hero-section p {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 520px; margin: 0 auto 36px; line-height: 1.75;
}
.wave-divider { overflow: hidden; line-height: 0; }
.wave-divider svg { display: block; width: 100%; }

/* ============ FEATURES GRID ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-top: 16px;
}
.feature-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s;
}
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.feature-card p  { font-size: 0.87rem; color: var(--text-muted); line-height: 1.65; }

/* ============ CTA STRIP ============ */
.cta-strip {
  background: linear-gradient(135deg, var(--primary) 0%, #2DD4BF 100%);
  padding: 64px 24px; text-align: center;
}
.cta-strip h2 { font-size: 1.9rem; font-weight: 900; color: white; margin-bottom: 10px; }
.cta-strip p  { color: rgba(255,255,255,0.85); margin-bottom: 32px; font-size: 0.97rem; }

/* ============ FOOTER ============ */
footer {
  background: var(--text); color: rgba(255,255,255,0.55);
  padding: 28px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: rgba(255,255,255,0.85); font-size: 0.9rem;
}
footer p { font-size: 0.8rem; }

/* ============ DASHBOARD ============ */
.page-title { font-size: 1.9rem; font-weight: 900; margin-bottom: 6px; }
.page-subtitle { color: var(--text-muted); font-size: 0.95rem; }

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}
.member-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: all 0.22s; text-decoration: none; color: var(--text);
  display: block;
}
.member-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); color: var(--text); }
.member-card-banner { height: 72px; }
.member-card-body { padding: 0 18px 20px; text-align: center; }
.member-avatar-wrap { margin: -38px auto 12px; display: flex; justify-content: center; }
.member-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  border: 4px solid white; object-fit: cover;
  background: var(--primary-light);
}
.member-avatar-initials {
  width: 76px; height: 76px; border-radius: 50%;
  border: 4px solid white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.6rem; font-weight: 800;
}
.member-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.member-card span { font-size: 0.8rem; color: var(--text-muted); }
.member-card .view-link {
  display: inline-block; margin-top: 12px;
  font-size: 0.8rem; font-weight: 700;
  color: var(--primary); padding: 5px 14px;
  background: var(--primary-light); border-radius: 999px;
}

/* ============ PROFILE PAGE ============ */
.profile-wrapper { min-height: calc(100vh - var(--nav-height)); }

/* Builder toolbar */
.builder-bar {
  position: sticky; top: var(--nav-height); z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.builder-bar-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.builder-bar-left  { display: flex; align-items: center; gap: 8px; }
.builder-bar-right { display: flex; align-items: center; gap: 8px; }

/* Add block dropdown */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 210px; z-index: 100; overflow: hidden;
}
.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 14px; border: none;
  background: none; cursor: pointer; font-family: var(--font);
  font-size: 0.88rem; font-weight: 700; color: var(--text);
  text-align: left; transition: background 0.15s;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-item-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
  font-size: 0.85rem;
}

/* Blocks container */
.blocks-container { display: flex; flex-direction: column; gap: 20px; padding: 28px 0; }

/* Block wrapper with edit controls */
.block-wrapper { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.block-wrapper.editable { outline: 2px dashed transparent; outline-offset: 2px; transition: outline-color 0.2s; }
.block-wrapper.editable:hover { outline-color: var(--primary); }
.block-edit-controls {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 5px; z-index: 20;
  opacity: 0; transition: opacity 0.18s;
}
.block-wrapper.editable:hover .block-edit-controls { opacity: 1; }
.block-edit-controls button {
  width: 30px; height: 30px; border-radius: 7px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: white; box-shadow: var(--shadow-sm);
  color: var(--text-muted); font-size: 0.8rem; transition: all 0.15s;
}
.block-edit-controls button:hover { background: var(--primary); color: white; }
.block-edit-controls button.del:hover { background: #DC2626; }

/* ---- BLOCK: Hero ---- */
.block-hero {
  padding: 64px 40px; text-align: center;
  position: relative; color: white;
}
.block-hero-photo {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 4px solid rgba(255,255,255,0.75);
  margin: 0 auto 18px;
}
.block-hero-initials {
  width: 96px; height: 96px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900; color: white;
  margin: 0 auto 18px;
}
.block-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900;
  margin-bottom: 10px; text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.block-hero p {
  font-size: 1.1rem; opacity: 0.9; max-width: 460px; margin: 0 auto;
}

/* ---- BLOCK: About ---- */
.block-about { background: var(--surface); padding: 36px 40px; }
.block-title {
  font-size: 1.3rem; font-weight: 800;
  color: var(--primary); margin-bottom: 14px;
}
.block-about p { color: var(--text); line-height: 1.8; white-space: pre-wrap; }

/* ---- BLOCK: Links ---- */
.block-links { background: var(--surface); padding: 36px 40px; }
.links-list { display: flex; flex-direction: column; gap: 10px; }
.link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--bg);
  border-radius: var(--radius); font-weight: 700;
  font-size: 0.92rem; color: var(--text);
  border: 2px solid transparent; transition: all 0.18s;
  text-decoration: none;
}
.link-item:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-light);
}
.link-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}

/* ---- BLOCK: Gallery ---- */
.block-gallery { background: var(--surface); padding: 36px 40px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.gallery-item {
  aspect-ratio: 1; border-radius: var(--radius);
  overflow: hidden; background: var(--bg);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ---- BLOCK: Text ---- */
.block-text { background: var(--surface); padding: 36px 40px; }
.block-text p { color: var(--text); line-height: 1.8; white-space: pre-wrap; }

/* ---- Empty page state ---- */
.empty-page {
  text-align: center; padding: 72px 24px; color: var(--text-muted);
}
.empty-page h3 { font-size: 1.2rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.empty-page p  { margin-bottom: 24px; font-size: 0.92rem; }

/* Hero theme colour swatches */
.theme-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-swatch {
  width: 40px; height: 40px; border-radius: 10px;
  cursor: pointer; border: 3px solid transparent;
  transition: all 0.18s; flex-shrink: 0;
}
.theme-swatch.selected, .theme-swatch:hover { border-color: var(--text); transform: scale(1.1); }

/* Link editor rows */
.link-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px;
}
.link-row .form-input { flex: 1; }
.link-row .remove-btn {
  width: 32px; height: 36px; border-radius: 8px;
  border: none; background: #FEE2E2; color: #DC2626;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.9rem; transition: all 0.15s;
}
.link-row .remove-btn:hover { background: #DC2626; color: white; }

/* ============ UTILITY CLASSES ============ */
.hidden        { display: none !important; }
.section       { padding: 60px 0; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-1  { margin-bottom: 4px; }
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mb-8  { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.fw-800 { font-weight: 800; }

/* ============ COLOUR THEMES ============
   Apply class to <body> to switch the site's colour scheme.
   ============================================ */
body.theme-sunset  { --primary: #C75B2A; --primary-dark: #A84920; --primary-light: #FDE8D8; --accent: #E76F51; }
body.theme-forest  { --primary: #059669; --primary-dark: #047857; --primary-light: #D1FAE5; --accent: #34D399; }
body.theme-lavender{ --primary: #7C3AED; --primary-dark: #6D28D9; --primary-light: #EDE9FE; --accent: #A78BFA; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav-links { display: none; }

  .hero-section { padding: 60px 20px 52px; }

  .block-hero  { padding: 48px 24px; }
  .block-about,
  .block-links,
  .block-gallery,
  .block-text  { padding: 28px 22px; }

  .members-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }

  .builder-bar-inner { gap: 8px; }
  .modal { max-height: 94vh; }

  .modal-header, .modal-body, .modal-footer { padding-left: 20px; padding-right: 20px; }
}
