:root {
    --bg-gradient: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #00d2ff;
    --primary-hover: #3a7bd5;
    --text-main: #ffffff;
    --text-muted: #a0aec0;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.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: 40px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

.upload-section h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: -webkit-linear-gradient(left, var(--primary), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upload-section p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.upload-box {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-box:hover,
.upload-box.dragover {
    border-color: var(--primary);
    background: rgba(0, 210, 255, 0.05);
}

.upload-box .icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.upload-box h3 {
    margin-bottom: 10px;
    font-weight: 400;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-hover));
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    color: white;
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 15px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 210, 255, 0.3);
}

/* Loading Section */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Book Section */
.book-section {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 20px;
}

.btn-back {
    position: absolute;
    top: 0px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
    z-index: 100;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.book-wrapper {
    width: 90%;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
}

/* Page Flip Styles */
.page {
    background-color: #fff;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.page.--left {
    border-right: 0;
    box-shadow: inset -7px 0 30px -7px rgba(0, 0, 0, 0.4);
}

.page.--right {
    border-left: 0;
    box-shadow: inset 7px 0 30px -7px rgba(0, 0, 0, 0.4);
}

.page-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
}

.page canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-nav {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-nav:hover {
    color: white;
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Credit Footer */
.credit {
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through if needed, except on links */
}

.credit a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 400;
    pointer-events: auto;
    transition: color 0.2s;
}

.credit a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}