/* Survey Page Styles */

/* Reset & Base */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    overflow: hidden; /* Prevent body scroll */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Fixed Background */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../lucky/wheel/background.jpg') no-repeat center center;
    background-size: 100% 100%;
    z-index: -1;
}

/* Header Logos */
.header-logos {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.logo-left {
    height: 24px;
    width: auto;
}

.logo-right {
    height: 24px;
    width: auto;
}

/* Main Layout Container */
.main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden; /* Contain content */
    padding-bottom: 20px; /* Bottom spacing */
}

/* Top Gift Image */
.top-gift-img {
    width: 100%;
    max-width: 400px; /* Adjust as needed */
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
    flex-shrink: 0;
    max-height: 25vh; /* Limit height on small screens */
}

/* Card Container */
.survey-card-wrapper {
    flex: 1;
    width: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Crucial for fixed card effect */
    min-height: 0; /* Flexbox scrolling fix */
    gap: 16px; /* Gap between card and button */
}

/* Survey Card */
.survey-card {
    background: #fff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    flex: 1; /* Take available space */
    min-height: 0; /* Allow shrinking */
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    overflow: hidden; /* Clip children */
}

/* Scrollable Questions Area */
.questions-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Questions */
.question-group {
    margin-bottom: 16px;
}

.question-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.q-num {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #c42f10;
    color: #fff;
    font-weight: bold;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.q-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #000;
}

/* Dividers */
.divider {
    height: 1px;
    background-color: #eee;
    margin: 20px 0;
}

/* Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 0; 
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Swapped Images for Selected/Unselected logic as requested */
/* Radio */
.icon.radio {
    background-image: url('../lucky/survey/radio_checked.png'); /* Swapped from unchecked */
}

.option-item.selected .icon.radio {
    background-image: url('../lucky/survey/radio_unchecked.png'); /* Swapped from checked */
}

/* Checkbox */
.icon.checkbox {
    background-image: url('../lucky/survey/checkbox_checked.png'); /* Swapped from unchecked */
}

.option-item.selected .icon.checkbox {
    background-image: url('../lucky/survey/checkbox_unchecked.png'); /* Swapped from checked */
}

.label {
    font-size: 15px;
    color: #333;
    line-height: 1.3;
}

/* Footer Outside Card */
.outside-footer {
    padding: 0; /* No padding needed as it's just the button */
    background: transparent;
    flex-shrink: 0;
    width: 100%;
}

/* Submit Button */
#submitBtn {
    width: 100%;
    background-color: #ccc; /* Default Disabled Color */
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 16px;
    border: none;
    border-radius: 50px;
    cursor: pointer; /* Changed to allow clicking when disabled */
    box-shadow: none;
    transition: all 0.3s;
}

#submitBtn.active {
    background-color: #c42f10; /* Active Color */
    background: linear-gradient(90deg, #c42f10, #e64525);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(196, 47, 16, 0.3);
}

#submitBtn.active:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Toast Message */
#toast {
    visibility: hidden;
    min-width: 300px; /* Increased from 250px */
    max-width: 90%;   /* Increased from 80% */
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .survey-card-wrapper {
        padding: 0 40px;
    }
    .questions-scroll-area {
        padding: 40px;
    }
}
