/* Γενικές Ρυθμίσεις */
body {
    margin: 0;
    padding: 0;
    background-color: #1a3c1a;
    /* Αφαιρούμε το overflow: hidden για να μπορεί ο χρήστης να κάνει scroll αν χρειαστεί σε πολύ μικρές οθόνες */
    overflow-x: hidden; 
    display: flex;
    flex-direction: column; /* Για να στοιχίζονται σωστά τα κουμπιά και το περιοδικό */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Arial', sans-serif;
}

/* Ο "κουβάς" του περιοδικού */
.magazine-viewport {
    position: relative;
    /* Χρησιμοποιούμε vw για να μικραίνει το περιοδικό αναλογικά με το πλάτος της οθόνης */
    width: clamp(300px, 90vw, 1000px); 
    /* Διατηρούμε την αναλογία 1000:700 (1.42) */
    aspect-ratio: 10 / 7; 
    box-shadow: 0 1.25rem 3.125rem rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.1);
    transform: scale(0.9); /* Μπορείς να παίξεις με αυτό το νούμερο */
    transform-origin: center center;
}

#magazine {
    width: 1000px;
    height: 700px;
    /* Βελτίωση κίνησης */
    perspective: 2000px; /* Δίνει βάθος στην κίνηση */
    transform-style: preserve-3d;
}

#magazine .page {
    width: 500px;
    height: 700px;
    background-color: white;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    
    /* Εξασφαλίζει ομαλή κίνηση χωρίς τρεμόπαιγμα */
    backface-visibility: hidden; 
    -webkit-backface-visibility: hidden;
    
    /* Hardware Acceleration */
    transform: translateZ(0); 
    will-change: transform;
}

/* ΚΟΥΜΠΙΑ ΠΛΟΗΓΗΣΗΣ (Bottom Buttons) */
.back-btn, .fwd-btn, .mdl-btn {
    position: fixed;
    bottom: 1.25rem; /* 20px */
    color: white;
    text-decoration: none;
    font-weight: bold;
    background: rgba(0,0,0,0.5);
    padding: 0.625rem 1.25rem; /* 10px 20px */
    border-radius: 0.313rem; /* 5px */
    transition: 0.3s;
    z-index: 1000;
    font-size: 0.85rem;
    white-space: nowrap;
}

.back-btn { left: 1.25rem; }
.fwd-btn { right: 1.25rem; }

.mdl-btn {
    left: 50%;
    transform: translateX(-50%);
}

.back-btn:hover, .fwd-btn:hover, .mdl-btn:hover {
    background: white;
    color: #1a3c1a;
    transform: translateY(-3px); /* Μικρή ανασήκωση στο hover */
}

/* --- RESPONSIVE ΡΥΘΜΙΣΕΙΣ --- */

/* Για Tablets */
@media (max-width: 1024px) {
    .magazine-viewport {
        transform: scale(0.7);
    }
}

/* Για Κινητά */
@media (max-width: 768px) {
    /* Στα κινητά το flipbook συνήθως δυσκολεύει αν είναι δισέλιδο. 
       Αν το plugin σου το επιτρέπει, γύρισε το σε single-page mode. 
       Εδώ προσαρμόζουμε το container να μη χάνεται. */
    .magazine-viewport {
        width: 98vw;
        margin-top: -50px; /* Ανεβαίνει λίγο για να χωράνε τα κουμπιά */
    }

    .back-btn, .fwd-btn, .mdl-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        bottom: 0.625rem;
    }
}

/* Αν η οθόνη είναι πολύ μικρή (κάθετα), μικραίνουμε το περιοδικό για να μη "κρύβει" τα κουμπιά */
@media (max-height: 600px) {
    .magazine-viewport {
        transform: scale(0.4);
    }
}
/* Layout για το Project View */
.project-view {
    display: flex;
    flex-direction: row; /* Δίπλα-δίπλα σε desktop */
    width: 90%;
    max-width: 68.75rem; /* 1100px */
    height: 85vh;
    background: #fff; 
    border-radius: 0.25rem; /* 4px */
    overflow: hidden;
    box-shadow: 0 0.625rem 2.5rem rgba(0,0,0,0.5);
    margin: auto;
}

/* Αριστερή Πλευρά (Εικόνα) */
.project-image {
    flex: 1.4; 
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0; /* Fix για flexbox containers */
}

.project-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Δεξιά Πλευρά (Details) */
.project-details {
    flex: 1; 
    display: flex;
    flex-direction: column;
    background: white;
    color: #262626;
    border-left: 0.063rem solid #dbdbdb;
    min-width: 18.75rem; /* 300px */
}

/* Header & Content */
.details-header {
    padding: 0.938rem; /* 15px */
    border-bottom: 0.063rem solid #dbdbdb;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.user-avatar {
    width: 2rem; /* 32px */
    height: 2rem;
    background: #1a3c1a;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.details-content {
    flex: 1;
    padding: 0.938rem;
    overflow-y: auto; 
    font-size: 0.9rem;
    line-height: 1.5;
}

/* BOOK SHOWCASE SECTION */
.gd-body {
    background-color: #1a3c1a;
    color: white;
    font-family: 'Arial', sans-serif;
    margin: 0;
    min-height: 100vh;
}

.book-showcase {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3.125rem 1.25rem; /* 50px top/bottom, 20px sides */
}

.book-grid {
    display: flex;
    flex-wrap: wrap; /* Επιτρέπει στα βιβλία να αλλάζουν σειρά */
    justify-content: center;
    gap: clamp(1.25rem, 5vw, 3.125rem); /* 20px έως 50px */
    margin-top: 2.5rem;
    width: 100%;
}

.book-item {
    cursor: pointer;
    text-align: center;
}
/* BOOK ITEM STYLING */
.book-item img {
    /* Χρήση clamp για να μικραίνει το βιβλίο αναλογικά */
    width: clamp(200px, 80vw, 300px); 
    height: auto;
    box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.5); /* 10px 30px */
    border-radius: 0.125rem 0.625rem 0.625rem 0.125rem;
}

.book-label {
    margin-top: 0.938rem; /* 15px */
    font-weight: bold;
    letter-spacing: 0.063rem; /* 1px */
    font-size: 1rem;
}

/* ZOOM MODAL (Μαύρο φόντο) */
.modal {
    display: none; 
    position: fixed;
    z-index: 9000; /* Πάνω από όλα τα άλλα στοιχεία */
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.98); /* Σχεδόν απόλυτο μαύρο */
    justify-content: center;
    align-items: center;
    overflow: hidden;
    touch-action: none; /* Βοηθάει στο zoom σε κινητά */
}

.modal-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
}

/* ZOOMABLE IMAGE */
.zoomable {
    transition: transform 0.3s ease;
    cursor: zoom-in;
    max-width: 90%;
    max-height: 90%;
    position: relative; 
    left: 0;
    top: 0;
    object-fit: contain;
}

.zoomable.zoomed {
    /* Στα desktop το scale 2.5 είναι ωραίο */
    transform: scale(2.5);
    cursor: grab;
    position: absolute !important; 
    max-width: none;
    max-height: none;
}

.zoomable.zoomed:active {
    cursor: grabbing;
}

.close-modal {
    position: absolute;
    top: 1.25rem;   /* 20px */
    right: 1.875rem; /* 30px */
    font-size: 2.5rem; /* 40px */
    color: white;
    cursor: pointer;
    z-index: 10000;
    transition: 0.3s;
}

/* --- RESPONSIVE ΔΙΟΡΘΩΣΕΙΣ --- */

@media (max-width: 768px) {
    .zoomable.zoomed {
        /* Στα κινητά το 2.5 είναι πολύ, το 1.8 είναι πιο διαχειρίσιμο */
        transform: scale(1.8);
    }
    
    .close-modal {
        top: 0.625rem;
        right: 1.25rem;
        font-size: 2rem;
    }

    .book-label {
        font-size: 0.9rem;
    }
}

/* Για πολύ μικρές οθόνες ή landscape σε κινητά */
@media (max-height: 500px) {
    .book-item img {
        width: 150px;
    }
    .modal-content {
        align-items: flex-start; /* Δίνει χώρο για scroll αν χρειαστεί */
    }
}