/* ============================================
   MODAL.CSS - 模态框、捐款、消息选择器样式
   ============================================ */

/* --- MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--easing), visibility 0.4s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s var(--easing);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    color: #fff;
    text-align: left;
    touch-action: pan-y;
    /* Enable scrolling */
}

body.light-theme .modal-content {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--font-serif);
}

.modal-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0 0.5rem;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.platform-info h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #4facfe;
    font-family: var(--font-sans);
}

body.light-theme .platform-info h4 {
    color: #4facfe;
    font-weight: 700;
}

.platform-info p {
    margin-bottom: 0.4rem;
    font-family: var(--font-sans);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 3px;
}

.badge.success {
    background: rgba(81, 207, 102, 0.2);
    color: #51cf66;
}

.badge.warning {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

body.light-theme .badge.success {
    background: rgba(81, 207, 102, 0.15);
    color: #2b8a3e;
}

body.light-theme .badge.warning {
    background: rgba(255, 107, 107, 0.15);
    color: #c92a2a;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.modal-btn {
    background: #4facfe;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.modal-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

body.light-theme .modal-btn.secondary {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.light-theme .modal-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* --- DONATION MODAL STYLES --- */
.sad-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: float 6s ease-in-out infinite;
}

.sad-icon-wrapper svg {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.donate-tabs {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.donate-tabs .filter-btn {
    min-width: 90px;
    text-align: center;
    justify-content: center;
}

.donate-tabs .filter-btn.active {
    background: #4facfe;
    color: white;
    border-color: transparent;
}

.qr-wrapper {
    background: white;
    padding: 12px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.qr-wrapper:hover {
    transform: scale(1.02);
}

#donateQrImg {
    width: 200px;
    height: 200px;
    display: block;
    border-radius: 4px;
}

/* --- MESSAGE PICKER STYLES --- */
.message-picker-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    width: 100%;
    animation: fadeIn 0.8s var(--easing) forwards;
}

.message-picker-container.active {
    display: flex;
}

.message-content-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.instruction-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

body.light-theme .instruction-text {
    color: rgba(0, 0, 0, 0.5);
}

/* Quote Card */
.quote-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.6;
    text-align: center;
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

body.light-theme .quote-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

body.light-theme .refresh-btn {
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .refresh-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    border-color: rgba(0, 0, 0, 0.4);
}

/* Custom Textarea */
.custom-textarea {
    width: 100%;
    max-width: 320px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1rem;
    color: #fff;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.5;
    resize: none;
    text-align: center;
    transition: all 0.3s ease;
}

.custom-textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4facfe;
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.3);
}

body.light-theme .custom-textarea {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-theme .custom-textarea:focus {
    background: rgba(0, 0, 0, 0.05);
}

.validation-status {
    font-size: 0.8rem;
    height: 1.2rem;
    transition: color 0.3s;
}

.validation-status.error {
    color: #ff6b6b;
}

.validation-status.success {
    color: #51cf66;
}

/* --- VIDEO DONATION MODAL MOBILE OPTIMIZATION --- */
#videoDonationModal .modal-content {
    max-height: 90vh;
    max-height: 90vh;
    overflow-y: auto;
}

#videoDonationModal .qr-wrapper {
    align-self: center;
}

@media (max-width: 480px) {
    #videoDonationModal .modal-content {
        max-height: 85vh;
        padding: 1rem;
        gap: 0.8rem;
    }

    #videoDonationModal .modal-header h3 {
        font-size: 1.1rem;
    }

    #videoDonationModal .modal-body {
        gap: 0.8rem;
    }

    #videoDonationModal .video-donation-notice {
        padding: 0.8rem !important;
        margin-bottom: 0.8rem !important;
    }

    #videoDonationModal .video-donation-notice p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    #videoDonationModal .video-donation-notice p:last-child {
        font-size: 0.75rem !important;
    }

    #videoDonationModal .donate-tabs {
        margin-bottom: 0.8rem !important;
    }

    #videoDonationModal .donate-tabs .filter-btn {
        min-width: 70px !important;
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    #videoDonationModal .qr-wrapper {
        padding: 8px !important;
    }

    #videoDonationModal #videoDonateQrImg {
        width: 140px !important;
        height: 140px !important;
    }

    #videoDonationModal #videoVerifyCode {
        width: 120px !important;
        padding: 6px 10px !important;
        font-size: 0.85rem !important;
    }

    #videoDonationModal #videoVerifyBtn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    #videoDonationModal #videoDonationCancel {
        margin-top: 0.8rem !important;
        padding: 8px 20px;
        font-size: 0.85rem;
    }
}