/* =========================================
   Base CSS - Design System & Reset
   Theme: Cyber-Elegant
   ========================================= */

:root {
    /* Colors */
    --color-bg: #0a0a0a;
    --color-surface: rgba(255, 255, 255, 0.05);
    --color-surface-hover: rgba(255, 255, 255, 0.1);
    --color-border: rgba(255, 255, 255, 0.1);

    --color-primary: #00f2ff;
    /* Neon Cyan */
    --color-secondary: #7000ff;
    /* Neon Purple */
    --color-accent: #ff0055;
    /* Neon Pink */

    --color-text-main: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-text-light: rgba(255, 255, 255, 0.85);
    /* Added for modal/list consistency */

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 48px;

    /* Effects */
    --backdrop-blur: blur(20px);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
    --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;

    /* Safe Area Insets for notched devices */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* Focus Styles for Keyboard Accessibility */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--category-accent, var(--color-primary));
    outline-offset: 3px;
    border-radius: 4px;
}

/* Interactive elements focus */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--category-accent, var(--color-primary));
    outline-offset: 3px;
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s var(--transition-smooth) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Screen Reader Only (Accessibility) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Site Footer (Brand Polish) */
.site-footer {
    width: 100%;
    padding: 2rem 0;
    text-align: center;
    background: transparent; /* Let background elements shine through */
    position: relative;
    z-index: 10;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Subtle separator */
}

.footer-content {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.brand-name {
    color: var(--color-primary);
    font-weight: 700;
    font-family: var(--font-heading);
}

.copyright {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

/* Background Ambient Effect (Subtle Gradient Orb) */
.bg-ambient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% -20%, rgba(0, 242, 255, 0.1), transparent 70%);
    pointer-events: none;
}

/* Different ambient colors per theme */
body.theme-streamer .bg-ambient {
    background: radial-gradient(circle at 50% -20%, rgba(112, 0, 255, 0.15), transparent 70%);
}

body.theme-business .bg-ambient {
    background: radial-gradient(circle at 50% -20%, rgba(56, 189, 248, 0.1), transparent 60%);
}

/* =========================================
   Premium Aesthetics Additions
   ========================================= */

/* Fade Up Animation */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fade-up 0.8s var(--transition-smooth) forwards;
}

/* Glass Surface (Glassmorphism) */
.glass-surface {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Premium Card Hover */
.premium-card-hover {
    transition: transform 0.4s var(--transition-smooth), background 0.4s ease, box-shadow 0.4s ease;
}

.premium-card-hover:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Mesh Background Utility */
.mesh-bg-dark {
    background-color: #111;
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 172, 254, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 69, 0, 0.05) 0px, transparent 50%);
}

/* View Transition API - Cinematic Zoom/Slide */
@keyframes fade-out-up {
    to { 
        opacity: 0; 
        transform: translateY(-20px) scale(0.95); 
        filter: blur(10px);
    }
}

@keyframes fade-in-up {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(1.05); 
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

::view-transition-old(root) {
    animation: fade-out-up 0.6s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

::view-transition-new(root) {
    animation: fade-in-up 0.6s cubic-bezier(0.7, 0, 0.3, 1) forwards;
    mix-blend-mode: normal; /* Ensure no blend issues */
}

/* =========================================
   Coming Soon State
   ========================================= */

/* Top Page Card Disabled State */
.is-coming-soon {
    cursor: not-allowed !important;
    opacity: 0.7;
    filter: grayscale(80%);
    pointer-events: none; /* Disables click */
}

/* Badge for Top Page Card */
.badge-coming-soon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-main);
    padding: 0.5rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
    z-index: 10;
    white-space: nowrap;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* List Page Banner */
.coming-soon-banner {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

/* --- Streamer Theme: Mobile Header UX Optimization (v2) --- */
@media (max-width: 768px) {
    /* 
       全ストリーマーテンプレートのロゴとバッジを縦積みに統一。
       <a>タグがネストされている場合（Template E等）にも対応。
    */
    body.theme-streamer .brand,
    body.theme-streamer .brand a {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
        text-decoration: none !important;
    }

    body.theme-streamer .live-indicator,
    body.theme-streamer .channel-indicator {
        margin-left: 0 !important;
        margin-top: 2px !important;
        font-size: 0.65rem !important;
        padding: 2px 10px !important;
        width: fit-content !important;
        line-height: 1 !important;
    }

    /* ヘッダー全体の余白調整 */
    body.theme-streamer header {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        height: auto !important;
    }
}