/* ============================================================
   COMPARISON ENGINE SECTION - v2.3 (FINAL MERGED VERSION)
   ============================================================ */

/* --- Global Fixes --- */
html,
body {
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- Section Layout & Typography --- */
.comparison-engine-section {
    padding: 80px 0;
    background-color: #fcfcfc;
}

.comparison-engine-section .container {
    overflow: visible;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 10px;
}

.section-subtitle {
    text-align: center;
    color: #888;
    margin-top: 0;
    margin-bottom: 50px;
    font-size: 16px;
}

/* --- Main Grid Layout --- */
.comparison-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.form-column {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

/* --- Form Styling --- */
/*
 * ============================================================
 *  UPDATED DROPDOWN STACKING & FORM GROUP
 * ============================================================
 * The 'is-open' class, added by JS, raises the z-index of the
 * active group so its dropdown appears above all others.
*/
.form-group {
    position: relative;
    margin-bottom: 20px;
    z-index: 1; /* Default stacking level */
}

/* Jab dropdown open ho to parent ko top par rakho */
.form-group.is-open {
    z-index: 9999 !important; /* Lift active group above all others */
}

/* [UPDATED] Form Label Style (Lighter, Smaller, Not Uppercase) */
.form-group label {
    display: block;
    font-size: 14px; /* Font size chota kar diya */
    font-weight: 600; /* Thora halka font weight */
    color: #777;      /* Halka color */
    margin-bottom: 8px;
    text-transform: none; /* Uppercase khatam kar diya */
    letter-spacing: 0;
}

.form-group select,
.form-group input,
.select2-container--default .select2-selection--single {
    width: 100% !important;
    height: 40px !important;
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    display: flex;
    align-items: center;
}

.dob-field-group {
    grid-column: auto;
}

/* --- [UPDATED] Single DOB Field Styling --- */
.single-dob-wrapper {
    position: relative;
}

#user_dob {
    width: 100%;
    height: 45px;
    border: 1px solid #FF3366; /* Primary color border */
    border-radius: 8px;
    padding: 0 15px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 1px;
    font-weight: 600;
    color: #333;
}

#user_dob:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(255, 51, 102, 0.2);
}

.dob-hint { 
    font-size: 10px; 
    color: #999; 
    display: block; 
    margin-top: 4px; 
}


/* --- Select2 & Search Box Colors --- */
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #FF3366 !important; /* Primary Pink Border */
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #FF3366 !important; /* Dropdown hover color */
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #FF3366 !important; /* Search box border */
    border-radius: 6px;
}


.form-footer {
    text-align: center;
    margin-top: 20px;
}

.btn-match-profile {
    background: var(--brand-pink, #FF3366);
    color: #fff;
    border: none;
    padding: 16px 45px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 51, 102, 0.2);
    transition: all 0.3s ease;
}

.btn-match-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(255, 51, 102, 0.3);
    background-color: #e62e5c;
}

/* --- [UPDATED] Result Column & Card --- */

.result-column {
    flex: 0 0 380px;
    max-width: 380px;
    width: 100%;
}

.result-display-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.match-header-text-external {
    color: #FF3366;
    font-weight: 800;
    font-size: 15px;
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

.matched-celeb-card-compact {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f7 100%);
    border: 1px solid #ffdae2;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    width: 100%;
    box-shadow: 0 10px 30px rgba(255, 51, 102, 0.1);
}

/* --- [UPDATED] Celeb Image Fix (No Stretching) --- */
.match-image-new {
    width: 120px !important;
    height: 120px !important;
    object-fit: cover !important; /* Yeh image ko stretch hone se rokta hai */
    border-radius: 50% !important;
    display: block;
    margin: 0 auto 15px;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}


.match-name-new {
    font-size: 20px;
    margin: 5px 0;
    color: #333;
}

.match-profession-new {
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.button-container-new {
    text-align: center;
    width: 100%;
}

.btn-view-profile-new {
    background: #FF3366;
    color: #fff;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
    transition: 0.3s;
}

.btn-view-profile-new:hover {
    background: #e62e5c;
    transform: translateY(-2px);
}

.share-section-external {
    margin-top: 15px;
    text-align: center;
    width: 100%;
}

.share-section-external p {
    font-size: 11px;
    color: #888;
    margin-bottom: 8px;
}

.share-buttons-new {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.share-btn-s {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.share-btn-s svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.result-card-wrapper {
    height: 60%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.result-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #FF3366;
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* --- Mobile Result Popup --- */
.mobile-result-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.mobile-result-popup.active {
    display: flex;
}

body.popup-open {
    overflow: hidden;
}

.popup-content {
    position: relative;
    width: 100%;
    max-width: 380px;
    animation: popupScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupScale {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* --- Desktop Styles (992px and above) --- */
@media (min-width: 992px) {
    .form-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 30px;
    }
}

/* --- Tablet & Mobile Styles (max-width: 991px) --- */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }
    .comparison-grid {
        flex-direction: column;
    }
    .form-column {
        width: 100%;
    }

    .form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .dob-field-group {
        grid-column: span 2;
    }
    .result-column {
        width: 100%;
        margin-top: 30px;
        position: static;
    }

    /* [NEW] Mobile button container styling */
    .form-footer {
        margin-top: 30px;
        padding: 15px;
        border: 1px solid #eee;
        border-radius: 12px;
        background: #ffffff;
    }
    
    /* [NEW] Mobile button chota kar diya */
    .btn-match-profile {
        width: 100%;
        font-size: 16px;
        padding: 14px 20px;
    }

    .select2-container--default .select2-selection--single {
        height: 48px !important;
        display: flex !important;
        align-items: center !important;
    }

    .select2-dropdown {
        z-index: 99999 !important;
        border: 1px solid #ddd !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
    }
}

/* --- Small Mobile Styles (max-width: 600px) --- */
@media (max-width: 600px) {
    .section-title {
        font-size: 24px;
    }
    .comparison-engine-section {
        padding: 50px 0;
    }
}

/* ============================================================
   MOBILE FONT SIZE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    
    .comparison-engine-section .section-title {
        font-size: 22px;
        line-height: 1.2;
    }

    .comparison-engine-section .section-subtitle {
        font-size: 14px;
    }
}

@media (max-width: 480px) {

    .comparison-engine-section .section-title {
        font-size: 20px;
    }
}