/* ============================================================
   PREMIUM COUNSELLING MODAL — Apple/Stripe Inspired UI
   ============================================================ */

.counselling-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 20px;
}

.counselling-overlay.active {
    opacity: 1;
    visibility: visible;
}

.counselling-modal {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: auto;
    background: #1e293b;
    border-radius: 16px;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 30px 30px 24px;
    max-height: 95vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.counselling-modal::-webkit-scrollbar { display: none; }

/* Close Button */
.counselling-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.counselling-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg) scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Header Styles */
.counselling-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 3;
}

.counselling-icon-wrap {
    display: none;
}

.counselling-icon { font-size: 24px; }

.counselling-title {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 100;
    color: #ffffff;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counselling-subtitle {
    font-size: 1.05rem;
    color: #9999bb;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Form Styles */
.counselling-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 3;
}

.form-group {
    position: relative;
    width: 100%;
}

.field-icon {
    position: absolute;
    left: 16px;
    top: 23px;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.field-input,
.field-select {
    width: 100%;
    height: 46px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0 16px 0 46px;
    color: #f8fafc;
    font-family: Nunito, sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease;
    appearance: none;
}

textarea.field-input {
    height: auto;
    min-height: 100px;
    padding-top: 16px;
    padding-bottom: 12px;
    resize: vertical;
}

.field-input:focus,
.field-select:focus {
    outline: none;
    background: #0f172a;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.field-input:focus + .field-icon,
.field-input:not(:placeholder-shown) + .field-icon {
    opacity: 1;
    color: #ff6a00;
}

.field-label {
    position: absolute;
    left: 46px;
    top: 23px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    z-index: 20;
}

.field-input:focus ~ .field-label,
.field-input:not(:placeholder-shown) ~ .field-label,
.field-input.filled ~ .field-label,
.field-select:focus ~ .field-label,
.field-select.filled ~ .field-label,
.custom-select-container.open ~ .field-label,
.custom-select-container.has-value ~ .field-label {
    top: 0;
    left: 12px;
    font-size: 0.8rem;
    color: #f97316;
    background: #1e293b;
    padding: 0 6px;
    border-radius: 4px;
    z-index: 25;
}

/* Select Arrow */
.form-group::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 23px;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.form-group:not(:has(select))::after { display: none; }

/* Custom Dropdown Replacement */
.custom-select-container {
    position: relative;
    width: 100%;
    z-index: 10;
    box-sizing: border-box;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    height: 46px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0 45px 0 46px;
    color: #f8fafc;
    font-family: Nunito, sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

/* Ensure the container being interacted with is on top */
.form-group:has(.custom-select-container.open),
.form-group:focus-within,
.enquiry-field:has(.custom-select-container.open) {
    z-index: 50 !important;
}

.custom-select-container.open .custom-select-trigger {
    background: #0f172a;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.custom-select-container.open .custom-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 23px;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.custom-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    box-sizing: border-box;
    max-height: 250px;
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.custom-options::-webkit-scrollbar {
    display: none;
}

.custom-select-container.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-option {
    padding: 12px 16px;
    color: #cbd5e1;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
}

.custom-option:last-child { border-bottom: none; }

.custom-option:hover {
    background: #334155;
    color: #fff;
}

.custom-option.selected {
    background: linear-gradient(90deg, var(--orange, #ff6a00), #ff8c38);
    color: #fff;
    font-weight: 600;
}

/* Hide original select but keep it functional for validation and sibling targeting */
.field-select.enhanced,
.enquiry-field select.enhanced {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 46px;
    width: 100%;
    top: 0;
    left: 0;
    margin: 0;
}

/* Fix floating labels with custom component */
.custom-select-container.open ~ .field-label,
.custom-select-container.has-value ~ .field-label {
    top: 0;
    left: 12px;
    font-size: 0.8rem;
    color: #f97316;
    background: #1e293b;
    padding: 0 6px;
    border-radius: 4px;
    z-index: 25;
}

/* Error State */
.error-text {
    display: block;
    font-size: 0.8rem;
    color: #ff4b2b;
    margin-top: 6px;
    margin-left: 12px;
    min-height: 1.2em;
}

/* Premium Submit Button */
.counselling-submit {
    position: relative;
    width: 100%;
    height: 48px;
    margin-top: 8px;
    background: #f97316;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: Nunito, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.counselling-submit:hover {
    background: #ea580c;
}

.counselling-submit:active { transform: translateY(-1px); }

.counselling-submit .btn-text { position: relative; z-index: 2; }
.counselling-submit .btn-arrow { transition: transform 0.3s ease; }
.counselling-submit:hover .btn-arrow { transform: translateX(5px); }

/* Shine Effect Removed for simplicity */

/* Loading State */
.counselling-submit.loading .btn-text,
.counselling-submit.loading .btn-arrow { opacity: 0; }

.spinner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin 0.8s linear infinite;
}

.counselling-submit.loading .spinner { display: block; }

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

/* Success State */
.counselling-success {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.success-icon-wrap { margin-bottom: 32px; }

.success-title {
    font-family: Oswald, sans-serif;
    font-size: 2.2rem;
    color: #ffd700;
    margin-bottom: 16px;
}

.success-message { font-size: 1.15rem; color: #fff; margin-bottom: 8px; }
.success-submessage { color: #9999bb; margin-bottom: 32px; }

.success-close-btn {
    padding: 14px 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #fff;
    font-family: Rajdhani, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Ambient Particles */
.modal-particle { opacity: 0.4 !important; filter: blur(1px); }

/* RESPONSIVENESS */
@media (max-width: 768px) {
    .counselling-modal { padding: 24px 20px 20px; max-width: 450px; }
    .counselling-close { top: 12px; right: 12px; }
    .counselling-title { font-size: 1.6rem; }
    .counselling-subtitle { font-size: 0.95rem; }
    .counselling-header { margin-bottom: 16px; }
    .counselling-form { gap: 12px; }
}

@media (max-width: 480px) {
    .counselling-modal { border-radius: 12px; padding: 20px 16px; max-width: calc(100vw - 32px);
     margin: 0 16px; }
    .counselling-title{
    font-family: sans-serif;
    font-weight: lighter;
    gap: 1.5rem;
    color: #c3d0e2;
    font-size: 1rem;}
     
}

/* ============================================================
   Overrides for Custom Select when used in space_e_fic form
   ============================================================ */
.enquiry-field .custom-select-container {
    z-index: 20;
}
.enquiry-field .custom-select-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 45px 10px 45px;
    height: 42px; /* Approx height of enquiry fields */
    font-size: 13px;
    font-family: inherit;
    color: #fff;
    box-shadow: none;
}
.enquiry-field .custom-select-trigger.placeholder-active {
    color: rgba(255, 255, 255, 0.5);
}
.enquiry-field .custom-select-container.open .custom-select-trigger {
    border-color: rgba(138, 43, 226, 0.8);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2);
}
.enquiry-field .custom-options {
    background: rgba(10, 12, 25, 0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(138, 43, 226, 0.6);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}
.enquiry-field .custom-option {
    color: #fff;
    font-size: 13px;
    padding: 10px 15px;
}
.enquiry-field .custom-option:hover {
    background: rgba(138, 43, 226, 0.2);
    color: #fff;
}
.enquiry-field .custom-option.selected {
    background: rgba(138, 43, 226, 0.5);
    color: #fff;
}
@media (max-width: 768px) {
    .enquiry-field .custom-select-trigger {
        padding: 8px 35px 8px 35px;
        height: 38px;
    }
}
