/* ==========================================================================
   C-Sky Photonic - SUPPORT PAGE
   Header + Hero + Sidebar + Support Content + Footer
   ========================================================================== */

:root {
  --dimension-size: 20vh;

  --theme-teal: #008080;
  --theme-teal-hover: #006666;
  --bg-page: #ffffff;
  --text-white: #ffffff;
  --text-dark: #1e293b;
  --border-light: #e2e8f0;

  --font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   1. RESET
   ========================================================================== */

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;

  /* IMPORTANT:
     Body must NOT scroll.
     The scrollbar belongs to .herosection.
  */
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  background: var(--bg-page);
  color: var(--text-dark);

  display: flex;
  flex-direction: column;

  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   2. HEADER / NAVBAR
   ========================================================================== */

.navbar {
  width: 100%;
  height: var(--dimension-size);

  flex: 0 0 var(--dimension-size);

  background-color: var(--theme-teal);
  color: var(--text-white);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 2rem;
  gap: 1.5rem;

  z-index: 100;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;   /* <-- add this */
  gap: 1rem;              /* vh for a horizontal gap is unusual, use rem/px instead */
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-white);
  white-space: nowrap;
}

.logo img {
  width: 70px;
  height: 70px;

  min-width: 70px;
  min-height: 70px;

  object-fit: contain;
  display: block;
}

.companyname {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Navigation */

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;

  color: var(--text-white);

font-size: 1.3rem;
  font-weight: 600;

  padding: 0.25rem 0;
}

.nav-links a::after {
  content: "";

  position: absolute;
  left: 0;
  bottom: 0;

  width: 0;
  height: 2px;

  background-color: var(--text-white);

  transition: width 0.2s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Search */

.search-box {
  min-width: 140px;
  max-width: 200px;

  padding: 0.55rem 1rem;

  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 9999px;

  background: rgba(255, 255, 255, 0.15);
  color: var(--text-white);

  font-size: 0.9rem;

  outline: none;
}

.search-box::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.search-box:focus {
  background: #ffffff;
  color: var(--text-dark);
  border-color: #ffffff;
}

/* Mobile menu button */

.mobile-toggle-btn {
  display: none;

  background: none;

  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;

  color: var(--text-white);

  font-size: 1.5rem;

  padding: 0.3rem 0.6rem;

  cursor: pointer;
}

/* ==========================================================================
   3. HERO SECTION
   ========================================================================== */

/*
   THIS IS THE MAIN PAGE SCROLL CONTAINER.

   Header
      ↓
   .herosection  ← scrollbar here
      ↓
   Footer
*/

.herosection {
  flex: 1 1 auto;

  min-height: 0;
  min-width: 0;

  display: grid;

  grid-template-columns:
    minmax(0, var(--dimension-size))
    minmax(0, 1fr);

  grid-template-rows: 1fr;

  grid-template-areas:
    "sidebar content";

  background-color: var(--bg-page);

  /* IMPORTANT */
  overflow-y: auto;
  overflow-x: hidden;
}

/* ==========================================================================
   4. SIDEBAR
   ========================================================================== */

.sidebar {
  grid-area: sidebar;

  width: var(--dimension-size);
  min-width: var(--dimension-size);
  max-width: var(--dimension-size);

  height: 100%;

  background-color: var(--theme-teal);
  color: var(--text-white);

  display: flex;
  flex-direction: column;

  padding: 1.5rem 0.75rem;
  gap: 0.75rem;

  overflow-y: auto;
  overflow-x: hidden;

  position: sticky;
  top: 0;

  align-self: start;

  z-index: 10;
}

.sidebar a {
  color: var(--text-white);

  padding: 0.7rem 0.6rem;

  border-radius: 5px;

  font-size: 0.9rem;
  font-weight: 600;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.sidebar a:hover {
  background-color: var(--theme-teal-hover);
  transform: translateX(3px);
}

/* ==========================================================================
   5. MAIN CONTENT
   ========================================================================== */

.content {
  grid-area: content;

  min-width: 0;
  min-height: 0;

  /*
     DO NOT put overflow-y:auto here.
     The scrollbar must belong to .herosection.
  */
  overflow: visible;

  padding: 5vh;
}

.content h1{
  text-align: center;
  margin-bottom: 1rem;
}

/* Support heading */

.support-title {
  margin-bottom: 4vh;
}

.support-title h4 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Main support wrapper */

.main-content {
  width: 100%;
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 2rem;
}

/* ==========================================================================
   6. SUPPORT INFORMATION
   ========================================================================== */

.support {
  width: 100%;
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 2rem;
}

.support-contact {
  width: 100%;

  padding: 1.5rem;

  border: 1px solid var(--border-light);
  border-radius: 12px;

  background: #ffffff;
}

.support-contact p {
  margin-bottom: 0.5rem;

  color: var(--text-dark);

  font-size: 1rem;
  line-height: 1.6;
}

.support-contact p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   7. DROP MESSAGE SECTION
   ========================================================================== */

.support-dm {
  width: 100%;
}

.support-dm > h4 {
  margin-bottom: 1rem;

  font-size: 1.2rem;
  color: var(--text-dark);
}

/* ==========================================================================
   8. SUPPORT FORM
   ========================================================================== */

.support-form {
  width: 100%;
  max-width: 980px;

  margin: 0 auto;
}

.support-form form {
  width: 100%;

  background: #ffffff;

  border: 1px solid #dbe7e7;
  border-radius: 16px;

  padding: 2rem;

  box-shadow: 0 10px 30px rgba(0, 80, 80, 0.06);
}

/* Two-column form */

.form-container {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 1.5rem 2.5rem;

  min-width: 0;
}

.left-section,
.right-section {
  display: flex;
  flex-direction: column;

  gap: 1.25rem;

  min-width: 0;
}

/* Form field */

.form-field {
  display: flex;
  flex-direction: column;

  gap: 0.5rem;

  min-width: 0;
}

.form-field label {
  color: #163b3b;

  font-size: 0.88rem;
  font-weight: 700;

  letter-spacing: 0.02em;
}

.form-field label span {
  color: #d14b4b;
  margin-left: 0.25rem;
}

/* Inputs */

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;

  border: 1px solid #c9dada;
  border-radius: 8px;

  background: #fbfefe;
  color: var(--text-dark);

  font-family: inherit;
  font-size: 0.95rem;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.form-field input,
.form-field select {
  height: 46px;

  padding: 0 1rem;
}

/* Select */

.form-field select {
  cursor: pointer;

  appearance: none;

  background-image:
    url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23008080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");

  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;

  padding-right: 2.5rem;
}

/* Textarea */

.form-field textarea {
  min-height: 180px;

  padding: 0.85rem 1rem;

  resize: vertical;

  line-height: 1.6;
}

/* Focus */

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--theme-teal);

  background: #ffffff;

  box-shadow:
    0 0 0 4px rgba(0, 128, 128, 0.12);
}

/* Invalid */

.form-field input.invalid,
.form-field select.invalid,
.form-field textarea.invalid {
  border-color: #d14b4b;
  background-color: #fffcfc;
}

.form-field input.invalid:focus,
.form-field select.invalid:focus,
.form-field textarea.invalid:focus {
  box-shadow:
    0 0 0 4px rgba(209, 75, 75, 0.15);
}

/* Error message */

.field-error {
  min-height: 18px;

  color: #c0392b;

  font-size: 0.78rem;

  margin-top: 0.2rem;
}

/* ==========================================================================
   9. PHONE
   ========================================================================== */

.phone-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  border: 1px solid #c9dada;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.phone-row #countryCode {
  width: 100%;
  height: 46px;
  border: 0;
  border-right: 1px solid #c9dada;
  border-radius: 0;
  background: #f2f8f8;
  color: var(--theme-teal-hover);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 0.55rem;
  min-width: 0;
}

.phone-row #phone {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 0;
  min-width: 0;
}

.phone-row #countryCode:focus,
.phone-row #phone:focus {
  outline: none;
}

.phone-row:focus-within {
  border-color: var(--theme-teal);
  box-shadow: 0 0 0 2px rgba(0, 128, 128, 0.12);
}

/* ==========================================================================
   10. BUTTON / SUBMIT
   ========================================================================== */

.submit-button {
  margin-top: 1rem;

  display: flex;
  justify-content: flex-end;
}

.submit-button button {
  min-width: 150px;

  padding: 0.75rem 1.5rem;

  border: none;
  border-radius: 8px;

  background: var(--theme-teal);
  color: #ffffff;

  font-size: 0.95rem;
  font-weight: 700;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.submit-button button:hover {
  background: var(--theme-teal-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   11. FOOTER
   ========================================================================== */

.footer {
  width: 100%;

  min-height: var(--dimension-size);

  flex: 0 0 auto;

  background-color: var(--theme-teal);
  color: var(--text-white);

  display: grid;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  gap: 1.75rem;

  padding: 1.5rem 2.5rem;

  align-items: start;
  align-content: center;

  /*
     Footer NEVER scrolls.
  */
  overflow: hidden;

  z-index: 20;
}

.footer div {
  display: flex;
  flex-direction: column;

  gap: 0.25rem;

  min-width: 0;

  align-items: flex-start;
}

.footer h4 {
  width: 100%;

  margin-bottom: 0.35rem;
  padding-bottom: 0.2rem;

  color: var(--text-white);

  font-size: 0.85rem;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.06em;

  white-space: nowrap;

  overflow: hidden;
  text-overflow: ellipsis;
}

.footer a {
  color: rgba(255, 255, 255, 0.85);

  font-size: 0.8rem;
  line-height: 1.3;

  white-space: nowrap;

  overflow: hidden;
  text-overflow: ellipsis;

  display: inline-block;

  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

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

  text-decoration: none;

  transform: translateX(3px);
}

.footer p {
  color: rgba(255, 255, 255, 0.85);

  font-size: 0.76rem;
  line-height: 1.3;

  word-break: break-word;
}

/* ==========================================================================
   12. TABLET
   ========================================================================== */

@media (max-width: 1024px) {

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .footer {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

/* ==========================================================================
   13. MOBILE
   ========================================================================== */

@media (max-width: 768px) {

  :root {
    --dimension-size: clamp(65px, 12vh, 85px);
  }

  /* IMPORTANT:
     Still no body scrollbar.
  */

  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    min-height: 100vh;
  }

  /* ---------------- HEADER ---------------- */

  .navbar {
    height: auto;
    min-height: var(--dimension-size);

    flex: 0 0 auto;

    padding: 0.8rem 1rem;

    flex-direction: row;
    flex-wrap: wrap;

    gap: 0.5rem;
  }

  .logo {
    order: 1;
  }

  .mobile-toggle-btn {
    display: block;

    order: 2;

    margin-left: auto;
  }

  .search-box {
    order: 4;

    width: 100%;
    max-width: none;
  }

  .nav-links {
    order: 3;

    width: 100%;

    display: none;

    flex-direction: column;

    gap: 0;

    background-color: var(--theme-teal-hover);

    border-radius: 8px;

    overflow: hidden;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;

    padding: 0.7rem 1rem;

    font-size: 0.95rem;

    border-bottom:
      1px solid rgba(255, 255, 255, 0.1);
  }

  /* ---------------- HERO ---------------- */

  .herosection {
    display: flex;
    flex-direction: column;

    flex: 1 1 auto;

    min-height: 0;

    /*
       IMPORTANT:
       This is the ONLY main scrollbar on mobile.
    */
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* ---------------- SIDEBAR ---------------- */

  .sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;

    height: auto;

    flex: 0 0 auto;

    flex-direction: row;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 0.6rem 0.8rem;

    gap: 0.5rem;

    white-space: nowrap;

    position: sticky;
    top: 0;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar {
    scrollbar-width: none;
  }

  .sidebar a {
    flex: 0 0 auto;

    padding: 0.5rem 0.85rem;

    font-size: 0.8rem;
  }

  /* ---------------- CONTENT ---------------- */

  .content {
    width: 100%;

    min-width: 0;

    padding: 2rem 1rem 3rem;

    overflow: visible;
  }

  .support-title {
    margin-bottom: 2rem;
  }

  .support-title h4 {
    font-size: 1.5rem;
  }

  .main-content {
    gap: 1.5rem;
  }

  /* ---------------- FORM ---------------- */

  .form-container {
    grid-template-columns: 1fr;

    gap: 1.25rem;
  }

  .support-form {
    width: 100%;
  }

  .support-form form {
    padding: 1.25rem;
  }

  .phone-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .submit-button {
    width: 100%;
  }

  .submit-button button {
    width: 100%;
  }

  /* ---------------- FOOTER ---------------- */

  .footer {
    min-height: 20vh;

    flex: 0 0 auto;

    grid-template-columns: 1fr;

    padding: 2rem 1.5rem;

    gap: 1.5rem;

    text-align: center;
  }

  .footer div {
    align-items: center;
  }

  .footer h4 {
    text-align: center;
  }
}

/* ==========================================================================
   14. SMALL MOBILE
   ========================================================================== */

@media (max-width: 480px) {

  .companyname {
    font-size: 1.05rem;
  }

  .logo img {
    width: 42px;
    height: 42px;

    min-width: 42px;
    min-height: 42px;
  }

  .content {
    padding: 1.5rem 0.8rem 2.5rem;
  }

  .support-form form {
    padding: 1rem;
    border-radius: 12px;
  }

  .support-contact {
    padding: 1rem;
  }
}


/* =========================================================
   SUPPORT MOBILE FLOW SAFEGUARD
   Keep the full support form in normal page flow so header/footer
   cannot cover the content on short or narrow screens.
   ========================================================= */
@media (max-width: 768px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .herosection {
    height: auto !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
  }

  .sidebar {
    position: static !important;
  }

  .content {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .footer {
    position: static !important;
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 20vh !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
