/* ========================================
   FLIPBOOK VIEWER STYLES - Carte cu Turn.js
   ======================================== */

/* Flipbook Container - Full Screen */
.flipbook-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1a0f0a 0%, #2d1810 50%, #1a0f0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flipbook-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Turn.js Flipbook */
#flipbook {
    position: relative;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Page Styles */
.turn-page {
    width: 595px !important;
    height: 842px !important;
    background-color: white;
    background-size: cover;
    background-position: center;
    box-shadow: none;
    overflow: hidden;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .flipbook-container {
        padding: 0;
    }
    
    .flipbook-wrapper {
        padding: 0;
        width: 100vw;
        height: calc(100vh - 80px); /* Task 6: More space for content */
        margin-top: 50px; /* Space for close button and counter */
    }
    
    #flipbook {
        width: 100vw !important;
        height: calc(100vh - 80px) !important;
        max-width: 100vw !important;
        max-height: calc(100vh - 80px) !important;
    }
    
    .turn-page {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .page-content {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* PDF Canvas full screen on mobile */
    .pdf-canvas {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }
    
    /* Task 6: Page counter - top right */
    .page-counter {
        top: 10px !important;
        right: 10px !important;
        transform: none !important;
        font-size: 12px !important;
        padding: 8px 12px !important;
        background: rgba(255, 215, 0, 0.98) !important;
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Download button on mobile - same top position as desktop */
    .download-pdf-btn {
        top: 10px !important;
        left: 65px !important;
        right: auto !important;
        font-size: 11px !important;
        padding: 8px 12px !important;
        white-space: nowrap;
    }
    
    .download-pdf-btn i {
        font-size: 12px !important;
    }
    
    /* Close button - top left */
    .flipbook-close {
        top: 10px !important;
        left: 10px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
        background: rgba(255, 215, 0, 0.98) !important;
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Task 6: Controls - higher up, more visible */
    .flipbook-controls {
        position: fixed !important;
        bottom: 15px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        gap: 15px !important;
        padding: 0 !important;
        z-index: 1000 !important;
    }
    
    .flipbook-controls button {
        padding: 10px 10px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        background: rgba(255, 215, 0, 0.85) !important;
        color: #333 !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 10px !important;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
        transition: all 0.3s ease !important;
        min-width: 120px !important;
    }
    
    .flipbook-controls button:hover:not(:disabled) {
        background: rgba(255, 165, 0, 0.98) !important;
        color: white !important;
        transform: translateY(-3px) !important;
        box-shadow: 0 6px 25px rgba(255, 165, 0, 0.6) !important;
    }
    
    .flipbook-controls button:disabled {
        opacity: 0.4 !important;
        background: rgba(150, 150, 150, 0.7) !important;
        border-color: rgba(100, 100, 100, 0.3) !important;
    }
    
    .flipbook-controls button i {
        font-size: 13px !important;
    }
    
    /* Cover pages mobile adjustments */
    .cover-page {
        padding: 20px 15px !important;
    }
    
    .cover-content {
        width: 100% !important;
    }
    
    .cover-main-title {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    
    .cover-subtitle {
        font-size: 15px !important;
    }
    
    .cover-year {
        font-size: 28px !important;
    }
    
    .cover-description {
        font-size: 12px !important;
        padding: 0 10px !important;
    }
    
    .ornament-line {
        width: 35px !important;
    }
    
    .ornament-icon {
        font-size: 16px !important;
    }
}

.flipbook-wrapper {
    position: relative;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Turn.js Flipbook */
#flipbook {
    position: relative;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Page Styles */
.turn-page {
    width: 595px !important;
    height: 842px !important;
    background-color: white;
    background-size: cover;
    background-position: center;
    box-shadow: none;
    overflow: hidden;
}

/* Cover Pages */
.turn-page.cover-page {
    background: 
        radial-gradient(circle at 30% 30%, rgba(139, 90, 43, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(101, 67, 33, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #3a2415 0%, #4a2f1c 25%, #5a3a24 50%, #4a2f1c 75%, #3a2415 100%);
    position: relative;
    overflow: hidden;
}

.turn-page.cover-page::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    pointer-events: none;
}

.turn-page.cover-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.02) 3px,
            rgba(0, 0, 0, 0.02) 6px
        );
    pointer-events: none;
}

.cover-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 80px 60px;
    box-sizing: border-box;
    z-index: 1;
}

.cover-ornament-top,
.cover-ornament-bottom {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.ornament-line {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.ornament-icon {
    font-size: 1.5rem;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.cover-main-title {
    font-size: 4.5rem;
    color: #FFD700;
    text-align: center;
    text-shadow: 
        0 0 30px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 215, 0, 0.4),
        5px 5px 15px rgba(0, 0, 0, 0.9);
    font-weight: bold;
    letter-spacing: 15px;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    margin: 40px 0 25px 0;
    line-height: 1.2;
}

.cover-divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700 20%, #FFD700 80%, transparent);
    margin: 20px 0;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.cover-subtitle {
    font-size: 2rem;
    color: #D4AF37;
    text-align: center;
    font-family: 'Georgia', serif;
    font-style: italic;
    letter-spacing: 6px;
    margin: 20px 0;
    text-shadow: 
        0 0 10px rgba(212, 175, 55, 0.5),
        3px 3px 10px rgba(0, 0, 0, 0.8);
}

.cover-year {
    font-size: 3rem;
    color: #FFD700;
    font-weight: bold;
    font-family: 'Georgia', serif;
    margin-top: 25px;
    letter-spacing: 8px;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        3px 3px 10px rgba(0, 0, 0, 0.8);
}

.cover-description {
    font-size: 1rem;
    color: #D4AF37;
    text-align: center;
    max-width: 400px;
    line-height: 1.6;
    margin-top: 20px;
    font-style: italic;
    opacity: 0.9;
}

/* Page Content */
.page-content {
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: white;
}

.page-content iframe {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: none;
    background: white;
}

.pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Navigation Controls */
.flipbook-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1000;
}

.flipbook-controls button {
    background: rgba(255, 215, 0, 0.95);
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    color: #333;
}

.flipbook-controls button:hover:not(:disabled) {
    background: #FFA500;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.5);
}

.flipbook-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(150, 150, 150, 0.5);
}

.flipbook-controls button i {
    margin: 0 5px;
}
   

.flipbook-controls button {
    background: linear-gradient(135deg, #D4AF37 0%, #FFD700 100%);
    border: none;
    padding: 12px 25px;
    font-size: 15px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    color: #333;
}

.flipbook-controls button:hover:not(:disabled) {
    background: #FFA500;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.5);
}

.flipbook-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(150, 150, 150, 0.5);
}

.flipbook-controls button i {
    margin: 0 5px;
}

/* Page Counter */
.page-counter {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 215, 0, 0.95);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    color: #333;
}

/* Download PDF Button */
.download-pdf-btn {
    position: absolute;
    top: 30px;
    right: 200px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #333;
    color: #FFD700;
    text-decoration: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #FFD700;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.download-pdf-btn:hover {
    background: #FFD700;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.download-pdf-btn i {
    font-size: 16px;
}

/* Close Button */
.flipbook-close {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 215, 0, 0.95);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 10001;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.flipbook-close:hover {
    background: #ff4444;
    color: white;
    transform: rotate(90deg);
}

/* Fullscreen Mode */
.flipbook-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(135deg, #1a0f0a 0%, #2d1810 50%, #1a0f0a 100%);
}

/* Shadow effect for turned pages */
.turn-page.odd {
    box-shadow: inset -7px 0 9px -7px rgba(0, 0, 0, 0.4);
}

.turn-page.even {
    box-shadow: inset 7px 0 9px -7px rgba(0, 0, 0, 0.4);
}

/* Responsive Design */
@media (max-width: 1600px) and (min-width: 992px) {
    #flipbook {
        width: 1400px !important;
        height: 700px !important;
    }
    
    .turn-page {
        width: 700px !important;
        height: 700px !important;
    }
    
    .cover-main-title {
        font-size: 3.5rem;
        letter-spacing: 12px;
    }
    
    .cover-subtitle {
        font-size: 1.6rem;
    }
}

/* TOATE REGULILE DE MAI JOS SUNT ȘTERSE - folosim media query de la linia 47 */

