/**
 * index.css - Miracle Everyday Campaign Design System
 * Premium design for Article and Video LIFF applications.
 */

:root {
    /* Color Palette */
    --line-green: #06C755;
    --line-green-dark: #05a346;
    --accent-blue: #38bdf8;
    --bg-dark: #000000;
    --bg-light: #FAFAFA;
    --text-main: #333333;
    --text-muted: #666666;
    --white: #ffffff;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- LOADING SPLASH --- */
#liff-loading-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

/* Splash context-aware colors */
body.video-view #liff-loading-splash { background: var(--bg-dark); }
body.article-view #liff-loading-splash { background: var(--white); }
body.register-view #liff-loading-splash { background: #f5f7fa; }

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(125, 211, 252, 0.1);
    border-left-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* --- VIDEO VIEW --- */
body.video-view {
    background-color: var(--bg-dark);
}

.video-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#player, iframe {
    width: 100% !important;
    max-width: 480px;
    aspect-ratio: 9 / 16;
    max-height: 85vh;
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
    background: #111;
}

/* --- ARTICLE VIEW --- */
body.article-view {
    background-color: var(--bg-light);
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 100px; /* Space for CTA */
    background: var(--white);
}

.article-container img {
    width: 100%;
    display: block;
}

.content {
    padding: 24px 20px;
    line-height: 1.8;
    color: var(--text-main);
    font-size: 17px;
}

.content h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 24px;
    color: #111;
    text-align: center;
}

/* --- CTA BANNER --- */
.cta-container {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 92%;
    max-width: 420px;
    background: var(--glass-bg);
    padding: 16px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 9000;
    text-align: center;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.cta-container.visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cta-button {
    background: linear-gradient(135deg, var(--line-green) 0%, var(--line-green-dark) 100%);
    color: white;
    border: none;
    padding: 18px;
    width: 100%;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(6, 199, 85, 0.3);
    transition: all 0.3s ease;
}

.cta-button:active {
    transform: scale(0.97);
}

/* --- DEBUG OVERLAY --- */
#debug-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 180px;
    background: rgba(0, 0, 0, 0.85);
    color: #00ff00;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 11px;
    padding: 12px;
    overflow-y: auto;
    z-index: 9999;
    pointer-events: none;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}
