/* ============================================================
   Nataly's Salon — site styles
   ============================================================ */

@font-face {
  font-family: 'Abigail';
  src: url('../assets/fonts/ABIGAIL.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --teal: #069dc4;
  --teal-hover: #0286ab;
  --maroon: #8d1230;
  --green-text: #2f5b3c;
  --green-hover: #2eb332;
  --pale-green: #ddeadc;
  --line-blue: #d0dee3;
  --body-text: #333333;
  --page-bg-top: #8eb095;
  --page-bg-bottom: #d0dee3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12pt;
  color: var(--body-text);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, var(--page-bg-top), var(--page-bg-bottom));
  overflow-x: auto;
}

button { font-family: inherit; }

/* ---------- App shell ----------
   Fluid/"rubbery": the shell and stage scale with the viewport between a
   min and max size (clamp()), instead of a fixed 800x700 px block. */

.app-shell {
  position: relative;
  width: min(94vw, 1400px);
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vh, 24px);
}

.shell-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 64px);
}

.nav-col {
  position: static;
  width: clamp(90px, 11vw, 170px);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vh, 70px);
}

.nav-col.nav-right { width: clamp(90px, 11vw, 170px); }

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Abigail', cursive;
  font-size: clamp(19px, 2.5vw, 34px);
  color: var(--green-text);
  padding: 4px 2px;
  line-height: 1;
  transition: transform .2s ease, color .2s ease, text-shadow .2s ease;
  text-shadow: none;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--teal-hover);
  transform: translateX(-3px);
  text-shadow: 0 0 12px rgba(255,255,255,0.9);
}

.nav-btn:active,
.nav-btn.is-selected {
  color: var(--maroon);
}

.nav-col.nav-right .nav-btn:hover {
  transform: translateX(3px);
}

/* ---------- Coverflow stage ---------- */

.stage-viewport {
  /* scales with viewport width, but also backs off on short/wide windows
     so a 530-tall stage never forces the page to scroll vertically */
  width: clamp(320px, min(38vw, 78vh * 400 / 530), 620px);
  aspect-ratio: 400 / 530;
  perspective: 1600px;
  position: relative;
  flex: 0 0 auto;
}

.coverflow-stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.page-panel {
  position: absolute;
  inset: 0;
  background: #fff;
  border: 10px solid #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 1s cubic-bezier(.45,0,.2,1), opacity .85s ease-in-out;
  overflow: hidden;
  /* Flex column so any content area (.page-content, .services-panels) can
     flex-grow into the remaining height and scroll internally instead of
     silently clipping. */
  display: flex;
  flex-direction: column;
}

.page-panel > .title-bar,
.page-panel > .image-container,
.page-panel > .services-tabs {
  flex: 0 0 auto;
}

.page-panel.is-active {
  transform: rotateY(0deg) translateZ(0);
  opacity: 1;
  z-index: 3;
  pointer-events: auto;
}

/* Only two "parked" states: off to the left, or off to the right. A panel
   animates directly between is-active and whichever parked state applies,
   and then simply stays there — nothing later resets it back through
   rotateY(0), which was causing the outgoing page to visibly flip a
   second time after the incoming page had already taken over. */
.page-panel.pos-left,
.page-panel.pos-right {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.page-panel.pos-left  { transform: rotateY(-100deg) translateZ(-80px); }
.page-panel.pos-right { transform: rotateY(100deg)  translateZ(-80px); }

/* Used for one animation frame to instantly park an incoming panel on the
   correct side (no visible motion) before animating it in on the next
   frame — otherwise a panel re-entering from a new direction would first
   visibly swing across from its old parked side to the new one. */
.page-panel.no-transition { transition: none !important; }

/* ---------- Shared page building blocks ---------- */

.title-bar {
  background: var(--teal);
  color: #fff;
  font-family: Tahoma, Geneva, sans-serif;
  font-weight: bold;
  padding: 2px 10px;
  height: 25px;
  line-height: 21px;
  border-bottom: 1px solid #fff;
}

.title-bar.second { height: 24px; border-bottom: none; }

.image-container {
  border: 1px solid #fff;
  padding-left: 4px;
  background: #fff;
  overflow: hidden;
}

.image-container img { display: block; }

/* Keep the header photo flush with the title bar and content edges above
   and below it — .image-container has a left-only padding, which is fine
   for small inline thumbnails but throws off alignment on a full-width
   hero image. */
.image-container.hero-image {
  padding-left: 0;
  border-left: none;
  border-right: none;
}

.image-container.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.page-content {
  background: var(--pale-green);
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  padding: 4px;
  overflow-y: auto;
  color: #000;
  /* fill the remaining vertical space inside the flex-column .page-panel
     and scroll internally rather than getting clipped */
  flex: 1 1 auto;
  min-height: 0;
}

.page-content.contact-info {
  flex: 0 0 auto;
  overflow: visible;
}

.page-content p { margin: 0 0 10px; line-height: 1.4; }

.page-content a, .link-text a {
  color: var(--teal);
  text-decoration: underline;
  cursor: pointer;
}
.page-content a:hover, .link-text a:hover { color: var(--green-hover); }

.content-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.content-row .link-text { flex: 1; }

.content-image {
  border: 2px solid #fff;
  flex-shrink: 0;
}

/* ---------- Home page ---------- */

.page-home { padding: 0; }
.page-home img { flex: 1 1 auto; min-height: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Services page ---------- */

.services-tabs {
  background: var(--teal);
  display: flex;
  gap: 2px;
  padding: 2px 4px 0;
  height: 24px;
  border-bottom: 1px solid #fff;
}

.services-tab {
  background: none;
  border: none;
  color: #fff;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 10pt;
  cursor: pointer;
  padding: 2px 6px 4px;
}

.services-tab:hover { color: var(--maroon); }
.services-tab.is-active {
  color: var(--maroon);
  border-bottom: 2px solid #fff;
}

.services-panels {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  perspective: 1200px;
}

.services-panel {
  position: absolute;
  inset: 0;
  background: var(--pale-green);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform .95s cubic-bezier(.45,0,.2,1), opacity .8s ease-in-out;
  padding: 4px;
  overflow-y: auto;
}

.services-panel.is-active {
  transform: rotateX(0deg) translateZ(0);
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

/* Same directional "park on one side, animate straight in from the other,
   never reset back through zero" model used for the main page transition
   — just flipping around the horizontal axis (rotateX) instead of the
   vertical one (rotateY), so it reads as a distinct but equally clean
   motion. */
.services-panel.pos-up,
.services-panel.pos-down {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.services-panel.pos-up   { transform: rotateX(90deg)  translateZ(-60px); }
.services-panel.pos-down { transform: rotateX(-90deg) translateZ(-60px); }

.services-panel.no-transition { transition: none !important; }

.panel-title {
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: var(--maroon);
  padding: 4px 6px;
  border-bottom: 1px solid var(--line-blue);
}

table.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5pt;
}

table.price-table td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--line-blue);
}

table.price-table tr:nth-child(even) td { background: rgba(255,255,255,0.5); }
table.price-table tr:hover td { background: #cff4d0; }

.price-table .col-duration,
.price-table .col-price { text-align: right; white-space: nowrap; }
.price-table .col-price { font-weight: bold; }

/* Longer price lists (e.g. Waxing) legitimately exceed the panel height
   and scroll internally — style the scrollbar so that reads as
   intentional rather than a glitch. */
.services-panel,
.page-content,
.news-list {
  scrollbar-width: thin;
  scrollbar-color: var(--teal) transparent;
}
.services-panel::-webkit-scrollbar,
.page-content::-webkit-scrollbar,
.news-list::-webkit-scrollbar { width: 7px; }
.services-panel::-webkit-scrollbar-thumb,
.page-content::-webkit-scrollbar-thumb,
.news-list::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 4px; }
.services-panel::-webkit-scrollbar-track,
.page-content::-webkit-scrollbar-track,
.news-list::-webkit-scrollbar-track { background: transparent; }

.price-loading, .price-empty {
  padding: 20px 10px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* ---------- News page ---------- */

.news-list { padding: 2px; overflow-y: auto; height: 100%; }

.news-item {
  display: flex;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line-blue);
}

.news-item .image-container { width: 113px; flex-shrink: 0; }
.news-item .news-body { flex: 1; min-width: 0; }
.news-date {
  text-align: right;
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: var(--maroon);
  margin-bottom: 4px;
}
.news-rule { border: none; border-top: 1px solid var(--line-blue); margin: 0 0 6px; }

/* ---------- Contact page ---------- */

.contact-info { padding: 6px 4px; }
.contact-info p { margin: 0 0 6px; }

.contact-form-wrap { padding: 8px; }

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.form-row label {
  flex: 0 0 auto;
  min-width: 45px;
  padding-top: 4px;
  font-size: 11pt;
}

.form-row select,
.form-row input[type="text"],
.form-row input[type="email"],
.form-row textarea {
  font-family: Arial, sans-serif;
  color: #422462;
  font-size: 11pt;
  border: 1px solid #bdd7bd;
  border-radius: 0;
  padding: 4px;
  flex: 1 1 80px;
  min-width: 0;
  max-width: 100%;
}

#f-title { flex: 0 1 64px; }

.form-row.actions { justify-content: center; gap: 10px; }

.btn-regular {
  font-family: Arial, sans-serif;
  font-size: 11pt;
  background: #fff;
  border: 1px solid var(--line-blue);
  padding: 5px 16px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.btn-regular:hover { background: #cff4d0; color: var(--teal-hover); }

.field-error { color: var(--maroon); font-size: 9pt; margin-top: 2px; display: block; }

/* ---------- Copyright bar ---------- */

.copyright-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  font-size: 10pt;
  color: #000;
}

.copyright-bar a {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}
.copyright-bar a:hover { color: var(--teal); }

/* ---------- Modals ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: #fff;
  border: 1px solid var(--line-blue);
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.modal-box h3 {
  margin-top: 0;
  color: var(--maroon);
  font-family: Tahoma, Geneva, sans-serif;
}

.modal-box p { white-space: pre-line; line-height: 1.5; }

.modal-box .modal-actions { text-align: right; margin-top: 16px; }

/* ---------- Responsive fallback (narrow phones) ---------- */

@media (max-width: 640px) {
  .app-shell { width: 100%; padding: 12px 0 40px; }
  .shell-row { flex-direction: column; gap: 12px; }
  .nav-col {
    flex-direction: row;
    width: 100%;
    justify-content: center;
    gap: clamp(20px, 6vw, 40px);
  }
  .stage-viewport { width: min(92vw, 420px); }
}

