.katalog-page {
    --brand-gold: #f5a300;
    --brand-dark: #111827;
    --brand-slate: #1f2937;
    --white: #ffffff;
    --text-muted: #9ca3af;
    --nav-bg: rgba(17, 24, 39, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-premium: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.katalog-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body.katalog-page {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle, #2d3748 0%, #111827 100%);
    color: var(--white);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.katalog-page header {
    height: 60px;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    position: relative;
}

 .header-left {
     display: flex;
     align-items: center;
     gap: 15px;
 }

 .back-btn {
     background: rgba(255, 255, 255, 0.05);
     border: 1px solid var(--border-color);
     color: var(--white);
     padding: 8px 16px;
     border-radius: 30px;
     cursor: pointer;
     font-size: 14px;
     font-weight: 500;
     text-decoration: none;
     display: inline-flex;
     align-items: center;
     gap: 8px;
     transition: all 0.2s ease;
 }

 .back-btn:hover {
     background: #FFDD01;
     border-color: #FFDD01;
     color: var(--brand-dark);
     transform: translateX(-3px);

 }

 .doc-title {
     font-size: 16px;
     font-weight: 600;
     letter-spacing: 0.5px;
     max-width: 300px;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
 }

 .header-right {
     display: flex;
     align-items: center;
     gap: 10px;
 }

 .logo-img {
     height: 50px;
     object-fit: contain;
 }

 /* Workspace & Loader */
 .workspace {
     flex: 1;
     display: flex;
     justify-content: center;
     align-items: center;
     position: relative;
     overflow: hidden;
     padding: 20px;
     perspective: 1500px;
 }

 #loader {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(17, 24, 39, 0.95);
     display: flex;
     flex-direction: column;
     justify-content: center;
     align-items: center;
     z-index: 50;
     gap: 20px;
     transition: opacity 0.5s ease;
 }

 .spinner {
     width: 60px;
     height: 60px;
     border: 4px solid rgba(255, 255, 255, 0.05);
     border-top-color: #FFDD01;
     border-radius: 50%;
     animation: spin 1s linear infinite;
     filter: drop-shadow(0 0 10px rgba(245, 163, 0, 0.4));
 }

 @keyframes spin {
     to {
         transform: rotate(360deg);
     }
 }

 .loader-text {
     font-size: 16px;
     font-weight: 500;
     letter-spacing: 1px;
     color: #FFDD01;
     animation: pulse 1.5s ease-in-out infinite alternate;
 }

 @keyframes pulse {
     from {
         opacity: 0.6;
     }

     to {
         opacity: 1;
     }
 }

 /* Flipbook styling */
 .flipbook-container {
     display: none;
     /* Shown after load */
     width: 90vw;
     height: calc(100vh - 160px);
     max-width: 1150px;
     max-height: 75vh;
     margin: auto;
     transform-origin: center center;
     overflow: visible;
     /* Prevents clipping 3D rotation of cover pages */
     perspective: 1500px;
     transform-style: preserve-3d;
 }

 .page-wrapper {
     background-color: #ffffff;
     /* Inset shadow for depth, outset shadow for paper stack effect, and rounded corners */
     box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.15), 0 10px 30px rgba(0, 0, 0, 0.25);
     display: flex;
     justify-content: center;
     align-items: center;
     width: 100%;
     height: 100%;
     border-radius: 6px;
     overflow: hidden;
     /* Clips the inner canvas to the border radius */
 }

 .page-wrapper.blank-page {
     background: transparent !important;
     box-shadow: none !important;
     border: none !important;
 }

 .page-canvas {
     width: 100% !important;
     height: 100% !important;
     object-fit: contain;
     display: block;
 }

 /* Floating Nav Buttons */
 .float-nav {
     position: absolute;
     top: 50%;
     transform: translateY(-50%);
     background: rgba(17, 24, 39, 0.45);
     backdrop-filter: blur(8px);
     -webkit-backdrop-filter: blur(8px);
     border: 1px solid var(--border-color);
     color: var(--white);
     width: 54px;
     height: 54px;
     border-radius: 50%;
     display: flex;
     justify-content: center;
     align-items: center;
     cursor: pointer;
     z-index: 80;
     font-size: 20px;
     transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
 }

 .float-nav:hover {
     background: rgba(17, 24, 39, 0.75);
     color: #FFDD01;
     border-color: #FFDD01;
 }

 .float-nav-left {
     left: 30px;
 }

 .float-nav-right {
     right: 30px;
 }

 .float-nav-left:hover {
     transform: translateY(-50%) translateX(-4px);
 }

 .float-nav-right:hover {
     transform: translateY(-50%) translateX(4px);
 }

 /* Glassmorphic Bottom Control Bar */
 footer {
     height: 65px;
     background-color: var(--nav-bg);
     backdrop-filter: blur(12px);
     -webkit-backdrop-filter: blur(12px);
     border-top: 1px solid var(--border-color);
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 0 30px;
     z-index: 100;
     position: relative;
 }

 .controls-left,
 .controls-right {
     display: flex;
     align-items: center;
     gap: 8px;
     width: 25%;
 }

 .controls-right {
     justify-content: flex-end;
 }

 .controls-center {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 15px;
     width: 50%;
 }

 .ctrl-btn {
     background: rgba(255, 255, 255, 0.05);
     border: 1px solid var(--border-color);
     color: var(--white);
     width: 40px;
     height: 40px;
     border-radius: 50%;
     display: flex;
     justify-content: center;
     align-items: center;
     cursor: pointer;
     font-size: 15px;
     transition: all 0.2s ease;
     text-decoration: none;
 }

 .ctrl-btn:hover {
     background: rgba(255, 255, 255, 0.15);
     border-color: rgba(255, 255, 255, 0.25);
     transform: translateY(-2px);
 }

 .ctrl-btn.btn-accent {
     background: rgba(245, 163, 0, 0.1);
     border-color: rgba(245, 163, 0, 0.25);
     color: #FFDD01;
 }

 .ctrl-btn.btn-accent:hover {
     background: #FFDD01;
     color: var(--brand-dark);
     box-shadow: 0 4px 12px rgba(245, 163, 0, 0.3);
 }

 .page-control-container {
     display: flex;
     align-items: center;
     gap: 12px;
     background: rgba(255, 255, 255, 0.03);
     border: 1px solid var(--border-color);
     padding: 6px 16px;
     border-radius: 30px;
 }

 #page-indicator {
     font-size: 14px;
     font-weight: 500;
     min-width: 65px;
     text-align: center;
     letter-spacing: 0.5px;
 }

 /* Slider Styles */
 .slider-wrapper {
     display: flex;
     align-items: center;
     width: 150px;
 }

 #page-slider {
     -webkit-appearance: none;
     width: 100%;
     height: 4px;
     border-radius: 2px;
     background: rgba(255, 255, 255, 0.15);
     outline: none;
     cursor: pointer;
 }

 #page-slider::-webkit-slider-thumb {
     -webkit-appearance: none;
     appearance: none;
     width: 14px;
     height: 14px;
     border-radius: 50%;
     background: #FFDD01;
     cursor: pointer;
     box-shadow: 0 0 6px rgba(245, 163, 0, 0.5);
     transition: transform 0.1s ease;
 }

 #page-slider::-webkit-slider-thumb:hover {
     transform: scale(1.3);
 }

 #page-slider::-moz-range-thumb {
     width: 14px;
     height: 14px;
     border-radius: 50%;
     background: #FFDD01;
     cursor: pointer;
     border: none;
     box-shadow: 0 0 6px rgba(245, 163, 0, 0.5);
     transition: transform 0.1s ease;
 }

 #page-slider::-moz-range-thumb:hover {
     transform: scale(1.3);
 }

 /* Responsive Mobile Layout Adjustments */
 @media (max-width: 768px) {
     .float-nav {
         display: none !important;
         /* Hide floating navigation on mobile to save space */
     }

     .doc-title {
         display: none;
         /* Hide document title on small screens */
     }

     footer {
         padding: 0 15px;
         height: 70px;
         flex-wrap: wrap;
         justify-content: center;
         gap: 5px;
     }

     .controls-left,
     .controls-right {
         width: auto;
         flex-grow: 1;
     }

     .controls-center {
         width: 100%;
         order: -1;
         margin-bottom: 5px;
     }

     .slider-wrapper {
         width: 100px;
     }

     .workspace {
         padding: 10px;
     }
 }