:root {
    --bg-color: #030303;
    --accent-color: #f7b731;
    --glass-bg: rgba(10, 10, 10, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
    --text-primary: #f5f5f5;
    --text-secondary: rgba(255, 255, 255, 0.4);
    --transition-premium: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 50% -20%, rgba(247, 183, 49, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(247, 183, 49, 0.03) 0%, transparent 40%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.app-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1.2s ease;
    position: relative;
    padding: 0;
}

.app-container.loaded {
    opacity: 1;
}

/* Eliminate Top Margin - Centered Viewport */
.magazine-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 2vh;
    /* Minimal padding */
}

.magazine-center {
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: var(--transition-premium);
}

.magazine {
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8), 0 30px 60px -30px rgba(0, 0, 0, 0.5);
}

.page {
    background-color: #ffffff;
}

.page canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Smart Controls - Vanguard Floating Dock */
.controls-container {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.6s ease;
}

.controls-container.hidden {
    transform: translateX(-50%) translateY(120%);
    opacity: 0;
}

.controls-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-premium);
}

.ctrl-btn:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.03);
    transform: scale(1.1);
}

.ctrl-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ctrl-divider {
    width: 1px;
    height: 24px;
    background: var(--glass-border);
}

.page-indicator {
    padding: 0 10px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 90px;
    text-align: center;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

#current-page {
    color: #fff;
    font-size: 0.9rem;
}

/* Side Peek Indicators (Next/Prev) */
.side-peek {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.side-peek:hover {
    opacity: 1;
}

.side-peek.right {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);
}

.peek-icon {
    color: var(--accent-color);
    opacity: 0.5;
}

/* MOBILE */
@media (max-width: 768px) {
    .controls-container {
        bottom: 20px;
        width: 90%;
    }

    .controls-glass {
        padding: 8px 16px;
        gap: 10px;
        width: 100%;
        justify-content: space-between;
    }

    .ctrl-divider {
        display: none;
    }
}

/* Loading Overlay - Minimalist */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.loader-vanguard {
    width: 80px;
    height: 2px;
    background: rgba(247, 183, 49, 0.1);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.loader-vanguard::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    animation: slide 1.5s ease-in-out infinite;
}

@keyframes slide {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

#loading-status {
    font-size: 0.65rem;
    letter-spacing: 5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}