﻿﻿/* ========================================
   Demographics Page - Modern Design
   Based on Figma Design Specifications
   ======================================== */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Helvetica+Neue:wght@400;500;700&display=swap');

/* === SITE HEADER === */
.site-header {
    background-color: #FFFFFF;
    padding: 8px 0;
    box-shadow: 0px 1px 5px 2px rgba(140, 142, 172, 0.25);
    width: 100%;
    max-height:96px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  width: 80%;
  flex-direction: row;
  padding: 0px;
  gap: 300px;
  height: 80px;
  flex: none;
  order: 0;
  flex-grow: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 17px;
}

.logo-container img {
    width: 60px;
    height: 60px;
}

.header-title {
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 500;
  color: #445065;
}

@media (min-width: 1300px) {
  .header-title {
    font-size: 24px;
  }
  .header-container {
    width: 80%;
  }
}
.nav-link {
  font-size: 18px;
}

@media (max-width: 1299px) {
  .nav-link {
    font-size: 14px;
  }
}
@media (max-width: 1100px) {
  .header-container {
    width: 100%;
  }
}
@media (max-width: 768px) {
  .form-group-new label {
    font-size: 12px !important;
  }
  .nav-link {
    font-size: 12px;
  }
  .header-container {
    width:100%;
    padding: 0;
    margin: 0;
    gap:100px;
  }
  .site-header {
    display:unset;
  }
}

.header-right {
    display: flex;
    align-items: center;
}

.header-nav {
    display: flex;
    gap: 32px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #353559;
  padding: 5px 0;
  transition: all 0.3s ease;
}

  .nav-link:hover {
    color: #5F97FB;
    text-decoration: none;
  }

.nav-link.active {
    font-weight: 500;
    border-bottom: 2.2px solid #5F97FB;
}

.nav-link i {
    font-size: 24px;
}

/* === MAIN CONTAINER === */
.demographics-container {
    min-height: 100vh;
    width: 100%;
}

/* === HEADER WRAPPER === */
.demographics-header-wrapper {
    width: 100%;
    max-width: 1352px;
    height: 280px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    background-color: transparent;
}

.header-contain-area {
    width: 100%;
    /* Left nav width (250px) + gap (40px) + content-area padding (64px) - wrapper padding (20px) = 334px */
    padding-left: 334px;
}

.demographics-header-wrapper .page-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 44px;
    color: #445065;
    margin: 0;
    line-height: 1.2;
    text-align: left;
}


/* === HEADER === */
.questionnaire-header {
    background-color: #FFFFFF;
    padding: 24px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.questionnaire-header .logo-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 24px;
    color: #445065;
    width: 100%;
    max-width: 1352px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === BODY LAYOUT === */
.demographics-body {
    display: flex;
    width: 100%;
    max-width: 1352px;
    margin: 0 auto;
    gap: 40px;
}

/* === LEFT NAVIGATION === */
.left-nav {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 116px; /* Header height (96px) + spacing (20px) */
    align-self: flex-start;
    max-height: calc(100vh - 136px); /* Viewport height - header - spacing */
    overflow-y: auto;
}

.left-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.left-nav li {
    margin-bottom: 8px;
    position: relative;
}

.left-nav li a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #445065;
    font-size: 20px;
    font-weight: 400;
    transition: all 0.3s ease;
}

.left-nav li:hover a {
    background-color: rgba(95, 151, 251, 0.05);
}

.left-nav li.active {
    border-right: 4px solid #5F97FB;
}

.left-nav li.active a {
    font-weight: 700;
    color: #5F97FB;
}

@media (max-width: 768px) {
    .left-nav li a{
      font-size:14px;
      padding: 10px 10px;
    }
    .demographics-body {
      flex-direction: column;
    }
  
    .left-nav {
      width: 100%;
      margin-bottom: 24px;
  
      /* reset sticky để không overlap */
      position: static;
      top: auto;
      max-height: none;
      overflow: visible;
      z-index: auto;
    }
  
    .left-nav ul {
      display: flex;
      overflow-x: auto;
      gap: 8px;
    }
  
    .left-nav li.active {
      border-right: none;
      border-bottom: 4px solid #5F97FB;
    }

  .form-control-new,
  .form-group-new select,
  .form-group-new input[type="text"],
  .form-group-new input[type="email"],
  .form-group-new input[type="number"] {
    height:20px;
  }
  
  .form-section-card {
    gap: 5px 10px;
  }

}

/* === CONTENT AREA === */
.content-area {
    flex-grow: 1;
    background-color: #FFFFFF;
    padding: 64px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.content-area .page-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #445065;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* === ALERT MESSAGES === */
/* === ALERT MESSAGES === */
.alert-danger {
    background-color: #FFE5E5;
    border: 1px solid #FF4A4A;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 32px;
    color: #D32F2F;
    font-size: 14px;
}

/* === FORM SECTIONS === */
.form-section-card {
    margin-bottom: 48px;
    scroll-margin-top: 100px; /* For smooth scroll with fixed header */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 32px; /* row-gap column-gap */
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #445065;
    margin-bottom: 24px;
    padding-bottom: 12px;
    /*border-bottom: 2px solid #F1F4FF;*/
    grid-column: 1 / -1; /* Section title spans all columns */
}

/* === FORM GROUPS === */
.form-group-new {
    /* margin-bottom removed - now controlled by grid gap */
}

.form-group-new label {
    display: block;
    font-size: 16px;
    color: #445065;
    margin-bottom: 8px;
    font-weight: 400;
}

.form-group-new label .required-asterisk {
    color: #FF4A4A;
    margin-left: 4px;
}

/* === FORM CONTROLS === */
.form-control-new,
.form-group-new select,
.form-group-new input[type="text"],
.form-group-new input[type="email"],
.form-group-new input[type="number"] {
    width: 100%;
    max-width: 512px;
    padding: 16px 24px;
    border: 1px solid #808897;
    border-radius: 24px;
    background-color: #FFFFFF;
    font-size: 14px;
    color: #445065;
    transition: all 0.3s ease;
}

.form-control-new:focus,
.form-group-new select:focus,
.form-group-new input[type="text"]:focus,
.form-group-new input[type="email"]:focus,
.form-group-new input[type="number"]:focus {
    outline: none;
    border-color: #5F97FB;
    box-shadow: 0 0 0 3px rgba(95, 151, 251, 0.1);
}

.form-group-new.has-error .form-control-new,
.form-group-new.has-error select,
.form-group-new.has-error input[type="text"],
.form-group-new.has-error input[type="email"],
.form-group-new.has-error input[type="number"] {
    border-color: #FF4A4A;
}

.form-group-new.has-error label {
    color: #FF4A4A;
}

/* === DROPDOWN STYLING === */
.form-group-new select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='%23808897' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 24px center;
    padding-right: 56px;
}

/* === RADIO BUTTONS === */
.form-group-new .radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group-new .radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.form-group-new input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #808897;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.form-group-new input[type="radio"]:checked {
    border-color: #5F97FB;
}

.form-group-new input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: #5F97FB;
    border-radius: 50%;
}

.form-group-new .radio-option label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
}

/* === ERROR MESSAGES === */
.text-danger.field-validation-error {
    display: block;
    color: #FF4A4A;
    font-size: 12px;
    margin-top: 6px;
}

/* === FORM ACTIONS === */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #F1F4FF;
}

/* === BUTTONS === */
.btn-primary-new {
    background-color: #5F97FB;
    color: #FFFFFF;
    border: none;
    padding: 14px 48px;
    border-radius: 55px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(95, 151, 251, 0.3);
}

.btn-primary-new:hover {
    background-color: #4A86EA;
    box-shadow: 0 4px 12px rgba(95, 151, 251, 0.4);
    transform: translateY(-1px);
}

.btn-primary-new:active {
    transform: translateY(0);
}

.btn-secondary-new {
    background-color: #FFFFFF;
    color: #445065;
    border: 1px solid #808897;
    padding: 14px 48px;
    border-radius: 55px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary-new:hover {
    background-color: #F1F4FF;
    border-color: #5F97FB;
}

/* === RESPONSIVE DESIGN === */
@media (min-width: 1300px) {
    .demographics-body {
        /* padding removed */
    }
}

@media (max-width: 1024px) {
    .content-area {
        padding: 40px 32px;
    }

    .page-title {
        font-size: 36px;
    }

    /* Adjust header alignment for tablet */
    .header-contain-area {
        /* Left nav (250px) + gap (40px) + content padding (32px) - wrapper padding (20px) = 302px */
        padding-left: 302px;
    }
}

@media (max-width: 768px) {
  .demographics-header-wrapper{
    height:auto;
  }
  .demographics-body {
    padding-bottom: 20px;
    flex-direction: column;
  }

    .left-nav {
        width: 100%;
        margin-bottom: 24px;
    }

    .left-nav ul {
        display: flex;
        overflow-x: auto;
        gap: 8px;
    }

    .left-nav li {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .left-nav li.active {
        border-right: none;
        border-bottom: 4px solid #5F97FB;
    }

    .left-nav li.disabled a {
        color: #999;
        cursor: not-allowed;
    }

    .content-area {
        padding: 5px 5px;
    }

    .page-title {
        font-size: 28px;
    }

    /* Mobile: no left nav offset, just match content padding */
    .header-contain-area {
        /* content-area padding (24px) - wrapper padding (20px) = 4px */
        padding-left: 4px;
    }

    .demographics-header-wrapper .page-title {
        font-size: 28px;
    }

    .form-control-new,
    .form-group-new select,
    .form-group-new input[type="text"],
    .form-group-new input[type="email"],
    .form-group-new input[type="number"] {
        max-width: 300px !important;
        padding: 5px 15px;
        height:30px;
    }
    .form-control-new{
      max-width: 300px !important;
    }
    .form-actions {
        flex-direction: column-reverse;
        gap: 16px;
    }

    .btn-primary-new,
    .btn-secondary-new {
        width: 100%;
    }

    .questionnaire-header {
        padding: 16px 20px;
    }
}

/* === HIDDEN SECTIONS === */
#Select_Employment,
#Select_Function,
#Select_Sector,
#Select_Business,
#Select_Academic {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}