/* LIFF App Styles - MGM 功能 */

:root {
    --primary-color: #6ec2cd;
    --btn-text-color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans TC', sans-serif;
    background: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    line-height: 1.4;
}

/* Loading page - full screen layout */
.container.loading-page {
    display: flex;
    background: white;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: 100%;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-character {
    width: 300px; /* loading-img-size */
    height: 300px; /* loading-img-size */
    object-fit: contain;
    margin-bottom: 24px;
}

.loading p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.loading-label {
    color: #555;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 28px;
}

/* Loading dots animation */
.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Legacy spinner (share page etc.) */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 40px 20px;
}

.error h2 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 20px;
}

.error p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

.success {
    text-align: center;
    padding: 40px 20px;
}

.success h2 {
    color: #27ae60;
    margin-bottom: 15px;
    font-size: 22px;
}

.success p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.referral-code-section {
    text-align: center;
    margin-bottom: 30px;
}

.referral-code-section h2 {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.referral-code {
    background: #f8f9fa;
    border: 3px dashed var(--primary-color);
    border-radius: 15px;
    padding: 25px 20px;
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 3px;
}

.action-section {
    margin-bottom: 30px;
}

.btn {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary {
    background: var(--primary-color);
    color: var(--btn-text-color);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(110, 194, 205, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: #f8f9fa;
    color: var(--btn-text-color, var(--primary-color));
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.info-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.info-section p {
    color: #495057;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.info-section p:last-child {
    margin-bottom: 0;
}

.info-section p::before {
    content: '✓';
    color: #27ae60;
    font-weight: bold;
    margin-right: 8px;
}

/* Welcome message styles */
.welcome-message {
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.welcome-message p {
    color: #721c24;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Loading page: body 不需要 padding */
body:has(.loading-page) {
    padding: 0;
}

/* Desktop QR Code Modal */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.qr-modal-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.qr-modal-image {
    width: 60vmin;
    max-width: 360px;
    min-width: 200px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin-bottom: 24px;
}

.qr-modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.5;
}

.qr-modal-subtitle {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .referral-code {
        font-size: 28px;
        padding: 20px 15px;
    }
}


