/* Wedding Game Questions Page Styles */

/* Page Layout */
.question-bank-page {
    padding: 2rem 0 4rem;
    overflow-x: clip;
}

/* Hero Section */
.page-hero {
    text-align: center;
    padding: 2rem 0 3rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

/* Hero Decorative Splash Images */
.hero-splash {
    position: absolute;
    width: 600px;
    height: auto;
    opacity: 1;
    pointer-events: none;
    z-index: -1;
}

.hero-splash-left {
    top: -40px;
    left: -550px;
    transform: rotate(35deg);
}

.hero-splash-right {
    top: -40px;
    right: -500px;
    transform: rotate(20deg) scaleX(-1);
}

.page-title {
    font-family: 'ChenYuluoyan', 'SatsukiGendaiMincho', 'Noto Serif TC', serif;
    font-size: 4rem;
    color: var(--color-text-main);
    margin-bottom: 2rem;
    font-weight: normal;
    line-height: 1.4;
}

.page-description {
    font-size: 1.2rem;
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: 0;
    text-align: left;
}

/* Section Styling */
.selector-section,
.selected-section,
.export-section {
    background: var(--color-surface);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.section-title {
    font-family: 'SatsukiGendaiMincho', 'Noto Serif TC', serif;
    font-size: 1.5rem;
    color: var(--color-text-main);
    margin-bottom: 1.5rem;
    font-weight: normal;
}

.section-hint {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-top: -1rem;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Center title in selector-section */
.selector-section .section-title {
    text-align: center;
}

/* Center title and hint in selected-section */
.selected-section .section-title,
.selected-section .section-hint {
    text-align: center;
}

.selected-count {
    color: var(--color-primary);
    font-weight: 500;
}

/* Category Pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-family: 'SatsukiGendaiMincho', serif;
    font-size: 1rem;
    color: var(--color-text-main);
    background: transparent;
    border: 2px solid var(--color-primary);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-pill:hover {
    background: rgba(240, 98, 146, 0.1);
    transform: translateY(-2px);
}

.category-pill.active {
    background: linear-gradient(135deg, var(--color-primary), rgba(240, 120, 160, 0.95));
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-soft);
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary);
    border-radius: 50px;
}

.category-pill.active .pill-badge {
    background: rgba(255, 255, 255, 0.95);
}

/* Question List */
.question-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
}

.question-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.question-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.question-item:last-child {
    border-bottom: none;
}

.question-item:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.question-item:hover {
    background: rgba(240, 98, 146, 0.08);
}

.question-item.selected {
    background: rgba(240, 98, 146, 0.12);
}

.question-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.question-text {
    flex: 1;
    font-size: 1.05rem;
    color: var(--color-text-main);
    line-height: 1.5;
}

/* Selected Questions */
.selected-questions-container {
    min-height: 150px;
    position: relative;
}

.selected-questions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selected-question-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: grab;
    transition: all 0.2s ease;
}

.question-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    overflow: hidden;
    /* Prevent spillover */
}

.selected-question-item:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.selected-question-item.dragging {
    opacity: 0.9;
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.selected-question-item.drag-over {
    border-color: var(--color-primary);
    background: rgba(240, 98, 146, 0.1);
}

.selected-question-item.shift-down {
    transform: translateY(100%);
    transition: transform 0.2s ease;
}

.selected-question-item.shift-up {
    transform: translateY(-100%);
    transition: transform 0.2s ease;
}

.drag-handle {
    color: var(--color-text-light);
    font-size: 1.2rem;
    cursor: grab;
    user-select: none;
}

.question-number {
    font-weight: 600;
    color: var(--color-primary);
    min-width: 2rem;
}

.question-category-tag {
    font-size: 0.85rem;
    color: var(--color-text-light);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    white-space: nowrap;
    min-width: 7rem;
    text-align: center;
    display: inline-block;
    box-sizing: border-box;
}

/* Question Options Grid */
.question-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
    margin-left: 10.5rem;
    /* Align with question text (question-number 2rem + gap 0.75rem + category-tag 7rem + gap 0.75rem) */
    width: calc(100% - 10.5rem);
    flex-basis: 100%;
}

.options-row {
    display: flex;
    gap: 2rem;
}

.option-item {
    font-size: 0.85rem;
    color: var(--color-text-light);
    min-width: 120px;
    text-align: left;
}

.option-item.correct-option {
    font-weight: bold;
    color: var(--color-text-main);
}

.selected-question-text {
    flex: 1;
    font-size: 1rem;
    color: var(--color-text-main);
}

.remove-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-light);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: rgba(240, 98, 146, 0.2);
    color: var(--color-primary);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: var(--color-text-light);
    text-align: center;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state p {
    margin: 0;
    font-size: 1.1rem;
}

/* Add Custom Question Button */
.add-custom-question-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed rgba(240, 98, 146, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-custom-question-btn:hover {
    background: rgba(240, 98, 146, 0.1);
    border-color: var(--color-primary);
}

.add-custom-question-btn .add-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-primary);
    line-height: 1;
}

/* Export Section */
.export-section {
    text-align: center;
}

.export-content-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.export-content-wrapper picture,
.export-content-wrapper img {
    width: 0;
    min-width: 100%;
    margin-top: 0.5rem;
    height: auto;
}

.export-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
    /* Ensure buttons fill the wrapper if it grows? No, let buttons define width */
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-main);
    border: 2px solid var(--color-text-light);
    border-radius: 50px;
    padding: 14px 36px;
    font-family: 'SatsukiGendaiMincho', serif;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* Scrollbar Styling */
.question-list-container::-webkit-scrollbar {
    width: 8px;
}

.question-list-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.question-list-container::-webkit-scrollbar-thumb {
    background: rgba(240, 98, 146, 0.4);
    border-radius: 4px;
}

.question-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(240, 98, 146, 0.6);
}

/* Partner Section */
.partner-section {
    background: var(--color-surface);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.partner-section .section-title {
    text-align: center;
}

.partner-content {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.partner-image {
    width: 180px;
    height: auto;
    border-radius: 12px;
    flex-shrink: 0;
}

.partner-text {
    flex: 1;
}

.partner-text p {
    font-size: 1.1rem;
    color: var(--color-text-main);
    line-height: 1.8;
    margin: 0 0 1rem 0;
}

.partner-text p:last-child {
    margin-bottom: 0;
}

.partner-text a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.partner-text a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .question-bank-page {
        padding: 1rem 0 3rem;
    }

    /* Hide splash images on mobile */
    .hero-splash {
        display: none;
    }

    .page-title {
        font-size: 2.7rem;
    }

    .page-description {
        font-size: 1.1rem;
        padding-left: 1rem;
    }

    .page-hero .section-title {
        padding-left: 1rem;
    }

    .selector-section,
    .selected-section,
    .export-section {
        padding: 1.5rem;
        border-radius: 16px;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .category-pill {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    .question-list-container {
        max-height: 350px;
    }

    .question-item {
        padding: 0.875rem 1rem;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .selected-question-item {
        flex-wrap: nowrap;
        /* Prevent wrapping, let wrapper handle it */
        padding: 0.875rem 0.5rem;
        align-items: flex-start;
        /* Align handle/btn to top */
    }

    /* Content Wrapper */
    .question-content-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        /* Left-align children */
        gap: 0.1rem;
        flex: 1;
        margin-right: 0.5rem;
    }

    /* Hide question number on mobile */
    .question-number {
        display: none;
    }

    /* Text */
    .selected-question-text {
        width: 100%;
        order: 1;
        /* First */
        margin: 0;
        font-size: 1rem;
        line-height: 1.4;
    }

    /* Category Tag */
    .question-category-tag {
        order: 2;
        /* Second */
        width: auto;
        min-width: 0;
        margin: 0;
        background: transparent;
        border: none;
        padding: 0;
        color: #999;
        font-size: 0.85rem;
        display: block;
        text-align: left;
        /* No indentation needed as it's in the same flex column as text */
    }

    /* Question Options Grid on Mobile */
    .question-options-grid {
        order: 3;
        /* Third, after category tag */
        margin-top: 0.25rem;
        margin-left: 0;
        width: 100%;
    }

    .option-item {
        font-size: 0.85rem;
        min-width: 100px;
    }

    .drag-handle {
        margin-right: 0.5rem;
        margin-top: 0.1rem;
        /* Visual alignment with text */
    }

    .remove-btn {
        margin-left: 0;
        /* Wrapper takes flex 1 so this naturally sits at end */
        margin-top: -0.2rem;
        /* Slight adjustment */
    }

    .export-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .export-btn {
        width: 100%;
        justify-content: center;
    }

    .partner-section {
        padding: 1.5rem;
        border-radius: 16px;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .partner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .partner-image {
        width: 150px;
        align-self: center;
    }

    .partner-text {
        text-align: left;
    }
}