/* =====================================================
   AI PULSE Magazine - Glossy Magazine Aesthetic
   ===================================================== */

/* CSS Variables */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #ff00ff;
    --background-color: #0a0a0f;
    --surface-color: #12121a;
    --surface-light: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);

    /* Page dimensions */
    --page-width: min(95vw, 900px);
    --page-height: min(90vh, 1200px);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* =====================================================
   Particle Background
   ===================================================== */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#particles {
    width: 100%;
    height: 100%;
}

.particle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 0, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 212, 255, 0.03) 0%, transparent 70%);
    animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* =====================================================
   Magazine List Page
   ===================================================== */
.magazine-list-page {
    min-height: 100vh;
    padding: var(--spacing-xl);
    position: relative;
}

.list-header {
    text-align: center;
    padding: var(--spacing-3xl) 0;
    position: relative;
    z-index: 1;
}

.logo-container {
    display: inline-block;
}

.logo {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
}

.logo .pulse, .logo span {
    color: var(--secondary-color);
    -webkit-text-fill-color: var(--secondary-color);
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: var(--spacing-sm);
}

.issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) 0;
    position: relative;
    z-index: 1;
}

/* Issue Card */
.issue-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    aspect-ratio: 3/4;
}

.issue-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-glow);
}

.card-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 14px;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.issue-card:hover .card-glow {
    opacity: 0.6;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
}

.cover-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-slow);
}

.cover-image.placeholder {
    background: linear-gradient(135deg, var(--surface-light) 0%, var(--surface-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.issue-card:hover .cover-image {
    transform: scale(1.1);
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
}

.issue-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-xs);
}

.issue-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.issue-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.publication-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-hover-effect {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.issue-card:hover .card-hover-effect {
    opacity: 1;
}

.read-btn {
    padding: var(--spacing-sm) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
}

/* Empty State */
.no-issues {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-3xl);
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.empty-state h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-secondary);
}

/* Footer */
.list-footer {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

/* =====================================================
   Magazine Viewer
   ===================================================== */
.magazine-viewer {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--background-color);
}

/* Viewer Navigation */
.viewer-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.nav-back:hover {
    color: var(--primary-color);
}

.nav-back svg {
    width: 20px;
    height: 20px;
}

.nav-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.title-text {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.issue-badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-toc-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-toc-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-toc-toggle svg {
    width: 20px;
    height: 20px;
}

/* Table of Contents Sidebar */
.toc-sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    width: 320px;
    height: calc(100vh - 60px);
    background: rgba(18, 18, 26, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    z-index: 99;
    overflow-y: auto;
}

.toc-sidebar.open {
    transform: translateX(0);
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toc-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.toc-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.toc-close:hover {
    color: var(--primary-color);
}

.toc-close svg {
    width: 20px;
    height: 20px;
}

.toc-list {
    list-style: none;
    padding: var(--spacing-md);
}

.toc-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toc-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toc-item.featured {
    background: rgba(0, 212, 255, 0.1);
    border-left: 3px solid var(--primary-color);
}

.toc-page {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--primary-color);
    min-width: 30px;
}

.toc-content {
    flex: 1;
}

.toc-title {
    display: block;
    font-weight: 500;
    margin-bottom: 2px;
}

.toc-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =====================================================
   Flipbook Container - StPageFlip Integration
   ===================================================== */
.flipbook-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px var(--spacing-2xl) 60px;
    position: relative;
    min-height: 100vh;
}

.flipbook {
    width: calc(var(--page-width) * 2 + 4px);
    height: var(--page-height);
    position: relative;
    background: transparent;
    border-radius: 4px;
}

/* StPageFlip Library Overrides */
.stf__wrapper {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 0;
}

.stf__block {
    background: var(--background-color);
}

/* Page styles within StPageFlip */
.stf__item {
    background: var(--surface-color);
}

/* Soft shadow on the page edge during flip */
.stf__page > .stf__outerShadow {
    opacity: 0.4;
}

/* Inner shadow during page curl */
.stf__page > .stf__innerShadow {
    opacity: 0.3;
}

/* Book spine shadow effect */
.flipbook::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 30px;
    transform: translateX(-50%);
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 30%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(0, 0, 0, 0.2) 70%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: 100;
    pointer-events: none;
}

/* Individual Page - Styled for StPageFlip */
.page {
    width: 100%;
    height: 100%;
    background: var(--page-bg, var(--surface-color));
    color: var(--page-text, var(--text-primary));
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Paper Texture Overlay */
.paper-texture {
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Glossy Light Reflection */
.page-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.3s ease;
}

/* StPageFlip handles all page curl/flip animations natively */

/* Page Number */
.page-number {
    position: absolute;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    z-index: 50;
}

/* StPageFlip provides realistic canvas-based page curl with mesh deformation */

/* Navigation Buttons */
.flip-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 50;
}

.flip-nav:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.flip-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.flip-nav svg {
    width: 24px;
    height: 24px;
}

.flip-prev {
    left: var(--spacing-lg);
}

.flip-next {
    right: var(--spacing-lg);
}

/* Page Indicator */
.page-indicator {
    position: fixed;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    z-index: 50;
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    bottom: var(--spacing-lg);
    left: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    z-index: 50;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.zoom-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.zoom-btn svg {
    width: 16px;
    height: 16px;
}

.zoom-level {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
}

/* Flipbook zoom state */
.flipbook {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.flipbook-container.zoomed {
    overflow: auto;
    cursor: grab;
}

.flipbook-container.zoomed:active {
    cursor: grabbing;
}

/* Keyboard Hints */
.keyboard-hints {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-lg);
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 50;
}

.keyboard-hints kbd {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    margin-right: 4px;
}

/* =====================================================
   Page Layouts
   ===================================================== */

/* COVER PAGE */
.cover-layout {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.cover-hero {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.cover-gradient {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
}

.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

.cover-content {
    position: relative;
    padding: var(--spacing-2xl);
    z-index: 10;
}

.cover-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--primary-color);
    color: var(--background-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 4px;
    margin-bottom: var(--spacing-lg);
}

.cover-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.cover-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 80%;
}

.cover-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cover-logo span {
    -webkit-text-fill-color: var(--secondary-color);
}

/* TABLE OF CONTENTS PAGE */
.toc-layout {
    padding: var(--spacing-2xl);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.toc-page-header {
    margin-bottom: var(--spacing-xl);
}

.toc-page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.toc-decoration {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.toc-entries {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.toc-entry {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toc-entry:hover {
    transform: translateX(8px);
}

.toc-entry.featured .toc-entry-title {
    color: var(--primary-color);
}

.toc-entry-content {
    flex: 1;
}

.toc-entry-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.toc-entry-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.toc-entry-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        var(--text-muted) 0px,
        var(--text-muted) 2px,
        transparent 2px,
        transparent 6px
    );
    opacity: 0.3;
}

.toc-entry-page {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* ARTICLE PAGE */
.article-layout {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.article-layout::-webkit-scrollbar {
    width: 6px;
}

.article-layout::-webkit-scrollbar-track {
    background: transparent;
}

.article-layout::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.article-hero {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(0, 0, 0, 0.7);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.article-content {
    padding: var(--spacing-xl);
}

.article-header {
    margin-bottom: var(--spacing-xl);
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.article-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.article-byline {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
}

.author-title {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-body p {
    margin-bottom: var(--spacing-lg);
}

/* Drop Cap */
.drop-cap p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    line-height: 0.8;
    margin-right: var(--spacing-md);
    margin-top: var(--spacing-xs);
    color: var(--primary-color);
}

/* Pull Quote */
.pull-quote {
    position: relative;
    padding: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
    background: rgba(0, 212, 255, 0.05);
    border-left: 4px solid var(--primary-color);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-primary);
}

.quote-mark {
    position: absolute;
    top: -10px;
    left: var(--spacing-md);
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

/* FEATURE PAGE */
.feature-layout {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.feature-hero {
    position: relative;
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
}

.feature-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--page-bg, var(--surface-color)) 100%);
}

.feature-content {
    padding: var(--spacing-xl);
}

.feature-header {
    margin-bottom: var(--spacing-xl);
}

.feature-label {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 4px;
    margin-bottom: var(--spacing-md);
}

.feature-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.feature-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    padding: var(--spacing-lg);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.feature-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.feature-body p {
    margin-bottom: var(--spacing-lg);
}

.feature-quote {
    padding: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(255, 0, 255, 0.1));
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-style: italic;
    text-align: center;
    color: var(--text-primary);
}

.feature-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--spacing-xl);
}

/* Dark Variant */
.dark-variant {
    --page-bg: #05050a;
}

/* VIDEO PAGE */
.video-layout {
    height: 100%;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
}

.video-header {
    margin-bottom: var(--spacing-xl);
}

.video-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.video-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

.video-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-description {
    margin-top: var(--spacing-xl);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* EMBEDDED CONTENT PAGE */
.embedded-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
}

.embedded-header {
    padding: var(--spacing-md);
}

.embedded-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.embedded-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.embedded-container {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-light);
}

.embedded-container iframe {
    border: none;
    display: block;
}

/* GALLERY PAGE */
.gallery-layout {
    height: 100%;
    padding: var(--spacing-xl);
    overflow-y: auto;
}

.gallery-header {
    margin-bottom: var(--spacing-xl);
}

.gallery-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.gallery-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.gallery-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-sm);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.2), rgba(128, 128, 128, 0.1));
    border: 2px dashed rgba(128, 128, 128, 0.4);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
}

.gallery-placeholder span:first-child {
    font-size: 2rem;
    opacity: 0.5;
}

/* BACK COVER PAGE */
.back-cover-layout {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
    text-align: center;
    padding: var(--spacing-2xl);
}

.back-cover-content {
    max-width: 400px;
}

.back-logo {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xl);
}

.back-logo span {
    -webkit-text-fill-color: var(--secondary-color);
}

.back-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.back-message {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--background-color);
    transform: translateY(-4px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.back-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* =====================================================
   Not Published Page
   ===================================================== */
.not-published-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.content-box {
    text-align: center;
    padding: var(--spacing-3xl);
    background: var(--surface-color);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.content-box .logo {
    font-size: 2rem;
    margin-bottom: var(--spacing-xl);
}

.content-box h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.content-box p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.back-link {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 30px;
    color: var(--background-color);
    text-decoration: none;
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* =====================================================
   Single Page View
   ===================================================== */
.single-page-view {
    min-height: 100vh;
    padding: var(--spacing-xl);
}

.single-nav {
    margin-bottom: var(--spacing-xl);
}

.single-nav a {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.single-nav a:hover {
    color: var(--primary-color);
}

.single-nav svg {
    width: 20px;
    height: 20px;
}

.single-page-container {
    max-width: 800px;
    margin: 0 auto;
}

.single-page-container h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: var(--spacing-xl);
}

.single-page-content {
    line-height: 1.8;
    color: var(--text-secondary);
}

/* =====================================================
   Responsive Design
   ===================================================== */

/* Tablet and larger - show 2-page spread */
@media (min-width: 1024px) {
    :root {
        --page-width: min(48vw, 580px);
        --page-height: min(88vh, 820px);
    }
}

/* Tablets - smaller 2-page spread */
@media (min-width: 769px) and (max-width: 1023px) {
    :root {
        --page-width: min(46vw, 440px);
        --page-height: min(82vh, 640px);
    }
}

/* Mobile - single page view (StPageFlip portrait mode) */
@media (max-width: 768px) {
    :root {
        --page-width: 95vw;
        --page-height: 82vh;
    }

    /* Single page layout on mobile - StPageFlip handles this via usePortrait */
    .flipbook {
        width: var(--page-width);
    }

    /* Hide book spine shadow on mobile */
    .flipbook::before {
        display: none;
    }

    .viewer-nav {
        padding: 0 var(--spacing-md);
    }

    .nav-title .title-text {
        display: none;
    }

    .flip-nav {
        width: 40px;
        height: 60px;
    }

    .flip-prev {
        left: var(--spacing-sm);
    }

    .flip-next {
        right: var(--spacing-sm);
    }

    .keyboard-hints {
        display: none;
    }

    .zoom-controls {
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
    }

    .toc-sidebar {
        width: 100%;
    }

    .article-hero {
        height: 200px;
    }

    .feature-hero {
        height: 180px;
    }

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

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

    .cover-content {
        padding: var(--spacing-lg);
    }

    .cover-title {
        font-size: 1.75rem;
    }

    .issues-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 480px) {
    .issues-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .social-links {
        gap: var(--spacing-sm);
    }

    .social-link {
        width: 40px;
        height: 40px;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    .viewer-nav,
    .toc-sidebar,
    .flip-nav,
    .page-indicator,
    .keyboard-hints,
    .zoom-controls,
    .particle-container,
    .particle-bg {
        display: none !important;
    }

    .page {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
