/* ============================================
   MODERN DESIGN SYSTEM - NCSBN SURVEY
   ============================================ */

/* Root Variables */
:root {
  --primary-color: #025a95;
  --primary-hover: #009cde;
  --secondary-color: #2a98c5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --border-color: #e2e8f0;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --success-color: #10b981;
  --error-color: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition: all 0.2s ease-in-out;
}

/* Typography */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus States */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, 
.form-control:focus, .form-check-input:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 140, 251, 0.1), 0 0 0 1px rgba(37, 140, 251, 0.3);
  border-color: var(--primary-color);
}

/* Modern Gradient Background */
.modern-gradient {
  background: linear-gradient(135deg, 
    #667eea 0%, 
    #764ba2 20%, 
    #f093fb 40%, 
    #4facfe 60%, 
    #00f2fe 80%, 
    #025a95 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  position: relative;
  min-height: 100vh;
}

.modern-gradient::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(2, 90, 149, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 156, 222, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 60% 40%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 8s ease-in-out infinite;
}

.modern-gradient::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: shimmerBackground 10s linear infinite;
}

.modern-gradient > * {
  position: relative;
  z-index: 1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes shimmerBackground {
  0% {
    transform: translateX(-100%) translateY(-100%);
  }
  100% {
    transform: translateX(100%) translateY(100%);
  }
}

/* Shimmer animation for progress bar */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-shimmer {
  animation: shimmer 2s infinite;
}

/* Header Styles */
.header {
  backdrop-filter: blur(20px);
  transition: var(--transition);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.header:hover {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.header img {
  max-width: 175px;
  transition: var(--transition);
}

.header img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(2, 90, 149, 0.2));
}

/* Main Content Card */
.main-content {
  backdrop-filter: blur(20px);
  transition: var(--transition);
  animation: fadeInUp 0.6s ease-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.main-content:hover {
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.4);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Question Section */
.question-section {
  margin: 2rem 0;
}

.question-section > div {
  margin-bottom: 2rem;
}

.question-section label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Form Controls - Modern Styling */
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--bg-white);
}

input[type="text"]:hover,
input[type="password"]:hover,
select:hover {
  border-color: var(--primary-color);
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(2, 90, 149, 0.1);
}

/* Radio and Checkbox - Modern Styling */
input[type="radio"],
input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--primary-color);
  transition: var(--transition);
}

input[type="radio"]:hover,
input[type="checkbox"]:hover {
  transform: scale(1.1);
}

/* Radio/Checkbox Labels */
.question-section input[type="radio"] + label,
.question-section input[type="checkbox"] + label {
  display: inline-block;
  margin-left: 0.5rem;
  font-weight: 400;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.question-section input[type="radio"]:checked + label,
.question-section input[type="checkbox"]:checked + label {
  color: var(--text-primary);
  font-weight: 500;
}

/* Option Containers */
.question-section > div > div.ml-2 {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  border: 1px solid transparent;
}

.question-section > div > div.ml-2:hover {
  background-color: var(--bg-light);
  border-color: var(--border-color);
}

/* Buttons - Modern Design */
button[type="submit"],
.btnFormat,
input[type="submit"] {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  text-transform: none;
  letter-spacing: 0.025em;
}

button[type="submit"]:not(:disabled):hover,
.btnFormat:not(:disabled):hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button[type="submit"]:active,
.btnFormat:active,
input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button[type="submit"]:disabled,
.btnFormat:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Button Section */
.button-section {
  margin: 2.5rem 0;
  padding: 1.5rem 0;
  border-top: 2px solid var(--border-color);
}

.button-section button {
  margin: 0.25rem;
}

/* Progress Bar - Modern Design */
.questionText {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.responseText {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Progress Bar Container */
.mb-2:has(.text-center.font-bold.questionText) {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

/* Progress Bar Fill Fix */
.button-section .relative > div[style*="width"] {
  display: block !important;
  position: relative;
  z-index: 1;
}

.button-section .relative > div[style*="width"] img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

/* Modern Progress Bar Styles */
.progress-bar-modern {
  position: relative;
  overflow: hidden;
}

.progress-bar-modern::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Character Counter */
.text-xs.text-gray-500 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Dropdown Styling */
select.custom-text {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23025a95' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Table Styling */
.assistance-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0;
}

.assistance-table thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
}

.assistance-table th {
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.assistance-table td {
  padding: 0.875rem;
  text-align: center;
  border: 1px solid var(--border-color);
  background-color: var(--bg-white);
  transition: var(--transition);
}

.assistance-table tbody tr:hover {
  background-color: var(--bg-light);
}

.assistance-table tbody tr.bg-gray-200 {
  background-color: #f3f4f6;
}

.assistance-table input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: 2rem 0;
  text-align: center;
}

footer img {
  max-width: 200px;
  height: auto;
  opacity: 0.8;
  transition: var(--transition);
}

footer img:hover {
  opacity: 1;
}

/* Text Input Div */
.text-div {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

/* Email Link */
.emailboldblue {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.emailboldblue:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Responsive Design */
@media (min-width: 300px) and (max-width: 480px) {
  body {
    padding: 0.75rem;
  }

  .main-content {
    padding: 1.5rem !important;
  }

  .button-section {
    padding: 1rem 0;
  }
    /* ONLY rows should be grid */
    .button-section .row1,
    .button-section .row2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    /* buttons full width */
    .button-section button {
        width: 100%;
    }

  /*.button-section div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }*/
    /*.button-section div {
        display: grid;*/ /* Change from flex to grid */
        /*grid-template-columns: repeat(2, 1fr);*/ /* Two columns per row */
        /*gap: 7rem;*/ /* spacing between buttons */
        /*margin-bottom: 0.75rem;
    }*/

    .row1, .row2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }


  .button-section div button {
    width: 100%;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }

  .header {
    flex-direction: row !important;
    padding: 1rem 0.75rem !important;
    max-height: 200px;
  }

  .header > div {
    width: 33.333% !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header img {
    max-height: 120px !important;
    object-fit: contain;
  }

  /* Ensure progress bar fill is visible */
  .button-section .relative > div[style*="width"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .button-section .relative > div[style*="width"] img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
  }

  .question-section label {
    font-size: 0.9375rem;
  }

  .assistance-table {
    font-size: 0.8125rem;
  }

  .assistance-table th,
  .assistance-table td {
    padding: 0.5rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .button-section div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .button-section div button {
    width: 100%;
  }
}

/* Utility Classes */
.nationalsquare {
  width: 160px;
}

.shadeit-withoutcolor {
  background-color: transparent;
}

/* Smooth Transitions */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Loading States */
button:disabled {
  position: relative;
  pointer-events: none;
}

/* Print Styles */
@media print {
  .button-section,
  .header {
    display: none;
  }
}

/* Additional Responsive Improvements */
@media (max-width: 640px) {
  .question-section > div > div.ml-2,
  .question-section > div > div {
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.5rem;
  }

  .assistance-table {
    font-size: 0.75rem;
  }

  .assistance-table th,
  .assistance-table td {
    padding: 0.5rem 0.375rem;
  }

  input[type="text"],
  input[type="password"],
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus Visible for Accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Improved Button States */
button:not(:disabled):active {
  transform: translateY(0);
}

/* Better Form Field Spacing */
.question-section > div {
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .question-section > div {
    margin-bottom: 2rem;
  }
}