/* Donation Alert Overlay Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gold-gradient: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glow-color: rgba(102, 126, 234, 0.6);
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: transparent;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

/* Connection Status Indicator */
.status-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.status-indicator:hover {
    opacity: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffc107;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.connected .status-dot {
    background: #4caf50;
    animation: none;
}

.status-indicator.disconnected .status-dot {
    background: #f44336;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* Alert Container */
#alert-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 500px;
    margin-top: 50px;
}

/* Donation Alert Card */
.donation-alert {
    position: relative;
    width: 100%;
    padding: 24px 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow:
        0 8px 32px var(--shadow-color),
        0 0 60px var(--glow-color);
    overflow: hidden;

    /* Animation */
    animation: slideIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.donation-alert.hiding {
    animation: slideOut 0.5s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

/* Glow effect behind the card */
.alert-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--primary-gradient);
    opacity: 0.2;
    animation: rotateGlow 8s linear infinite;
    z-index: -1;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Alert Content */
.alert-content {
    position: relative;
    z-index: 1;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-icon {
    font-size: 32px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.alert-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Donor Info */
.donor-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.donor-name {
    font-size: 24px;
    font-weight: 900;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.donation-amount {
    font-size: 28px;
    font-weight: 900;
    color: #ffd700;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulseBright 1.5s ease-in-out infinite;
}

@keyframes pulseBright {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Donation Message */
.donation-message {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    word-break: break-word;
}

.donation-message:empty {
    display: none;
}

/* Large donation special effects */
.donation-alert.large-donation {
    background: linear-gradient(135deg, rgba(245, 175, 25, 0.3) 0%, rgba(241, 39, 17, 0.2) 100%);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow:
        0 8px 32px var(--shadow-color),
        0 0 80px rgba(255, 215, 0, 0.4);
}

.donation-alert.large-donation .alert-glow {
    background: var(--gold-gradient);
    opacity: 0.3;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .donation-alert {
        padding: 18px 20px;
    }

    .donor-name {
        font-size: 20px;
    }

    .donation-amount {
        font-size: 24px;
    }
}

/* ==================== */
/* Donation Form Styles */
/* ==================== */

.donate-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 40px 20px;
    overflow-y: auto;
}

.donate-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.donate-header {
    text-align: center;
    margin-bottom: 32px;
}

.streamer-avatar {
    width: 80px;
    height: 80px;
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
}

.streamer-name {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.donate-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Form Styles */
.donate-form {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.label-icon {
    font-size: 18px;
}

.optional {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group textarea {
    resize: none;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Amount Options */
.amount-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.amount-btn {
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.amount-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.amount-btn.selected {
    background: var(--primary-gradient);
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.custom-amount {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-amount input {
    flex: 1;
    padding-right: 60px;
}

.custom-amount .currency {
    position: absolute;
    right: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(238, 90, 36, 0.4);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(238, 90, 36, 0.5);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-amount {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 16px;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-primary);
    font-size: 16px;
}

/* Footer */
.donate-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== */
/* Result Pages Styles  */
/* ==================== */

.result-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.result-container {
    text-align: center;
    max-width: 400px;
    padding: 48px 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.result-icon {
    width: 100px;
    height: 100px;
    font-size: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    border-radius: 50%;
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(46, 204, 113, 0.2) 100%);
    box-shadow: 0 0 40px rgba(76, 175, 80, 0.4);
}

.failure-icon {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.3) 0%, rgba(231, 76, 60, 0.2) 100%);
    box-shadow: 0 0 40px rgba(244, 67, 54, 0.4);
}

.result-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.result-message {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-primary {
    color: #ffffff;
    background: var(--primary-gradient);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
}

.result-footer {
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 500px) {
    .donate-form {
        padding: 24px 20px;
    }

    .amount-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .streamer-name {
        font-size: 24px;
    }
}