/* ========================================
   REDUX CLINIC UPDATE FORM - DARK THEME
   Glassmorphism design with animated orbs
   ======================================== */

/* CSS Variables - Use global variables from main-styles.css */
.clinic-update-wrapper {
    --cuf-blue: var(--rx-blue, #3366CC);
    --cuf-blue-light: var(--rx-blue-light, #429EDF);
    --cuf-charcoal: var(--rx-charcoal, #25282A);
    --cuf-white: var(--rx-white, #ffffff);
    --cuf-font-family: var(--rx-font-family, 'Open Sans', sans-serif);
}

/* Full-width dark background container */
.clinic-update-wrapper {
    background: var(--cuf-charcoal);
    min-height: 80vh;
    padding: 100px 20px 60px;
    font-family: var(--cuf-font-family);
    position: relative;
    overflow: hidden;

    /* Full-width breakout */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.clinic-update-wrapper * {
    box-sizing: border-box;
}

/* Animated Orbs Background */
@keyframes cufFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    50% { transform: translate(-30px, 20px) scale(1.1); opacity: 0.5; }
}

@keyframes cufFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(20px, -30px) scale(1.15); opacity: 0.4; }
}

@keyframes cufFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.25; }
    50% { transform: translate(-15px, -25px) scale(1.1); opacity: 0.35; }
}

.cuf-orb {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cuf-blue) 0%, var(--cuf-blue-light) 100%);
    pointer-events: none;
    z-index: 1;
}

.cuf-orb-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation: cufFloat1 20s ease-in-out infinite;
}

.cuf-orb-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -80px;
    animation: cufFloat2 18s ease-in-out infinite;
}

.cuf-orb-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    left: 50%;
    animation: cufFloat3 22s ease-in-out infinite;
}

/* Content Container */
.clinic-update-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Step Cards - Glassmorphism */
.clinic-update-step {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.clinic-update-step h2 {
    color: var(--cuf-white);
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.clinic-update-step p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 16px;
}

/* Info Note Box */
.lookup-form-note {
    background: rgba(66, 158, 223, 0.1);
    border-left: 4px solid var(--cuf-blue-light);
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

/* Form Grid */
.lookup-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

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

.lookup-form-field.full-width {
    grid-column: 1 / -1;
}

/* Form Labels */
.lookup-form-field label {
    font-weight: 600;
    color: var(--cuf-white);
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.02em;
}

/* Form Inputs */
.lookup-form-field input,
.lookup-form-field select {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--cuf-white);
    font-size: 15px;
    font-family: var(--cuf-font-family);
    transition: all 0.3s ease;
}

.lookup-form-field input:focus,
.lookup-form-field select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--cuf-blue-light);
    box-shadow: 0 0 0 3px rgba(66, 158, 223, 0.2);
}

.lookup-form-field input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--cuf-blue) 0%, var(--cuf-blue-light) 100%);
    color: var(--cuf-white);
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--cuf-font-family);
    box-shadow: 0 4px 20px rgba(51, 102, 204, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(51, 102, 204, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Secondary Button */
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cuf-white);
    padding: 16px 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--cuf-font-family);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Link Button */
.btn-link {
    background: none;
    color: var(--cuf-blue-light);
    padding: 12px 24px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--cuf-font-family);
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--cuf-white);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Clinic Match Results */
.clinic-matches {
    margin-top: 24px;
}

.clinic-match-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clinic-match-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--cuf-blue-light);
    transform: translateY(-2px);
}

.clinic-match-card.selected {
    background: rgba(66, 158, 223, 0.15);
    border-color: var(--cuf-blue-light);
}

.clinic-match-name {
    color: var(--cuf-white);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.clinic-match-details {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
}

.clinic-match-details div {
    margin-bottom: 4px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--cuf-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error/Success Messages */
.message-box {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.message-box.error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.message-box.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.message-box.info {
    background: rgba(66, 158, 223, 0.15);
    border: 1px solid var(--cuf-blue-light);
    color: rgba(255, 255, 255, 0.9);
}

/* Hidden Elements */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .clinic-update-wrapper {
        padding: 40px 16px;
    }

    .clinic-update-step {
        padding: 24px;
        border-radius: 16px;
    }

    .clinic-update-step h2 {
        font-size: 24px;
    }

    .lookup-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .cuf-orb-1 {
        width: 250px;
        height: 250px;
        top: -50px;
        right: -50px;
    }

    .cuf-orb-2 {
        width: 200px;
        height: 200px;
    }

    .cuf-orb-3 {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .clinic-update-step {
        padding: 20px;
    }

    .clinic-update-step h2 {
        font-size: 20px;
    }

    .lookup-form-field input,
    .lookup-form-field select {
        padding: 12px;
        font-size: 14px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 14px 24px;
        font-size: 13px;
    }
}

/* Gravity Forms Integration Styling */
.gform_wrapper {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin-top: 24px;
}

.gform_wrapper .gform_body {
    color: var(--cuf-white);
}

.gform_wrapper .gfield_label {
    color: var(--cuf-white);
    font-weight: 600;
}

.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper textarea,
.gform_wrapper select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--cuf-white);
    border-radius: 8px;
}

.gform_wrapper input[type="text"]:focus,
.gform_wrapper input[type="email"]:focus,
.gform_wrapper input[type="tel"]:focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--cuf-blue-light);
    box-shadow: 0 0 0 3px rgba(66, 158, 223, 0.2);
}

.gform_wrapper .gform_button {
    background: linear-gradient(135deg, var(--cuf-blue) 0%, var(--cuf-blue-light) 100%);
    color: var(--cuf-white);
    border: none;
    border-radius: 8px;
    padding: 16px 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 20px rgba(51, 102, 204, 0.4);
}

.gform_wrapper .gform_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(51, 102, 204, 0.6);
}

/* ========================================
   FORM FIELD CLASSES (Update Form)
   ======================================== */

/* Required Asterisk */
.required {
    color: #ff6b6b;
    font-weight: 700;
    margin-left: 4px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Form Field Container */
.form-field {
    display: flex;
    flex-direction: column;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

/* Form Field Labels */
.form-field label {
    font-weight: 600;
    color: var(--cuf-white);
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.02em;
}

/* Form Field Inputs */
.form-field input,
.form-field select,
.form-field textarea {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--cuf-white);
    font-size: 15px;
    font-family: var(--cuf-font-family);
    transition: all 0.3s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--cuf-blue-light);
    box-shadow: 0 0 0 3px rgba(66, 158, 223, 0.2);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Field Note - Helper Text */
.field-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    font-style: italic;
}

/* Error Messages */
.error-message {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

/* Success Messages */
.success-message {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    transition: color 0.3s;
}

.checkbox-label:hover {
    color: var(--cuf-white);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--cuf-blue);
}

/* Privacy Toggle */
.privacy-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
}

.privacy-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--cuf-blue);
}

.privacy-toggle label {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.privacy-toggle label:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Select Dropdown - Fix dark text on selected option */
.form-field select {
    color: var(--cuf-white) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.form-field select option {
    background: var(--cuf-charcoal);
    color: var(--cuf-white);
}

.form-field select optgroup {
    background: var(--cuf-charcoal);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* MapBox Address Suggestions Dropdown - White text on dark background */
.mapbox-suggestions {
    background: rgba(37, 40, 42, 0.98) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 300px;
    overflow-y: auto;
}

.mapbox-suggestions .suggestion,
.mapbox-suggestions div {
    padding: 12px 16px !important;
    cursor: pointer;
    color: var(--cuf-white) !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mapbox-suggestions .suggestion:hover,
.mapbox-suggestions div:hover {
    background: rgba(66, 158, 223, 0.2) !important;
}

/* Typeahead Results (Multi-location Clinic Search) - White text on dark background */
.typeahead-results {
    background: rgba(37, 40, 42, 0.98) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 300px;
    overflow-y: auto;
}

.typeahead-results .typeahead-result,
.typeahead-results div {
    padding: 12px 16px !important;
    cursor: pointer;
    color: var(--cuf-white) !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.typeahead-results .typeahead-result:hover,
.typeahead-results div:hover {
    background: rgba(66, 158, 223, 0.2) !important;
}

/* Address Autocomplete Container */
.address-autocomplete-container {
    position: relative;
}

/* Typeahead Container */
.typeahead-container {
    position: relative;
}

/* Selected Parent Clinic Display - White text on dark background */
.selected-parent {
    background: rgba(66, 158, 223, 0.15);
    border: 1px solid var(--cuf-blue-light);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.selected-parent-name {
    color: var(--cuf-white);
    font-weight: 600;
    font-size: 15px;
}

.selected-parent-clear {
    background: var(--cuf-blue);
    color: var(--cuf-white);
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s;
    flex-shrink: 0;
}

.selected-parent-clear:hover {
    background: var(--cuf-blue-light);
}

/* Clinic Not Found List - White text */
.clinic-update-step ul {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    margin: 16px 0;
    padding-left: 24px;
}

.clinic-update-step ul li {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
}

.clinic-update-step strong {
    color: var(--cuf-white);
}

/* Responsive - Form Grid Mobile */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
