@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;500;700&family=Playfair+Display:wght@600&display=swap');

:root {
    --bg-color: #0f172a;
    --accent-color: #fbbf24;
    --text-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition-speed: 0.5s;
}

[v-cloak] {
    display: none;
}

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

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Dynamic Background */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    z-index: -1;
}

/* Header */
.main-header {
    position: absolute;
    top: 2rem;
    width: 100%;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.main-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--accent-color);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    letter-spacing: 0.05em;
    padding: 0 1rem;
}

/* Main Container */
#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.story-container {
    width: 100%;
    flex: 1; /* Take remaining vertical space */
    position: relative;
    max-width: 800px;
    display: flex; /* Ensure centering works if needed */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Hide overflow from transitions */
}

/* Story Pages & Transitions */
.story-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem; /* Add padding to prevent edge touching */
}

/* Vue Animations */
.fade-enter-active,
.fade-leave-active {
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.fade-enter-from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
}

.fade-leave-to {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
}

.fade-enter-to,
.fade-leave-from {
    opacity: 1;
    transform: scale(1) translateY(0);
}


/* Glass Panel Content */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

/* Cover Gallery */
.cover-gallery {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 600px;
}

.cover-gallery img {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    object-fit: cover;
    transition: all 0.3s ease;
}

/* Single Image Mode */
.cover-gallery.single img {
    width: 100%;
    max-width: 400px;
    height: auto;
    max-height: 300px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Multi Image Mode */
.cover-gallery.multi img {
    width: 100px;
    height: 100px;
    opacity: 0.8;
    cursor: pointer;
}

.cover-gallery.multi img:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Typography & Content */
h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.nav-btn {
    padding: 12px 32px;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.nav-btn.primary {
    background: var(--accent-color);
    color: #1e293b;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.nav-btn.secondary {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.nav-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Image Handling */
.image-wrapper {
    width: 100%;
    max-height: 50vh;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sub-text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: -1rem;
}

/* Navigation Controls (Bottom) */
.navigation-controls {
    position: absolute;
    bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 20;
}

.icon-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.icon-btn:not(:disabled):hover {
    background: rgba(255,255,255,0.2);
}

.progress-indicators {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transition: all 0.3s;
    cursor: pointer; /* Clickable in Vue version */
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

/* RWD */
@media (max-width: 600px) {
    .main-header h1 {
        font-size: 1.5rem;
    }
    
    .story-page {
        width: 95%;
        height: 85%;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }
}
