/* static/css/ticket/donate.css */

/* ===== 打賞 Modal ===== */
.donate-modal {
    border-radius: 20px;
    overflow: hidden;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.donate-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 20px 24px;
}

.donate-header .modal-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.donate-header .btn-close {
    filter: brightness(0) invert(1);
}

.donate-intro {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.donate-intro i {
    color: #e74c3c;
    margin-right: 6px;
}

/* ===== 打賞檔位網格 ===== */
.donate-levels-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.donate-level-wrapper {
    position: relative;
}

.donate-level-btn {
    width: 100%;
    padding: 16px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.donate-level-btn:hover {
    border-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.15);
}

.donate-level-btn.selected {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
    transform: scale(1.02);
}

/* 背景圖片按鈕 */
.donate-bg-image {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative;
    min-height: 120px;
    color: white;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
    border: none;
}

.donate-bg-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    z-index: 1;
}

.donate-bg-image .level-name,
.donate-bg-image .level-points,
.donate-bg-image .level-usd {
    position: relative;
    z-index: 2;
}

.donate-bg-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.donate-bg-image.selected {
    box-shadow: 0 0 0 3px #e74c3c, 0 10px 30px rgba(231, 76, 60, 0.4);
    transform: scale(1.03);
}

.level-icon {
    font-size: 28px;
    line-height: 1;
}

.level-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.level-points {
    font-weight: 700;
    color: #e74c3c;
    font-size: 0.9rem;
}

.donate-bg-image .level-points {
    color: #ffd966;
}

.level-usd {
    font-size: 0.75rem;
    color: #999;
}

.donate-bg-image .level-usd {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== 留言區域 ===== */
.donate-message-area {
    margin-bottom: 16px;
}

.donate-message-area label {
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
    display: block;
}

.donate-message-area label i {
    color: #e74c3c;
    margin-right: 6px;
}

.donate-message-area textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    resize: vertical;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.donate-message-area textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ===== 匿名選項 ===== */
.donate-anonymous {
    margin-bottom: 16px;
}

.donate-anonymous label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
}

.donate-anonymous input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===== 預覽區域 ===== */
.selected-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fdf2f2, #fde8e8);
    border-radius: 12px;
    border: 1px solid #f5c6c6;
}

.selected-preview span:first-child {
    color: #666;
}

.selected-preview #previewName {
    font-weight: 600;
    color: #e74c3c;
}

.selected-preview #previewPoints {
    font-weight: 700;
    color: #333;
    margin-left: auto;
}

/* ===== 按鈕 ===== */
.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    gap: 12px;
}

.btn-cancel {
    padding: 10px 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-confirm {
    padding: 10px 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-confirm:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 打賞成功特效 ===== */
.donate-success-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

.donate-success-effect.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

.effect-container {
    text-align: center;
    padding: 30px 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s ease;
}

/* 一般特效 */
.effect-container.basic-effect {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.effect-container .effect-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 0.6s ease;
}

/* 高級特效 */
.effect-container.premium-effect {
    background: transparent;
    box-shadow: none;
    position: relative;
}

.premium-effect .effect-image {
    max-width: 400px;
    max-height: 400px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: floatIn 0.6s ease;
}

.premium-effect .effect-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent);
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
    z-index: -1;
}

.effect-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.effect-title {
    font-size: 28px;
    font-weight: 700;
}

.effect-points {
    font-size: 36px;
    font-weight: 800;
    color: #ffd966;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.effect-thanks {
    font-size: 18px;
    opacity: 0.9;
}

.premium-effect .effect-text {
    margin-top: 20px;
    color: white;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

/* 動畫 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 高級特效 */
.effect-container.premium-effect {
    background: transparent;
    box-shadow: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.premium-effect .effect-image {
    max-width: 350px;
    max-height: 350px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: floatIn 0.6s ease;
}

/* 圖片載入失敗時的後備 */
.premium-effect .effect-fallback {
    text-align: center;
    padding: 30px;
}

.premium-effect .fallback-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.premium-effect .fallback-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.premium-effect .effect-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
    z-index: -1;
    pointer-events: none;
}

/* 不同等級的特效顏色 */
.premium-effect.mountain .effect-glow {
    background: radial-gradient(circle, rgba(139, 90, 43, 0.4), transparent 70%);
}

.premium-effect.ocean .effect-glow {
    background: radial-gradient(circle, rgba(0, 180, 219, 0.4), transparent 70%);
}

.premium-effect.star .effect-glow {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4), transparent 70%);
}

.premium-effect.moon .effect-glow {
    background: radial-gradient(circle, rgba(192, 192, 192, 0.4), transparent 70%);
}

.premium-effect.sun .effect-glow {
    background: radial-gradient(circle, rgba(255, 140, 0, 0.5), transparent 70%);
}


/* 特效容器 - 支援動態動畫時長 */
.effect-container {
    text-align: center;
    padding: 30px 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s ease;
    /* ✅ 動畫時長可通過 JS 動態設定 */
}

/* 一般特效 */
.effect-container.basic-effect {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* 高級特效 */
.effect-container.premium-effect {
    background: transparent;
    box-shadow: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.premium-effect .effect-image {
    max-width: 350px;
    max-height: 350px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: floatIn 0.6s ease;
}

/* 圖片載入失敗時的後備 */
.premium-effect .effect-fallback {
    text-align: center;
    padding: 30px;
}

.premium-effect .fallback-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.premium-effect .fallback-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.premium-effect .effect-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
    z-index: -1;
    pointer-events: none;
}

/* 不同等級的特效顏色 */
.premium-effect.mountain .effect-glow {
    background: radial-gradient(circle, rgba(139, 90, 43, 0.4), transparent 70%);
}

.premium-effect.ocean .effect-glow {
    background: radial-gradient(circle, rgba(0, 180, 219, 0.5), transparent 70%);
}

.premium-effect.star .effect-glow {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.5), transparent 70%);
}

.premium-effect.moon .effect-glow {
    background: radial-gradient(circle, rgba(192, 192, 192, 0.5), transparent 70%);
}

.premium-effect.sun .effect-glow {
    background: radial-gradient(circle, rgba(255, 140, 0, 0.6), transparent 70%);
}

.effect-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.effect-title {
    font-size: 28px;
    font-weight: 700;
}

.effect-points {
    font-size: 36px;
    font-weight: 800;
    color: #ffd966;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.effect-thanks {
    font-size: 18px;
    opacity: 0.9;
}

.premium-effect .effect-text {
    margin-top: 20px;
    color: white;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

/* 動畫 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ===== 響應式 ===== */
@media (max-width: 768px) {
    .donate-levels-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .effect-container {
        padding: 20px 30px;
    }
    
    .effect-title {
        font-size: 22px;
    }
    
    .effect-points {
        font-size: 28px;
    }
    
    .premium-effect .effect-image {
        max-width: 250px;
        max-height: 250px;
    }
}

@media (max-width: 576px) {
    .donate-levels-container {
        grid-template-columns: repeat(2, 1fr);
    }
}