/**
 * RE Inquiry Filter Plugin - Frontend Styles
 * Version: 2.0.0
 */

/* ========== RESET & BASE ========== */
.reif-plugin,
.reif-plugin *,
.reif-plugin *::before,
.reif-plugin *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.reif-plugin {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========== FILTER CONTAINER ========== */
.reif-container {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 28px 36px;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.reif-group {
    flex: 1;
    min-width: 170px;
}

.reif-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.reif-select-wrapper {
    position: relative;
}

.reif-select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #9ca3af;
    pointer-events: none;
    transition: all 0.2s ease;
}

.reif-select {
    width: 100%;
    padding: 14px 42px 14px 16px;
    font-family: inherit;
    font-size: 14px;
    color: #6b7280;
    background: #f8f9fb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.25s ease;
}

.reif-select:hover {
    border-color: #c7d2fe;
    background: #f0f4ff;
}

.reif-select:focus {
    outline: none;
    border-color: #1e3a8a;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.reif-select.has-value {
    color: #1a1a2e;
    font-weight: 500;
}

/* ========== GET INQUIRY BUTTON ========== */
.reif-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
    white-space: nowrap;
    line-height: 1;
}

.reif-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(30, 58, 138, 0.5);
    background: linear-gradient(135deg, #2146a0 0%, #1e3a8a 100%);
}

.reif-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
}

.reif-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========== MODAL OVERLAY ========== */
.reif-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
    padding: 20px;
}

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

/* ========== MODAL BOX ========== */
.reif-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 32px 100px rgba(0, 0, 0, 0.3),
        0 12px 40px rgba(0, 0, 0, 0.2);
}

.reif-modal-overlay.active .reif-modal {
    transform: scale(1) translateY(0);
}

.reif-modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    padding: 28px 32px;
    position: relative;
}

.reif-modal-header h2 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.reif-modal-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    margin: 0;
}

.reif-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
}

.reif-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.reif-modal-close svg {
    width: 20px;
    height: 20px;
    color: white;
    stroke: white;
}

.reif-modal-body {
    padding: 28px 32px 32px;
}

/* ========== SELECTED FILTERS SUMMARY ========== */
.reif-filters-summary {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8efff 100%);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 24px;
    border: 1px solid #dbeafe;
}

.reif-filters-summary h4 {
    font-size: 11px;
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reif-filters-summary h4 svg {
    width: 14px;
    height: 14px;
}

.reif-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reif-filter-tag {
    background: white;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.reif-filter-tag strong {
    color: #1e3a8a;
    font-weight: 600;
}

.reif-no-filters {
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
}

/* ========== FORM FIELDS ========== */
.reif-form-group {
    margin-bottom: 20px;
}

.reif-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.reif-form-label .required {
    color: #dc2626;
    margin-left: 2px;
}

.reif-form-input {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 15px;
    color: #1a1a2e;
    background: #f8f9fb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.reif-form-input::placeholder {
    color: #9ca3af;
}

.reif-form-input:focus {
    outline: none;
    border-color: #1e3a8a;
    background: white;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.reif-form-input.error {
    border-color: #dc2626;
    background: #fef2f2;
}

.reif-error-message {
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

.reif-form-group.has-error .reif-error-message {
    display: block;
}

/* ========== SUBMIT BUTTON ========== */
.reif-submit-btn {
    width: 100%;
    padding: 16px 24px;
    margin-top: 8px;
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    color: white;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    line-height: 1;
}

.reif-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(30, 58, 138, 0.5);
}

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

.reif-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.reif-submit-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Loading spinner */
.reif-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: reif-spin 0.8s linear infinite;
}

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

/* ========== SUCCESS STATE ========== */
.reif-success-state {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.reif-success-state.active {
    display: block;
}

.reif-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: reif-scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reif-scale-in {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

.reif-success-icon svg {
    width: 40px;
    height: 40px;
    color: white;
    stroke: white;
}

.reif-success-state h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px 0;
}

.reif-success-state p {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.reif-close-success-btn {
    margin-top: 28px;
    padding: 12px 32px;
    background: #f3f4f6;
    color: #374151;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.reif-close-success-btn:hover {
    background: #e5e7eb;
}

/* ========== FORM STATE ========== */
.reif-form-state {
    display: block;
}

.reif-form-state.hidden {
    display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .reif-container {
        padding: 24px;
    }
    
    .reif-group {
        min-width: calc(50% - 12px);
    }
    
    .reif-btn {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
}

@media (max-width: 600px) {
    .reif-container {
        padding: 20px;
        gap: 16px;
    }
    
    .reif-group {
        min-width: 100%;
    }
    
    .reif-modal-header,
    .reif-modal-body {
        padding: 24px;
    }
    
    .reif-modal-header h2 {
        font-size: 20px;
        padding-right: 40px;
    }
}
