/* ===== UNIFIED QUIZ RESPONSIVE DESIGN ===== */
/* Universal quiz styling for all quiz pages (quiz1-quiz11) */

/* Mobile-first approach */
body {
    font-family: 'Montserrat', 'Arial', sans-serif !important;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%);
    min-height: 100vh;
}

/* ===== MATCH HOME PAGE FOOTER EXACTLY ===== */
/* Force quiz pages to use identical footer spacing as home page */
.footer {
    padding-top: 0.5rem !important;   /* Same as py-2 class */
    padding-bottom: 0.5rem !important; /* Same as py-2 class */
    margin: 0 !important;
}

/* Critical: Remove any extra spacing that makes quiz pages different from home page */
body.page-top,
body {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    /* Keep the padding-top for navbar but ensure no bottom spacing */
    min-height: 100vh !important;
    height: auto !important;
}

.container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Force html to not add extra space */
html {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    height: auto !important;
}

.question-container {
    max-width: 600px;
    width: 95%;
    margin: 120px auto 20px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

/* Typography */
h2 {
    color: #333 !important;
    text-align: center !important;
    margin-bottom: 30px !important;
    font-size: 1.8rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.form-group {
    margin-bottom: 20px !important;
}

.modern-input-group {
    margin-bottom: 25px !important; /* Reduced spacing for better layout */
    position: relative !important;
}

label {
    display: block !important;
    margin-bottom: 12px !important;
    color: #555 !important;
    font-weight: 500 !important;
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
}

/* Input fields for quiz1 */
input[type="text"],
input[type="email"],
input[type="number"],
.modern-input {
    width: 100% !important;
    padding: 18px 20px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
    min-height: 56px !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
    border-color: #c1a08e !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(193, 160, 142, 0.15), 0 8px 25px -5px rgba(193, 160, 142, 0.3) !important;
}

/* ===== CUSTOM DROPDOWN STYLING ===== */
.custom-dropdown {
    position: relative !important;
    width: 100% !important;
    margin-bottom: 15px !important;
    z-index: 1000 !important;
    isolation: isolate !important; /* Create new stacking context */
}

.custom-dropdown select {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    border: none !important;
    background: none !important;
    z-index: -1 !important;
}

.dropdown-selected {
    width: 100% !important;
    padding: 18px 20px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%) !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 1rem !important;
    color: #334155 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    box-sizing: border-box !important;
    min-height: 56px !important;
    position: relative !important;
    z-index: 10 !important;
}

.dropdown-selected.placeholder {
    color: #94a3b8 !important;
}

.dropdown-selected:hover {
    border-color: #c1a08e !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 25px -5px rgba(193, 160, 142, 0.3), 0 4px 6px -2px rgba(193, 160, 142, 0.05) !important;
}

.dropdown-selected.active {
    border-color: #c1a08e !important;
    box-shadow: 0 0 0 3px rgba(193, 160, 142, 0.15), 0 8px 25px -5px rgba(193, 160, 142, 0.3) !important;
}

.dropdown-arrow {
    width: 20px !important;
    height: 20px !important;
    transition: transform 0.3s ease !important;
    color: #94a3b8 !important;
}

.dropdown-selected.active .dropdown-arrow {
    transform: rotate(180deg) !important;
    color: #c1a08e !important;
}

.dropdown-options {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 2px solid #c1a08e !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
    display: none !important;
    overflow: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
}

.dropdown-options.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-option {
    padding: 16px 20px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #333 !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    background-color: white !important;
    border: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    border-bottom: 1px solid #f0f0f0 !important;
    min-height: 50px !important;
    text-align: left !important;
}

.dropdown-option:last-child {
    border-bottom: none !important;
}

.dropdown-option:hover {
    background-color: #f8f9fa !important;
    color: #c1a08e !important;
}

.dropdown-option.selected {
    background-color: #c1a08e !important;
    color: white !important;
}

.dropdown-option:first-child {
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
}

.dropdown-option:last-child {
    border-bottom-left-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
    border-bottom: none !important;
}

/* ===== MODERN GENDER RADIO BUTTONS ===== */
.gender-options {
    display: flex !important;
    gap: 15px !important;
    margin: 15px 0 !important;
}

.gender-option {
    flex: 1 !important;
    position: relative !important;
}

.gender-input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.gender-label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    min-height: 90px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.gender-icon {
    font-size: 2rem !important;
    color: #64748b !important;
    margin-bottom: 8px !important;
    transition: all 0.3s ease !important;
}

.gender-text {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    transition: all 0.3s ease !important;
}

.gender-label:hover {
    border-color: #c1a08e !important;
    box-shadow: 0 0 0 3px rgba(193, 160, 142, 0.15), 0 8px 25px -5px rgba(193, 160, 142, 0.3) !important;
    transform: translateY(-2px) !important;
}

.gender-label:hover .gender-icon {
    color: #c1a08e !important;
    transform: scale(1.1) !important;
}

.gender-label:hover .gender-text {
    color: #c1a08e !important;
}

.gender-input:checked + .gender-label {
    border-color: #c1a08e !important;
    background: linear-gradient(135deg, #c1a08e 0%, #b08e7c 100%) !important;
    box-shadow: 0 8px 25px -5px rgba(193, 160, 142, 0.4), 0 4px 6px -2px rgba(193, 160, 142, 0.2) !important;
    transform: translateY(-2px) !important;
}

.gender-input:checked + .gender-label .gender-icon {
    color: white !important;
    transform: scale(1.2) !important;
}

.gender-input:checked + .gender-label .gender-text {
    color: white !important;
    font-weight: 600 !important;
}

/* UNIFIED OPTION GROUP STYLING */
.option-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 30px 0 !important;
}

/* Tablet Grid Layout for Options */
@media (min-width: 768px) and (max-width: 991px) {
    .option-group {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        margin: 30px 0 !important;
    }
    
    .question-container {
        max-width: 700px !important; /* Wider container for tablet grid */
    }
}

/* Desktop Grid Layout for Options */
@media (min-width: 992px) {
    .option-group {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        margin: 30px 0 !important;
    }
    
    /* For pages with more options (6+ options), use 3 columns */
    .option-group:has(.option-item:nth-child(6)) {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }
    
    .question-container {
        max-width: 800px !important; /* Wider container for grid layout */
    }
    
    /* Even wider for 3-column layouts */
    .option-group:has(.option-item:nth-child(6)) ~ .question-container,
    .question-container:has(.option-group .option-item:nth-child(6)) {
        max-width: 900px !important;
    }
}

.option-item {
    position: relative !important;
    width: 100% !important;
}

.option-input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.option-label {
    display: block !important;
    width: 100% !important;
    padding: 18px 24px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    color: #555 !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-align: center !important;
    box-sizing: border-box !important;
    min-height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.option-input:checked + .option-label {
    background: linear-gradient(135deg, #c1a08e 0%, #b08e7c 100%) !important;
    color: white !important;
    border-color: #c1a08e !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px -5px rgba(193, 160, 142, 0.4), 0 4px 6px -2px rgba(193, 160, 142, 0.2) !important;
}

.option-label:hover {
    border-color: #c1a08e !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 25px -5px rgba(193, 160, 142, 0.3), 0 4px 6px -2px rgba(193, 160, 142, 0.05) !important;
}

/* UNIFIED NAVIGATION BUTTONS */
.navigation {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    margin-top: 40px !important;
    justify-content: space-between !important;
}

.nav-btn {
    flex: 1 !important;
    padding: 18px 30px !important;
    background: linear-gradient(135deg, #c1a08e 0%, #b08e7c 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 16px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    text-align: center !important;
    box-sizing: border-box !important;
    min-height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 6px -1px rgba(193, 160, 142, 0.4), 0 2px 4px -1px rgba(193, 160, 142, 0.2) !important;
    border: 2px solid transparent !important;
}

/* Single button styling (when not in .navigation wrapper) */
.nav-btn:not(.navigation .nav-btn) {
    width: 60% !important;
    max-width: 300px !important;
    margin: 40px auto 0 auto !important;
    flex: none !important;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #b08e7c 0%, #9d7a66 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px -5px rgba(193, 160, 142, 0.5), 0 4px 6px -2px rgba(193, 160, 142, 0.3) !important;
    color: white !important;
    text-decoration: none !important;
}

.nav-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 6px -1px rgba(193, 160, 142, 0.4), 0 2px 4px -1px rgba(193, 160, 142, 0.2) !important;
}

.nav-btn:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Progress bar styling */
.progress-bar {
    width: 100% !important;
    height: 8px !important;
    background: #e2e8f0 !important;
    border-radius: 4px !important;
    margin-bottom: 30px !important;
    overflow: hidden !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.progress {
    height: 100% !important;
    background: linear-gradient(135deg, #c1a08e 0%, #b08e7c 100%) !important;
    border-radius: 4px !important;
    transition: width 0.3s ease !important;
}

/* ===== TABLET OPTIMIZATIONS ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .question-container {
        width: 85%;
        padding: 35px;
        margin: 100px auto 60px auto;
    }
    
    h2 {
        font-size: 2rem !important;
        margin-bottom: 35px !important;
    }
    
    .option-group {
        gap: 15px !important;
        margin: 35px 0 !important;
    }
    
    .option-label {
        padding: 20px 28px !important;
        font-size: 1.05rem !important;
        min-height: 60px !important;
    }
    
    .navigation {
        flex-direction: row !important;
        gap: 20px !important;
        margin-top: 45px !important;
    }
    
    .nav-btn {
        flex: 1 !important;
        padding: 20px 35px !important;
        font-size: 1.15rem !important;
        min-height: 60px !important;
    }
    
    /* Single button tablet styling */
    .nav-btn:not(.navigation .nav-btn) {
        width: 65% !important;
        max-width: 320px !important;
        margin: 35px auto 0 auto !important;
    }
    
    /* Tablet gender radio buttons */
    .gender-options {
        gap: 18px !important;
    }
    
    .gender-label {
        padding: 22px 18px !important;
        min-height: 100px !important;
    }
    
    .gender-icon {
        font-size: 2.2rem !important;
        margin-bottom: 10px !important;
    }
    
    .gender-text {
        font-size: 1.1rem !important;
    }
    
    label {
        font-size: 1.15rem !important;
        margin-bottom: 15px !important;
    }
    
    /* Tablet dropdown optimizations */
    .dropdown-selected {
        padding: 20px 28px !important;
        font-size: 1.05rem !important;
        min-height: 60px !important;
    }
    
    .dropdown-option {
        padding: 18px 28px !important;
        font-size: 1.05rem !important;
    }
    
    .dropdown-arrow {
        width: 22px !important;
        height: 22px !important;
    }
}

/* ===== LARGE TABLETS AND SMALL LAPTOPS ===== */
@media (min-width: 1025px) and (max-width: 1200px) {
    .question-container {
        width: 75%;
        padding: 40px;
    }
    
    h2 {
        font-size: 2.2rem !important;
    }
    
    /* Show 2-column layout for options on larger screens if there are many options */
    .option-group.multi-column {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

/* ===== MOBILE PHONE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .question-container {
        width: 95%;
        padding: 20px;
        margin: 100px auto 15px auto;
        border-radius: 15px;
    }
    
    /* NUCLEAR MOBILE FOOTER FIX - Use viewport height */
    body, body.page-top {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        padding-top: 70px !important; /* Keep navbar space */
        display: flex !important;
        flex-direction: column !important;
        overflow-x: hidden !important;
    }
    
    html {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    .question-container {
        flex: 1 !important;
        margin-bottom: 0 !important;
    }
    
    /* Force footer to bottom with minimal padding */
    .footer {
        padding: 8px 0 !important;
        margin: 0 !important;
        margin-top: auto !important;
        width: 100% !important;
        background: transparent !important;
        flex-shrink: 0 !important;
    }
    
    /* Remove all container bottom spacing */
    .container, .row, .col-lg-4, .footer .container {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Mobile form group spacing */
    .modern-input-group {
        margin-bottom: 20px !important; /* Reduced mobile spacing */
    }
    
    /* Mobile dropdown optimizations */
    .dropdown-selected {
        padding: 16px 18px !important;
        font-size: 0.95rem !important;
        min-height: 52px !important;
        border-radius: 12px !important;
    }
    
    .dropdown-option {
        padding: 14px 18px !important;
        font-size: 0.95rem !important;
    }
    
    .dropdown-arrow {
        width: 18px !important;
        height: 18px !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
        margin-bottom: 25px !important;
    }
    
    .option-group {
        gap: 10px !important;
        margin: 25px 0 !important;
    }
    
    .option-label {
        padding: 16px 20px !important;
        font-size: 0.95rem !important;
        min-height: 52px !important;
        border-radius: 12px !important;
    }
    
    .nav-btn {
        padding: 16px 25px !important;
        font-size: 1rem !important;
        min-height: 52px !important;
        border-radius: 12px !important;
    }
    
    /* Single button mobile styling */
    .nav-btn:not(.navigation .nav-btn) {
        width: 70% !important;
        max-width: 280px !important;
        margin: 30px auto 0 auto !important;
    }
    
    /* Mobile gender radio buttons */
    .gender-options {
        gap: 12px !important;
    }
    
    .gender-label {
        padding: 16px 12px !important;
        min-height: 80px !important;
    }
    
    .gender-icon {
        font-size: 1.8rem !important;
        margin-bottom: 6px !important;
    }
    
    .gender-text {
        font-size: 0.9rem !important;
    }
    
    .navigation {
        margin-top: 30px !important;
        gap: 15px !important;
        flex-direction: row !important;
    }
    
    label {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="number"] {
        padding: 16px 18px !important;
        font-size: 0.95rem !important;
        min-height: 52px !important;
        border-radius: 12px !important;
    }
}

/* ===== EXTRA SMALL SCREENS ===== */
@media (max-width: 480px) {
    .question-container {
        width: 98%;
        padding: 15px;
        margin: 90px auto 12px auto;
    }
    
    /* ULTIMATE MOBILE FOOTER FIX - Flexbox layout */
    body, body.page-top {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        padding-top: 70px !important; /* Keep navbar space */
        display: flex !important;
        flex-direction: column !important;
        overflow-x: hidden !important;
    }
    
    html {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    .question-container {
        flex: 1 !important;
        margin-bottom: 0 !important;
    }
    
    /* Force footer to bottom with minimal padding */
    .footer {
        padding: 6px 0 !important;
        margin: 0 !important;
        margin-top: auto !important;
        width: 100% !important;
        background: transparent !important;
        flex-shrink: 0 !important;
    }
    
    /* Remove all container bottom spacing */
    .container, .row, .col-lg-4, .footer .container {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
        margin-bottom: 20px !important;
    }
    
    .option-label {
        padding: 14px 16px !important;
        font-size: 0.9rem !important;
        min-height: 48px !important;
    }
    
    .navigation {
        gap: 12px !important;
        margin-top: 25px !important;
    }
    
    .nav-btn {
        padding: 14px 18px !important;
        font-size: 0.9rem !important;
        min-height: 48px !important;
    }
    
    /* Single button extra small styling */
    .nav-btn:not(.navigation .nav-btn) {
        width: 75% !important;
        max-width: 250px !important;
        margin: 25px auto 0 auto !important;
    }
    
    label {
        font-size: 0.95rem !important;
    }
}
