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

body {
    /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    font-family: 'Monsal', 'Monsal Gothic', sans-serif;
    background: linear-gradient(135deg, #313131 0%, #202020 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 100%;
    height: 96vh;
    /* height: auto; */
    display: flex;
    flex-direction: column;
    padding: 20px;
}

h1 {
    text-align: center;
    color: white;
    margin: 10px 0;
    font-size: 1.0em;
    font-weight: 200;
    text-transform: uppercase;
    /* text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); */
}

.upload-section {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
}

.upload-btn {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #666666 0%, #3a3a3a 100%);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

#file-name {
    display: block;
    margin-top: 15px;
    color: #666;
    font-style: italic;
}

#viewer-container {
    background: rgb(35, 35, 35);
    /* background: rgb(255, 255, 255); */
    padding-block: 25px 40px;
    padding-inline: 30px;
    border-radius: 15px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
    border: 1px solid rgb(58, 58, 58);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.control-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #666666 0%, #3a3a3a 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-info {
    font-size: 1.0em;
    font-weight: 400;
    color: #8c8c8c;
    min-width: 120px;
    text-align: center;
}

#flipbook-container {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
    flex: 1;
    overflow: hidden;
    max-height: 100%;
    /* height: 50%; */
}

#flipbook {
    margin: 0 auto;
    transition: opacity 0.3s ease-in;
}

#flipbook .page {
    height: 100%;
    background: rgb(66, 66, 66);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

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

#flipbook .page.hard {
    background: #303030;
}
#flipbook .page.hard h2 {
    /* background: #303030; */
    display: none;
}

/* .turn-page {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
} */

#loading {
    text-align: center;
    /* background: rgb(50, 50, 50); */
    background: rgb(35, 35, 35);
    padding: 50px;
    border-radius: 15px;
    height: 90vh;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
    position: relative;
}

.spinner {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    top: 50%;
    border: 5px solid #1c1c1c;
    border-top: 5px solid #666666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading p {
    color: #333;
    font-size: 1.0em;
    font-weight: 400;
}

/* Turn.js styling */
.turn-page {
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Responsive design - sizes are now calculated dynamically in JavaScript */

/* Debug Bar */
#debug-bar {
    position: fixed;
    display: none;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #666;
    z-index: 1000;
}

.debug-btn {
    padding: 8px 15px;
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: monospace;
    transition: background 0.2s;
}

.debug-btn:hover {
    background: #555;
}
