:root {
    --bg-color: #1a1a1a;
    --control-bg: rgba(40, 40, 40, 0.9);
    --accent: #d4af37; /* Gold accent to match PDF theme */
}

body, html {
    margin: 0; padding: 0;
    height: 100%; width: 100%;
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    align-items: center;
    justify-content: center;
}

.flipbook-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* Page Design */
.page {
    background-color: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    overflow: hidden;
}

.page-content {
    width: 100%;
    height: 100%;
    display: flex;
}

canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Control Bar */
.controls-bar {
    background: var(--control-bg);
    padding: 10px 25px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    align-items: center;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 100;
}

button {
    background: transparent;
    border: 1px solid #555;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: black;
}

#loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid #333;
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .controls-bar { font-size: 12px; gap: 8px; padding: 10px; }
    button { padding: 5px 10px; }
}