/* Section color styling for consistency - soft teal palette design with curved backgrounds */
.form-section-respondent {
    border-color: rgba(1, 162, 180, 0.3) !important;
}

.form-section-main-options {
    border-color: rgba(1, 162, 180, 0.3) !important;
}

.form-section-additional {
    border-color: rgba(1, 162, 180, 0.3) !important;
}

.section-respondent {
    border-color: rgba(1, 162, 180, 0.3) !important;
}

/* Custom section header classes - completely independent of Bootstrap */
.form-section-header {
    background: rgba(1, 162, 180, 0.08) !important;
    background-color: rgba(1, 162, 180, 0.08) !important;
    color: #2d3748 !important;
    margin: -0.6rem -0.6rem 1rem -0.6rem !important;
    padding: 1rem 1rem !important;
    border-radius: 16px 16px 0 0 !important;
    border-bottom: none !important;
    border: none !important;
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    width: calc(100% + 1.2rem) !important;
    margin-left: -0.6rem !important;
    margin-right: -0.6rem !important;
}

/* Section-specific header styles - ensure ALL sections use consistent styling */
.section-respondent .form-section-header,
.form-section-respondent .form-section-header,
.form-section-main-options .form-section-header,
.form-section-additional .form-section-header,
.card.section-respondent .form-section-header,
.card.form-section-respondent .form-section-header,
.card.form-section-main-options .form-section-header,
.card.form-section-additional .form-section-header {
    background: rgba(1, 162, 180, 0.08) !important;
    background-color: rgba(1, 162, 180, 0.08) !important;
    color: #2d3748 !important;
    margin: -0.6rem -0.6rem 1rem -0.6rem !important;
    padding: 1rem 1rem !important;
    border-radius: 16px 16px 0 0 !important;
    border-bottom: none !important;
    border: none !important;
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    width: calc(100% + 1.2rem) !important;
    margin-left: -0.6rem !important;
    margin-right: -0.6rem !important;
}

/* Header text classes for consistent styling */
.header-title {
    color: #2d3748 !important;
    font-weight: 600 !important;
    position: relative;
    z-index: 1;
}

.header-subtitle {
    color: #4a5568 !important;
    position: relative;
    z-index: 1;
}

/* Ensure consistent text color and opacity for section subtitles */
.form-section-respondent .form-section-header .text-muted,
.form-section-main-options .form-section-header .text-muted,
.form-section-additional .form-section-header .text-muted {
    color: #4a5568 !important;
}

/* Make section subtitle text darker for better contrast with light headers */
.form-section-respondent .form-section-header .text-white-50,
.form-section-main-options .form-section-header .text-white-50,
.form-section-additional .form-section-header .text-white-50 {
    color: #4a5568 !important;
}

/* Improve visibility of Section 2 toggle specifically */
.form-section-main-options .form-section-header .form-check-input {
    background-color: #ffffff !important;
    border: 2px solid #2d3748 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.form-section-main-options .form-section-header .form-check-input:checked {
    background-color: #01A2B4 !important;
    border-color: #01A2B4 !important;
    box-shadow: 0 2px 4px rgba(1, 162, 180, 0.3) !important;
}

.form-section-main-options .form-section-header .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(1, 162, 180, 0.3) !important;
}

.form-section-main-options .form-section-header .form-check-label {
    color: #2d3748 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

/* Response page Quill styles */
.ql-editor p {
    margin-bottom: 1em;
}


/* Form logo size options */
.form-logo {
    max-height: 100px;
}

.form-logo-large {
    max-height: 200px;
    width: auto;
}

/* Payment button responsive styles */
.payment-btn {
    min-width: auto !important;
    height: auto !important;
    white-space: nowrap;
    flex: 1;
}

.qr-btn {
    padding: 0.25rem !important;
    width: 40px !important;
    height: 40px !important;
    flex: none !important;
    margin-top: 3px !important;
}

@media (max-width: 576px) {
    .payment-btn {
        padding: 0.75rem 1rem;
    }

    .payment-btn .bi-phone,
    .payment-btn .bi-paypal {
        margin-right: 0 !important;
    }
}

/* Form validation error styles */
.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.invalid-feedback {
    display: block !important;
    color: #dc3545 !important;
    font-size: 0.875em !important;
    margin-top: 0.25rem !important;
}

.form-check-input.is-invalid {
    border-color: #dc3545 !important;
}

.form-check-input.is-invalid ~ .form-check-label {
    color: #dc3545 !important;
}

/* Highlight required question cards */
.additional-question-section.has-error {
    border: 2px solid #dc3545 !important;
    border-radius: 8px;
}

.additional-question-section.has-error .card {
    border-color: #dc3545 !important;
}

@font-face {
    font-display: swap;
    font-family: "bootstrap-icons";
    src: url("/static/fonts/bootstrap-icons.woff2") format("woff2");
}

/* Variables */
:root {
    --primary-color: #01A2B4;
    --text-color: #2d3748;
    --border-color: #ddd;
    --primary-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --heading-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.heading-font {
    font-family: var(--heading-font);
}

/* Base Styles */
body {
    font-family: var(--primary-font);
    line-height: 1.6;
    color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Base Option Items */
.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    width: 100%;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(1, 162, 180, 0.1);
}

.option-input {
    flex: 1;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin: 0;
    min-width: 0;
    box-sizing: border-box;
    background-color: white;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    line-height: normal;
    outline: none;
}

.form-preview input[type="text"],
.form-preview input[type="email"],
.form-preview input[type="number"],
.form-preview textarea {
    -webkit-appearance: none !important;
    appearance: none !important;
    border-radius: 6px !important;
    border: 1px solid #ddd !important;
    background-color: white !important;
}

.option-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(1, 162, 180, 0.2);
}

/* Common styles for all devices */
.option-input, .limit-input {
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
}

.option-controls {
    display: flex;
    align-items: center;
    gap: 0px;
    margin-left: auto;
    padding-right: 0px;
}

/* Default state: white button with gray text */
button[data-bs-toggle="collapse"] {
    background-color: white !important;
    color: #6c757d !important;
    transition: background-color 0.2s, color 0.2s !important;
}

/* Collapsible responses container styling */
.collapsible-responses {
    border: 1px solid #e9ecef !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.collapsible-responses:hover {
    background-color: #f8f9fa !important;
}

button[data-bs-toggle="collapse"] .text-muted,
button[data-bs-toggle="collapse"] .text-muted span {
    color: #6c757d !important;
    transition: color 0.2s !important;
}

/* Hover state: gray button with white text */
button[data-bs-toggle="collapse"]:hover {
    background-color: #6c757d !important;
    color: white !important;
}

button[data-bs-toggle="collapse"]:hover .text-muted,
button[data-bs-toggle="collapse"]:hover .text-muted span {
    color: white !important;
}

/* Active/expanded state: keep white background */
button[data-bs-toggle="collapse"][aria-expanded="true"] {
    background-color: white !important;
    color: #6c757d !important;
}

button[data-bs-toggle="collapse"][aria-expanded="true"] .text-muted,
button[data-bs-toggle="collapse"][aria-expanded="true"] .text-muted span {
    color: #6c757d !important;
}

/* Explicitly handle collapsed state to revert to default */
button[data-bs-toggle="collapse"][aria-expanded="false"] {
    background-color: white !important;
    color: #6c757d !important;
}

button[data-bs-toggle="collapse"][aria-expanded="false"] .text-muted,
button[data-bs-toggle="collapse"][aria-expanded="false"] .text-muted span {
    color: #6c757d !important;
}

.response-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.limit-number {
    font-size: 13px;
    line-height: 1;
}

.response-limit-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    padding: 8px 4px;
    gap: 2px;
    height: 52px;
    width: 85px;
    justify-content: center;
    position: relative;
}

.limit-label {
    font-size: 11px;
    color: #495057;
    white-space: nowrap;
    text-align: center;
    font-weight: 500;
    margin-bottom: 4px;
}

.limit-number {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.response-limit-circle .limit-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0;
    transition: all 0.2s ease;
    line-height: 1;
}

.response-limit-circle .limit-btn:hover {
    background: #e9ecef;
    color: #018c9a;
}

.response-limit-circle .limit-btn i {
    font-size: 14px;
}

.response-limit-circle .limit-btn:hover {
    color: #018c9a;
}

.response-limit-circle .limit-number {
    min-width: 32px;
    text-align: center;
    font-weight: 500;
    color: #495057;
}

.response-limit-circle .infinite-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 4px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.response-limit-circle .infinite-btn:hover {
    background: #e9ecef;
    color: var(--primary-color);
}

.response-limit-circle .limit-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.response-limit-circle .limit-number {
    user-select: none;
}

.response-limit-circle .limit-number.unlimited {
    font-size: 18px;
}

.response-limit-circle:hover {
    border-color: var(--primary-color);
    background: rgba(1, 162, 180, 0.05);
}

.limit-panel {
    position: absolute;
    top: 0;
    right: calc(100% + 8px);
    height: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.unlimited-btn {
    border: 1px solid #ddd;
    background: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.unlimited-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.limit-option {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.limit-counter {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 0 4px;
}

.limit-counter button {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.limit-counter input {
    width: 32px;
    text-align: center;
    border: none;
    padding: 0;
    -moz-appearance: textfield;
}

.limit-counter input::-webkit-outer-spin-button,
.limit-counter input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.limit-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.limit-counter button {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.limit-counter input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.counter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.counter-value {
    width: 20px;
    text-align: center;
    font-size: 13px;
    user-select: none;
}

.limit-option {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.limit-option:hover {
    color: var(--primary-color);
}

.limit-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.limit-counter button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.limit-counter button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.limit-counter input {
    width: 40px;
    text-align: center;
    border: none;
    padding: 0;
    font-size: 14px;
}

.infinity-btn {
    border: 1px solid #ddd;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.limit-input-wrapper {
    display: flex;
    gap: 4px;
}

.limit-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.apply-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.response-limit-circle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 0;
    background: transparent;
    border-radius: 6px;
    margin-right: 2px;
}

.drag-handle {
    color: #666;
    cursor: grab;
    user-select: none;
}

.remove-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #dc3545;
    background: white;
    color: #dc3545;
    border-radius: 4px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Donation Page Styles */
.payment-options {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.payment-icon-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.payment-icon-btn i {
    font-size: 1.25rem;
}

.btn-check:checked + .payment-icon-btn {
    transform: scale(1.1);
}

.payment-method-btn i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .payment-method-btn {
        padding: 0.625rem;
    }
    .payment-method-btn span {
        font-size: 0.875rem;
    }
    .btn-group {
        flex-wrap: wrap;
    }
    .btn-group .btn {
        flex: 1 1 40%;
        min-width: 120px;
    }
    .btn-check + label {
        margin: 0.25rem;
    }
    
    /* Hide "Pay with" text on mobile for payment buttons */
    .payment-btn span:first-of-type {
        display: none;
    }
}

/* Additional Fields Styling */
.default-field {
    opacity: 0.7;
    position: relative;
}

.default-field input {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

.default-field input[name="name_field_label"],
.default-field input[name="email_field_label"] {
    background-color: #ffffff !important;
    border-color: #01A2B4 !important;
    cursor: text;
}

.required-asterisk {
    color: #dc3545;
    width: 20px;
    text-align: center;
    margin-left: 4px;
}

.option-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.required .required-asterisk {
    display: block;
}

.form-preview .required-asterisk {
    color: #dc3545;
}

.respond-page .required-asterisk {
    color: #212529;
}

.option-controls {
    display: flex;
    align-items: center;
    gap: 0px;
    margin-left: auto;
    padding-right: 0px;
}

.default-field .form-check-input {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    opacity: 1;
}

.default-field .form-check {
    opacity: 1;
}

.default-field .option-controls {
    position: relative;
}

.default-field .option-controls::after {
    content: '\F47A';
    font-family: "bootstrap-icons";
    font-size: 16px;
    position: relative;
    margin-left: 0;
    margin-right: 8px;
    color: #6c757d;
    top: 0;
    transform: none;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.option-item .option-input {
    flex: 1;
    min-width: 0;
    width: calc(100% - 90px);
    margin-right: 6px;
}

/* Improved Additional Question Styling */
.second-question-content {
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 12px;
}

#secondQuestionLabelEdit {
    display: inline-block;
    min-width: 300px;
    width: 100%; /* Make it full width to align with option containers */
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-size: 1.125rem; /* Increased font size for better visibility */
    min-height: 38px; /* Match height of option inputs */
    max-height: 200px; /* Allow expansion */
    height: auto; /* Adjust height to content */
    overflow-y: auto; /* Add scrolling if needed */
    word-wrap: break-word; /* Ensure text wraps */
    white-space: pre-wrap; /* Preserve line breaks */
    padding: 0.375rem 0.75rem; /* Match padding of option inputs */
}

#secondQuestionLabelEdit:focus {
    border-color: #01A2B4;
    box-shadow: 0 0 0 0.2rem rgba(1, 162, 180, 0.25);
    outline: 0;
}

#secondQuestionLabelEdit:empty:before {
    content: attr(data-placeholder);
    color: #6c757d;
    font-size: 1.125rem; /* Match increased font size */
}

#secondQuestionType {
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-size: 0.95rem; /* Reduce font size of question type dropdown */
    height: auto; /* Allow height to adjust to content */
    padding: 0.375rem 0.75rem; /* Standardize padding */
}

#secondQuestionType:focus {
    border-color: #01A2B4;
    box-shadow: 0 0 0 0.2rem rgba(1, 162, 180, 0.25);
}

.second-question-content .option-item input.option-input {
    background-color: white !important;
}

.option-item .option-controls {
    display: flex;
    align-items: center;
    gap: 0px;
    margin-left: auto;
    padding-right: 0px;
}

/* Icon Grid Styles */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 1rem;
}

.icon-btn {
    aspect-ratio: 1;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    min-width: 48px; /* Added min-width and min-height */
    min-height: 48px;
}

.icon-btn i {
    transition: opacity 0.2s ease-in-out;
}

.icon-btn:hover {
    border-color: #01A2B4;
    background: #f8f9fa;
}

.icon-btn.selected {
    border-color: #01A2B4;
    background: #e9ecef;
}

/* Form Image Display */
.img-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="color"] {
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

/* Specific alignment for additional fields toggles */
#additionalFieldsContainer .option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

#additionalFieldsContainer .option-item .option-input {
    flex: 1;
    min-width: 0;
    height: 38px;
}

#additionalFieldsContainer .option-controls {
    display: flex;
    align-items: center;
    gap: 0px;
    margin-left: auto;
    padding-right: 0px;
}

#additionalFieldsContainer .form-check.form-switch {
    margin: 0;
    padding: 0;
    height: 24px;
    display: flex;
    align-items: center;
    padding-right: 0px;
}

#additionalFieldsContainer .form-check-input {
    margin: 0;
}

/* Inline editable fields */
.editable-wrapper {
    position: relative;
}

.editable-field {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    cursor: text;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.editable-field-inline {
    cursor: text;
    transition: background-color 0.15s ease-in-out;
    padding: 2px 6px;
    border-radius: 4px;
    position: relative;
    min-width: 80px;
}

.editable-field-inline:hover {
    background-color: #f8f9fa;
}

.editable-field-inline:focus {
    outline: 0;
    background-color: #f8f9fa;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Only add pencil to editable fields that aren't question fields */
.editable-field-inline:not(#secondQuestionLabelEdit):after {
    content: "✏️";
    margin-left: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.editable-field-inline:not(#secondQuestionLabelEdit):hover:after {
    opacity: 0.5;
}

.editable-field:hover {
    background-color: #f8f9fa;
    border-color: #80bdff;
}

.editable-field:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.editable-field:empty:before,
.editable-field-inline:empty:before {
    content: attr(data-placeholder);
    color: #6c757d;
}

.editable-field::after {
    content: "✏️";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
}

#additionalFieldsContainer .remove-btn {
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Option Settings Toggles */
h5 {
    font-family: var(--heading-font);
}

.option-settings .form-check.form-switch {
    display: flex;
    align-items: center;
    margin: 0 16px;
    gap: 8px;
}

.option-settings .form-check-input {
    margin: 0;
}

/* Additional Respondent Toggles */
.respondent-settings .form-check.form-switch {
    display: flex;
    align-items: center;
    margin-right: 0;
}

.respondent-settings .form-check-input {
    margin-left: auto;
}

/* Link dialog styles */
.link-dialog {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .link-dialog .form-control {
        min-height: 44px;
    }
    .link-dialog .btn {
        min-height: 44px;
        font-size: 1rem;
    }
}

/* Form preview styles */
.form-preview {
}


/* Improved Tag UI Styles */
.tag-editor-container {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    border-radius: 8px;
    z-index: 1050;
}

.existing-tags-container {
    max-height: 150px;
    overflow-y: auto;
}

.existing-tags-list .badge {
    transition: all 0.2s;
}

.existing-tags-list .badge:hover {
    background-color: #e2e6ea !important;
}

.form-tags .tag-badge {
    background-color: #6c757d;
    color: white;
    font-weight: normal;
    padding: 0.25em 0.6em;
    border-radius: 0.375rem;
}

.form-tags .tag-badge .btn-close-white {
    font-size: 0.6em;
    margin-top: -2px;
}

.form-tags .add-tag-trigger {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
    height: 24px;
    display: inline-flex;
    align-items: center;
}

/* Quill Editor Specific Styles */
.ql-toolbar.ql-snow {    border-color: var(--border-color) !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 8px 12px !important;
    background: #f8f9fa !important;
}

.ql-container.ql-snow {
    border-color: var(--border-color) !important;
    border-radius: 0 0 8px 8px !important;
    font-family: var(--primary-font) !important;
}

.editable-field-inline {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.ql-toolbar .ql-stroke {
    stroke: var(--text-color) !important;
}

.ql-toolbar .ql-fill {
    fill: var(--text-color) !important;
}

.ql-toolbar .ql-picker {
    color: var(--text-color) !important;
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--primary-color) !important;
}

.ql-toolbar button:hover .ql-fill,
.ql-toolbar button.ql-active .ql-fill {
    fill: var(--primary-color) !important;
}

.ql-toolbar .ql-picker-label:hover,
.ql-toolbar .ql-picker-label.ql-active {
    color: var(--primary-color) !important;
}

.form-preview .ql-editor {
    font-size: 16px !important;
    font-family: var(--primary-font) !important;
    line-height: 1.6 !important;
    min-height: 120px !important;
}

.form-preview .ql-editor p {
    font-size: 16px !important;
    line-height: 1.6 !important;
}

/* Core Form Elements */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    width: 100%;
    font-size: 14px;
    min-width: 280px;
}

input[name="title"].form-control {
    font-size: 16px;
    padding: 12px 16px;
    font-weight: 500;
}

#descriptionInput {
    font-size: 16px;
    line-height: 1.6;
    padding: 12px 16px;
}

.form-control-lg {
    min-height: 48px;
}

.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: white;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
.btn-primary:disabled,
.btn-primary.disabled {
    background-color: #018c9a !important;
    color: white !important;
    border: none !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 162, 180, 0.2);
}

/* Preserve custom button color and text on all states */
button[type="submit"][style*="background-color"],
button[type="submit"][style*="background-color"]:active,
button[type="submit"][style*="background-color"]:focus,
button[type="submit"][style*="background-color"]:hover {
    background-color: var(--button-bg, inherit) !important;
    color: var(--button-color, inherit) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Create Form Button & Generate Form Button */
#submitBtn:hover,
.create-button .btn:hover {
    background: #018c9a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 162, 180, 0.2);
}

/* Copy Button Hover Effects */
[onclick*="copyFormLink"]:hover,
[onclick*="copyResponseLink"]:hover,
[onclick*="copyEditFormLink"]:hover,
[onclick*="copyPublicResponseLink"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 162, 180, 0.15);
}

/* Submit Form Button */
button[type="submit"].btn-primary:hover {
    background: #018c9a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 162, 180, 0.2);
}

/* Form Settings & Edit Form Buttons */
.btn-info:hover,
.btn-outline-info:hover,
[onclick*="editFormLink"]:hover,
.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 162, 180, 0.2);
}

.form-check-input {
    border: 1px solid #6c757d;
}

.form-check-input:hover {
    border-color: var(--primary-color);
    cursor: pointer;
}

.form-check-label {
    font-family: var(--primary-font);
    font-size: 14px;
}

.form-check-label:hover {
    color: var(--primary-color);
    cursor: pointer;
}

/* Theme Preview Cards */
.theme-preview-card {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.theme-preview-card:hover {
    border-color: #01A2B4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(1, 162, 180, 0.15);
}

.theme-preview-card.selected {
    border-color: #01A2B4;
    background: rgba(1, 162, 180, 0.05);
    box-shadow: 0 0 20px rgba(1, 162, 180, 0.2);
}

.theme-preview-card.selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 12px;
    color: #01A2B4;
    font-weight: bold;
    font-size: 18px;
}

.theme-preview-header h6 {
    color: #2d3748;
    font-weight: 600;
}

.theme-preview-header small {
    color: #6c757d;
}

.theme-preview-body {
    min-height: 60px;
}

/* Container */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

@media (max-width: 576px) {
    .container-narrow {
        padding: 0 0.25rem;
    }
}

/* Card */
.card {
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
}

/* Form preview specific adjustments */
.form-preview .container-narrow {
    padding: 0 0.25rem;
}

/* Add padding to the main form card containing the Form Title */
.form-preview > .card.shadow.p-3.mb-3 {
    padding-top: 1.5rem !important;
}

.form-preview .card {
    padding: 0.5rem;
}

.form-preview .card-body {
    padding: 1rem;
}

/* Section cards in form preview need tighter spacing */
.form-preview .section-respondent,
.form-preview .section-main-options,
.form-preview .section-additional {
    margin-bottom: 1.5rem;
}

.form-preview .section-respondent .card-body,
.form-preview .section-main-options .card-body,
.form-preview .section-additional .card-body {
    padding: 1rem 0.75rem;
}

/* Form description spacing normalization */
.description-content p {
    margin-bottom: 0.5rem;
}

.description-content p:last-child {
    margin-bottom: 0;
}

.description-content p:empty {
    margin-bottom: 0.25rem;
}

/* Media Queries from original stylesheet that weren't in the edited snippet */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    .options-header {
        padding-right: 65px;
        padding-left: 15px;
    }
    .max-responses-label label {
        margin-right: -75px !important;
    }
}
@media (max-width: 480px) {
    .options-header {
        padding-right: 55px;
        padding-left: 10px;
    }
    .max-responses-label label {
        margin-right: -65px !important;
    }
}
@media (min-width: 1200px) {
    .table > :not(caption) > * > * {
        white-space: normal;
    }

    /* Admin pages get wider containers on large screens */
    .admin-page .container-fluid {
        max-width: 1800px !important;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1400px) {
    .admin-page .container-fluid {
        max-width: 2000px !important;
        padding-left: 3rem;
        padding-right: 3rem;
    }
}
@media (max-width: 1200px) {
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        margin: 0 auto;
    }
}
@media (max-width: 768px) {
    .hero {
        padding: 2rem 0;
    }
    .cta-section {
        border-radius: 16px;
        padding: 2rem 1rem;
    }
    .container-narrow {
        padding: 0 1rem;
    }
}

.max-responses-label i {
    font-size: 1rem;
    color: var(--primary-color);
}


.list-group-item {
    border-radius: 12px !important;
    margin-bottom: 0.5rem;
    border: 1px solid #c8d1d9 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(1, 162, 180, 0.05);
}

.list-group-item label {
    cursor: pointer;
}

.list-group-item input:disabled + label {
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.list-group-item input:disabled ~ small {
    color: #6c757d;
}

.list-group-item:has(input:disabled) {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.list-group-item:has(input:disabled):hover {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.list-group-item .form-check-input {
    margin-right: 8px;
}

.table > :not(caption) > * > * {
    padding: 1rem 0.75rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: inherit;
    padding-bottom: 8px;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.badge {
    font-weight: 500;
}

.download-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--primary-color);
    background-color: rgba(1, 140, 154, 0.1);
    border: none;
    transition: all 0.2s ease;
}
.download-btn:hover {
    background-color: rgba(1, 140, 154, 0.2);
    color: var(--primary-color);
}

.btn-loading {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-group {
    margin-bottom: 1rem;
}

.pick-random-btn .spinner-border {
    color: white !important;
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.pick-random-btn .spinner-border-sm {
    vertical-align: middle;
    margin-top: -2px;
}

.feature-card {
    border: none;
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon i {
    font-size: 24px;
    color: white;
}

.cta-section {
    background: linear-gradient(135deg, #018c9a 0%, #01a2b4 100%);
    color: white;
    padding: 4rem 0;
    border-radius: 24px;
    margin: 2rem 0;
}

.example-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.example-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.example-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.form-section {
    margin-bottom: 1.5rem;
}

.response-list-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.response-list-item:last-child {
    border-bottom: none;
}

.responses-label {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.responses-label i {
    color: var(--primary-color) !important;
    font-size: 16px;
}

.form-label {
    margin: 0 0 0.75rem 0;
    padding: 0;
}

/* Template selection highlight */
.highlight-template {
    transition: background-color 1.5s ease !important;
}

#submitBtn {
    transition: transform 0.3s ease, margin-top 0.3s ease;
}

.alert {
    transition: opacity 0.3s ease;
}

.max-responses-label {
    display: none;
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    width: 60px;
    position: relative;
    right: 10px;
}

.max-responses-label.show {
    display: block;
}

/* Max signups header icon styling */
.max-signups-icon {
    color: #495057 !important;
    font-size: 1rem;
}

.max-responses-input {
    width: 60px !important;
    height: 38px !important;
    padding: 6px 8px !important;
    text-align: center;
    margin: 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px !important;
    font-size: 0.9rem;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.max-responses-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 162, 180, 0.25);
    outline: none;
}

.remove-option-btn {
    width: 32px;
    height: 32px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    cursor: pointer;
    border: none !important;
    background: transparent !important;
    color: #dc3545;
    min-width: 32px !important;
    max-width: 32px !important;
    flex-shrink: 0 !important;
}

.remove-option-btn:hover {
    color: #bb2d3b;
    background: transparent !important;
}

/* Specific styling for additional question remove buttons */
.remove-additional-question-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    cursor: pointer !important;
    border: none !important;
    background: transparent !important;
    color: #dc3545 !important;
    min-width: 32px !important;
    max-width: 32px !important;
    flex-shrink: 0 !important;
}

.remove-additional-question-btn:hover {
    color: #bb2d3b !important;
    background: transparent !important;
}

.remove-additional-question-btn i {
    font-size: 14px !important;
}

/* Ensure all remove buttons stay small on mobile */
@media (max-width: 768px) {
    .remove-option-btn,
    .remove-additional-question-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        padding: 2px !important;
        flex-shrink: 0 !important;
    }

    .remove-option-btn i,
    .remove-additional-question-btn i {
        font-size: 12px !important;
    }
}

.form-preview .form-control:not(textarea),
.form-preview .input-group > * {
    height: 38px;
    line-height: 1.5;
}

.input-group {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.input-group .btn {    border-radius: 8px !important;
}

.input-group-append {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.card, .card-body, .card-header {
    border-radius: 12px !important;
}

.card .card-body:last-child {
    border-bottom-left-radius: 12px !important;
    border-bottom-rightradius: 12px !important;
}
.card.shadow-lg {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.card-header {
    background-color: #ffffff;
    border-bottom: 0;
    border-radius: 0 !important;
}
.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.navbar {
    font-family: var(--heading-font);
    background-color: #2D3748;
    position: relative;
    z-index: 1030;
    padding: 0.75rem 1.5rem;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

footer {
    background-color: #2D3748;
    color: white;
    padding: 2rem 0;
}

footer a {
    color: white;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #01A2B4;
}

.alert {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alert-success {
    background: rgba(25, 135, 84, 0.1);
    border-left: 4px solid #198754;
    color: #0f5132;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
    color: #842029;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.5rem 0;
}

.navbar-brand img {
    width: 40px;  
    height: 40px; 
}

.navbar-brand .brand-text-primary {
    color: #ffffff;
    font-size: 1.3rem;
}

.navbar-brand .brand-text-white {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.navbar-brand:hover .brand-text-primary {
    color: #ffffff !important;
}

.navbar-brand:hover .brand-text-white {
    color: var(--primary-color) !important;
}

.navbar img {
    width: 35px;
    height: 35px;
}

.navbar-toggler {
    background-color: transparent; 
    border: none;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-collapse {
    text-align: right;
    background: #2D3748;
    padding: 1rem;
    position: relative;
    width: 100%;
}

@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        justify-content: flex-end;
        width: auto;
    }

    .navbar-nav {
        display: flex;
        flex-direction: row;
        gap: 1rem;
    }
}

@media (max-width: 991px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        right: 0;
        padding: 1rem;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .navbar-nav {
        flex-direction: column;
    }

    .nav-item {
        width: 100%;
        text-align: right;
    }
}

.navbar-collapse .nav-link {
    color: white !important;
}

.navbar-collapse .nav-link:hover {
    color: #01A2B4 !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.brand-text-white {
    color: white;
}

/* Override Bootstrap's default focus styles */
.btn:focus, .btn:active:focus, .btn.active:focus,
.btn-primary:focus, .btn-primary:active:focus,.btn-primary.active:focus {
    box-shadow: 0 00 0.25rem rgba(1, 162, 180, 0.25) !important;
}

/* Override Bootstrap's default active styles */
.btn:active, .btn.active,
.btn-primary:active, .btn-primary.active {
    background-color: #018c9a !important;
    border-color: #018c9a !important;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 0 0 8px 0;
}

#saveIcon {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    width: 48px;
    height: 48px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border-color: #01A2B4;
    background: #f8f9fa;
}

.color-pick {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #dee2e6;
}

.color-pick:hover {
    transform: scale(1.1);
}



.btn-preview {
    min-width: 100px;
    transition: all 0.2s ease;
}

.btn-preview:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: var(--button-bg, inherit) !important;
    border-color: var(--button-bg, inherit) !important;
    color: var(--button-color, inherit) !important;
}

.btn-preview:active,
.btn-preview:focus {
    background-color: var(--button-bg, inherit) !important;
    border-color: var(--button-bg, inherit) !important;
    color: var(--button-color, inherit) !important;
}

/* Embed submit button custom color support */
button[type="submit"].btn-primary[style*="--button-bg"],
button[type="submit"].btn-primary[style*="--button-bg"]:hover,
button[type="submit"].btn-primary[style*="--button-bg"]:active,
button[type="submit"].btn-primary[style*="--button-bg"]:focus {
    background-color: var(--button-bg) !important;
    border-color: var(--button-bg) !important;
    color: var(--button-color) !important;
}

.form-color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    background-color: transparent;
}

.form-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.form-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.form-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.dropdown-menu {
    min-width: 100%;
    padding: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    margin-top: 0.5rem;
    z-index: 1021;
    text-align: right;
    background-color: #2D3748; 
}

.dropdown-menu.show {
    display: block;
    top: 100%;
}

.nav-item.dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-menu .dropdown-item {
    text-align: right;
    padding-right: 1.5rem;
    color: #ffffff;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #3D4A61;
    color: var(--primary-color);
}

.nav-item.dropdown {
    position: relative;
}

.navbar-nav {
    position: relative;
}

.dropdown-item {
    text-align: right;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* Ensure proper rendering on mobile and webview */
@viewport {
    width: device-width;
    initial-scale: 1;
}

.btn-outline-primary {
    --bs-btn-color: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--primary-color);
    --bs-btn-hover-border-color: var(--primary-color);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-color);
    --bs-btn-active-border-color: var(--primary-color);
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:active,
.btn-outline-secondary:focus {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: #fff !important;
}

.pick-random-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 2rem;
    font-family: var(--primary-font);
}

/* Ensure the pick random button uses correct colors */
.btn-outline-primary {
    color: #01A2B4;
    border-color: #01A2B4;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus {
    color: #fff;
    background-color: #01A2B4;
    border-color: #01A2B4;
}

/* Preserve secondary button style */
.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:active,
.btn-outline-secondary:focus {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Override for the reset button */
.btn[onclick*="resetButtonColor"] {
    background-color: transparent !important;
}
.btn-outline-primary[onclick*="resetButtonColor"] {
    color: #01A2B4 !important;
    border-color: #01A2B4 !important;
}
.pick-random-btn:hover {
    transform: translateY(-1px);
}

#assignmentCard {
    background-color: #f8f9fa;
    border-left: 4px solid #28a745;
    margin: 1rem 0;
    margin-bottom: 2rem; 
    padding: 1rem;
}
#assignedOption {
    font-weight: 600;
    color: #28a745;
}

/* Ensure form elements in respond.html maintain consistent styling */
.form-check-input:checked + label {
    color: #28a745;
    font-weight: 500;
}

/* Don't apply green color to second question responses */
.list-group-item input:checked + label,
.list-group-item:has(input:checked) {
    color: inherit;
    font-weight: normal;
}

/* Consistent styling for second question options */
#secondQuestionContainer .list-group-item {
    padding: 0.75rem;
    margin-bottom: 0.0rem; /* Reduced spacing between items */
    border-radius: 12px !important;
    border: 1px solid var(--bordercolor) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px; /* Add slight indent to align with first question */
}

#secondQuestionContainer .list-group-item:hover {
    background-color: rgba(1, 162, 180, 0.05);
}

#secondQuestionContainer .form-check {
    display: flex;
    align-items: center;
    margin: 0;
    width: 100%;
    padding-left: 0;
}

#secondQuestionContainer .form-check-input {
    margin-right: 0.75rem;
    margin-top: 0;
    margin-left: 0;
    position: relative;
}

#secondQuestionContainer .form-check-label {
    margin-bottom: 0;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
}

#secondQuestionContainer .option-box {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    width: 100%;
}

/* Make second question options match first question styling */
#secondQuestionContainer .list-group {
    margin-left: 0;
    padding-left: 0;
    width: 100%;
    margin-top: 0;
}

#secondQuestionContainer .form-label {
    margin-bottom: 0.25rem;
    margin-top: 0;
    padding-bottom: 0;
}

#secondQuestionContainer {
    margin-top: 0 !important;
    transition: all 0.4s ease-in-out;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
}

#secondQuestionContainer.hidden-question {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

#secondQuestionContainer .form-label {
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Additional more specific rules to override any other styles */
#secondQuestionContainer > .form-label,
#secondQuestionContainer label.form-label {
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.2 !important;
}

/* Quantity selector input styling - specific class to avoid conflicts */
.quantity-input {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    height: 32px !important;
    padding: 2px 4px !important;
    text-align: center !important;
    font-size: 14px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.quantity-input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(1, 162, 180, 0.2) !important;
}

/* Additional questions - flatter design using full width */
.additional-question-item {
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    margin-bottom: 1.5rem !important;
    background: white !important;
    padding: 1.25rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    width: 100% !important;
}

.additional-question-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid #f1f3f5 !important;
}

.additional-question-title {
    font-family: var(--primary-font) !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    color: var(--text-color) !important;
    margin: 0 !important;
}

.additional-question-body {
    padding: 0 !important;
}

.additional-question-body .form-label {
    font-family: var(--primary-font) !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
}

.additional-question-body .form-control,
.additional-question-body .form-select {
    width: 100% !important;
    border-radius: 8px !important;
    border-color: #dee2e6 !important;
}

.additional-question-body .option-item {
    width: 100% !important;
}

/* Additional questions font consistency */
.additional-question-section .card-title {
    font-family: var(--primary-font) !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    color: var(--text-color) !important;
}

/* Form preview question labels font consistency */
.card-header h6 {
    font-family: var(--primary-font) !important;
}

/* Legacy second question labels on respond page */
#secondQuestionSection .card-title {
    font-family: var(--primary-font) !important;
}

.confirm-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-right: 0.5rem;
}
.confirm-btn:hover {
    background-color: #218838;
}
.reset-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.reset-btn:hover {
    background-color: #5a6268;
}

.hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);    padding: 4rem0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4rem;
background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
}

.hero-section {
    text-align: center;
    padding: 2rem 0;
}
.btn-hero {
    padding: 2rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 12px;
    height: auto;
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
    border: none;
    box-shadow: 0 8px 24px rgba(1, 140, 154, 0.2);
    transition: all 0.3s ease;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(1, 140, 154, 0.25);
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
}

.btn-hero i {
    font-size: 1.5rem;
}

.hero-card {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.12);  
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);  
    border-radius: 16px;  
}

.hero-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
    width: 100%;
    font-size: 2.5rem;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
}

.hero-logo {
    height: 110px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    margin-left: 0.1rem;
}

.create-button {
    max-width: 300px;
    margin: 0 auto;
}
.hero-button-container {
    max-width: 300px;  
    margin: 0 auto;
}

.hero-button {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;  
    font-size: 1.1rem;    
    font-weight: 600;
    text-align: center;
    color: white;
    background: linear-gradient(45deg, #018C9A, #01A2B4);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(1, 140, 154, 0.2);
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-button:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(1, 140, 154, 0.25);
    background: linear-gradient(45deg, #01A2B4, #018C9A);
    text-decoration: none;
}

.hero-button i {
    font-size: 1.1rem;  
    vertical-align: middle;
}

.benefits-section {
    padding: 4rem 0;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.benefit-icon {
    color: var(--primary-color);
    font-size: 24px;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-page {
    padding: 4rem 0;
}

.feature-case {
    flex: 1;
    min-width: 280px;
    max-width: calc(33.333% - 1rem);
}

@media (max-width: 991px) {
    .feature-case {
        max-width: calc(50% - 1rem);
    }
}

@media (max-width: 767px) {
    .feature-case {
        max-width: 100%;
    }
}

/* Pagination Styles */
.pagination {
    --bs-pagination-color: var(--text-color);
    --bs-pagination-bg: #ffffff;
    --bs-pagination-active-bg: var(--primary-color);
    --bs-pagination-active-color: #ffffff;
    --bs-pagination-hover-bg: #f8f9fa;
    --bs-pagination-hover-color: var(--primary-color);
    --bs-pagination-disabled-color: #6c757d;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background-color: var(--bs-pagination-bg);
    color: var(--bs-pagination-color);
}

.page-link:hover {
    background-color: var(--bs-pagination-hover-bg);
    color: var(--bs-pagination-hover-color);
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background-color: var(--bs-pagination-active-bg);
    color: var(--bs-pagination-active-color);
}

.page-item.disabled .page-link {
    color: var(--bs-pagination-disabled-color);
    background-color: transparent;
}

.landing-hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #018c9a 0%, #01a2b4 100%);
    color: white;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .landing-hero .btn {
        margin: 0 1rem;
        width: calc(100% - 2rem);
    }
    .landing-hero {
        padding: 2rem;
    }
}

.landing-hero .hero-button-container {
    max-width: 300px;
    margin: 0 auto;
}
.landing-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    height: 100%;
    padding: 1.5rem;
}
.landing-card:hover {
    transform: translateY(-5px);
}
.landing-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 0.5rem;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.testimonial-card {
    background: #ffffff;
    padding: 2rem;
    margin: 2.5rem 0;
}

.testimonial-text {
    font-size: 1.5rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1rem;
}

.testimonial-author {
    font-size: 1.1rem !important;
    color: #666 !important;
    background: transparent !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .testimonial-card {
        margin: 3rem 0;
    }
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
    font-size: 1rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
}

.modal .btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

/* Tag editor styling */
.tag-input-wrapper {
    position: relative;
    display: inline-block;
    min-width: 140px;
}

.inline-tag-input {
    font-size: 0.75rem;
    height: 28px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    box-shadow: none;
    border: 1px solid #cfd4da;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 150px;
    overflow-y: auto;
}

.tag-suggestion {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.tag-suggestion:hover,
.tag-suggestion.selected {
    background-color: #e9ecef;
}

/* Improved tag UI */
.form-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f1f3f5 !important;
    color: #495057 !important;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 4px;
    transition: background-color 0.2s;
}

.tag-badge:hover {
    background-color: #e9ecef !important;
}

.tag-text {
    margin-right: 4px;
}

.tag-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    border: none;
    background: transparent;
    color: #adb5bd;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s;
}

.tag-remove-btn:hover {
    color: #495057;
}

.add-tag-btn {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    color: #01A2B4;
    font-size: 0.75rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.add-tag-btn i {
    font-size: 0.7rem;
    margin-right: 3px;
}

.add-tag-btn:hover {
    color: #018999;
}

.tag-input-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-input-cancel {
    background: transparent;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 22px;
    height: 22px;
    transition: color 0.2s;
}

.tag-input-cancel:hover {
    color: #495057;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    color: #664d03;
}

.alert-info {
    background-color: rgba(1, 162, 180, 0.12);
    border: 1px solid rgba(1, 162, 180, 0.18);
    border-radius: 8px;
    color: #2D3748;
    padding: 1rem 1.25rem;
}

.custom-alert {
    background: #f8f9ff;
    border: 1px solid #e0e3ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
}

.custom-alert .bi {
    color: var(--primary-color);
}

.custom-alert .btn-close {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.custom-alert .btn-close:hover {
    opacity: 1;
}

.sortable-drag {
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    opacity: 0.8;
    transform: scale(0.98);
}

.draggable {
    transition: transform 0.2s ease, opacity 0.2s ease;
    touch-action: manipulation;
}

.draggable:active {
    cursor: grabbing;
}

.form-label {
    margin-left: 0;
}

#additionalFieldsContainer .form-check.form-switch.me-2 {
    margin: 0;
}

.icon-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin: 0.25rem;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn i {
    transition: opacity 0.2s ease-in-out;
}
/* Navigation Styles */
.navbar-form {
    background: transparent;
    border: none;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.mobile-nav-section {
    margin-bottom: 2rem;
}

.mobile-nav-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.mobile-nav-item {
    display: block;
    padding: 0.75rem 0;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.mobile-nav-item:hover {
    color: var(--primary-color);
}

@media (max-width: 991px) {
    .navbar-alt {
        padding: 1rem 0;
    }

    .offcanvas {
        max-width: 320px;
    }
}

.form-control.hex-input,
input.hex-input,
.form-control-sm.hex-input {
    width: 80px !important;
    height: 32px !important;
    padding: 4px 6px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    min-width: 60px !important;
}

input[type="file"] {
    width: 100%;
    font-size: 14px;
    padding: 8px 12px;
    box-sizing: border-box;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #fff;
    flex: 1;
    display: block;
    height: 42px;
    min-width: 0;
}

@media (min-width: 768px) {
    input[type="file"] {
        min-width: 0;
        width: 100%;
    }
}

.d-flex.align-items-center.gap-2 {
    display: flex;
    align-items: center;
    gap: 8px !important;
    width: 100%;
    flex-wrap: nowrap;
}

.file-limit-text {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
    flex-shrink: 0;
    margin-bottom: 0;
    min-width: 65px;
}

@media (max-width: 768px) {
    .d-flex.align-items-center.gap-2 {
        flex-wrap: wrap;
    }

    input[type="file"] {
        width: 100%;
        flex-basis: 100%;
    }

    .file-limit-text {
        width: 100%;
        white-space: normal;
    }
}

.counter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.comment-box {
    margin-top: 2px;
    max-width: 100%;
}

.comment-box textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container-narrow {
        padding: 0 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .list-group-item {
        padding: 0.75rem;
    }

    .comment-box {
        margin: 0.5rem 0 0 0;
    }
}

/* FAQ Styles */
.faq-detail .ratio-16x9 {
    max-width: 1000px;
    margin: 0 auto 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.faq-detail .card {
    max-width: 800px;
    margin: 0 auto;    font-size: 1.1rem;
    line-height: 1.7;
}

.faq-detail h1 {
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.faq-detail .lead {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.ratio-16x9 {
}