/* Γενικό Background */
body {
    background-color: #1a3c1a !important;
    margin: 0;
    padding: 0;
    color: white;
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
}

header {
    width: 100%;
    text-align: center;
    /* Χρήση clamp για να μικραίνει ο τίτλος σε μικρότερα laptop */
    font-size: clamp(1.5rem, 5vw, 3rem); 
    padding: 2.5rem 0; /* 40px / 16 */
    font-weight: bold;
    letter-spacing: 0.313rem; /* 5px */
    text-transform: uppercase;
    background-color: #1a3c1a !important;
    display: block;
}

/* Grid Σύστημα (Responsive Columns) */
.container {
    margin: 0.625rem auto; /* 10px */
    /* Ξεκινάμε με 4 στήλες για μεγάλες οθόνες */
    columns: 4; 
    column-gap: 0.938rem; /* 15px */
    padding: 1.25rem;    /* 20px */
    max-width: 95vw;     /* Για να μην κολλάει στις άκρες της οθόνης */
}

.container .box { 
    width: 100%; 
    margin-bottom: 0.938rem; /* 15px */
    cursor: pointer; 
    display: inline-block; /* Απαραίτητο για να μην "σπάνε" οι εικόνες ανάμεσα σε στήλες */
}

.container .box img { 
    width: 100%; 
    border-radius: 0.938rem; /* 15px */
    transition: 0.3s; 
    display: block;
}

.container .box img:hover { 
    transform: scale(1.02); 
    filter: brightness(0.8); 
}

/* MODAL STYLES (Προσαρμογή για να είναι πάντα πάνω από όλα) */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999; /* Πολύ υψηλό z-index */
    left: 0; top: 0;
    width: 100%; 
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Μικρό εφέ θολώματος πίσω από τη φωτογραφία */
}

/* MEDIA QUERIES για τις Στήλες */

/* Για Tablet / Μικρά Laptop */
@media (max-width: 1024px) {
    .container {
        columns: 3; /* 3 στήλες αντί για 4 */
    }
}

/* Για Tablet Portrait */
@media (max-width: 768px) {
    .container {
        columns: 2; /* 2 στήλες */
    }
}

/* Για Κινητά */
@media (max-width: 480px) {
    .container {
        columns: 1; /* 1 στήλη για να φαίνονται καθαρά οι φωτογραφίες */
        padding: 0.625rem;
    }
    header {
        letter-spacing: 2px; /* Μειώνουμε το spacing για να χωράει ο τίτλος */
    }
}
/* Εξασφαλίζουμε ότι το modal δεν κληρονομεί το πράσινο background παντού */
.gallery-modal * { background-color: transparent; }

.modal-wrapper {
    display: flex;
    align-items: center;
    gap: 1.25rem; /* 20px */
    width: 95%;   /* Αυξάνουμε λίγο το πλάτος για laptop */
    max-width: 68.75rem; /* 1100px */
    height: auto;
    max-height: 90vh;
}

.insta-container {
    display: flex;
    background-color: black;
    width: 100%;
    height: 85vh; /* Λίγο περισσότερο ύψος */
    border-radius: 0.25rem; /* 4px */
    overflow: hidden;
    /* Σημαντικό για το responsive: */
    flex-direction: row; 
}

.insta-image {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    min-height: 0; /* Διορθώνει bugs σε flexbox */
}

.insta-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.insta-sidebar {
    flex: 1;
    background-color: white !important;
    color: black;
    display: flex;
    flex-direction: column;
    min-width: 18.75rem; /* 300px */
}

/* Sidebar Elements */
.insta-sidebar * { color: black; }

.user-info {
    padding: 0.938rem; /* 15px */
    display: flex;
    align-items: center;
    border-bottom: 0.063rem solid #efefef;
}

.user-avatar {
    width: 2.188rem; /* 35px */
    height: 2.188rem; 
    background: #1a3c1a !important;
    border-radius: 50%;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem; /* 12px */
    margin-right: 0.625rem; /* 10px */
}

.caption { 
    padding: 0.938rem; 
    flex-grow: 1; 
    overflow-y: auto; 
    font-size: 0.95rem;
    line-height: 1.4;
}

.category-tag { 
    color: #8e8e8e; 
    margin-top: 0.625rem; 
    font-size: 0.85rem; 
}

.insta-footer { 
    padding: 0.938rem; 
    border-top: 0.063rem solid #efefef; 
}

.icons { 
    font-size: 1.5rem; 
    margin-bottom: 0.625rem; 
}

/* --- RESPONSIVE MODAL (Η ΜΑΓΕΙΑ) --- */

@media (max-width: 850px) {
    .modal-wrapper {
        width: 90%;
        max-height: 95vh;
    }

    .insta-container {
        flex-direction: column; /* Εικόνα πάνω, Sidebar κάτω */
        height: auto;
        max-height: 85vh;
        overflow-y: auto; /* Επιτρέπει scroll αν το κείμενο είναι πολύ */
    }

    .insta-image {
        flex: none;
        width: 100%;
        height: 50vh; /* Η εικόνα πιάνει το μισό ύψος */
    }

    .insta-sidebar {
        flex: none;
        width: 100%;
        min-width: 0;
        min-height: 200px;
    }
    
    .caption {
        max-height: 150px; /* Περιορίζουμε το κείμενο για να μη βγαίνει εκτός */
    }
}
/* Βελάκια Πλοήγησης (Modal) */
.nav-arrow {
    background: rgba(255,255,255,0.1) !important;
    border: none;
    color: white;
    font-size: 1.875rem; /* 30px */
    cursor: pointer;
    padding: 0.938rem;   /* 15px */
    border-radius: 50%;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001; /* Πάνω από το modal */
}

.nav-arrow:hover { 
    background: rgba(255,255,255,0.3) !important; 
}

.close-gallery {
    position: absolute;
    top: 1.25rem;   /* 20px */
    right: 1.875rem; /* 30px */
    font-size: 2.5rem; /* 40px */
    color: white; 
    cursor: pointer;
    z-index: 10002;
    transition: 0.3s;
}

.close-gallery:hover {
    transform: scale(1.1);
}

/* Κουμπιά Πλοήγησης Σελίδας (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: 100;
    font-size: 0.9rem;
    white-space: nowrap; /* Να μην σπάει το κείμενο */
}

.back-btn { left: 1.25rem; }
.fwd-btn { right: 1.25rem; }

.mdl-btn {
    right: 50%;
    transform: translateX(50%); /* Απόλυτο κεντράρισμα */
}

.back-btn:hover, .fwd-btn:hover, .mdl-btn:hover {
    background: white;
    color: #1a3c1a;
}

/* --- ΣΥΝΟΛΙΚΟ RESPONSIVE ΓΙΑ ΤΟ STYLESHEET2 --- */

@media (max-width: 800px) {
    /* Διορθώσεις για τα βελάκια στο κινητό για να μην κρύβουν την εικόνα */
    .nav-arrow {
        font-size: 1.2rem;
        padding: 0.5rem;
    }

    /* Διορθώσεις για τα κάτω κουμπιά - Τα κάνουμε πιο μικρά για να μην συγκρούονται */
    .back-btn, .fwd-btn, .mdl-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        bottom: 0.625rem; /* 10px */
    }


    /* Το Responsive του Modal που στείλαμε πριν (ενοποιημένο) */
    .insta-container { 
        flex-direction: column; 
        height: auto; 
        max-height: 90vh; 
    }
    
    .insta-sidebar { 
        min-width: 100%; 
        flex: none; 
    }
    
    .insta-image { 
        flex: none; 
        height: 45vh; 
    }
}

/* Ειδική ρύθμιση για πολύ στενά κινητά */
@media (max-width: 400px) {
    .mdl-btn {
        display: none; /* Κρύβουμε το μεσαίο κουμπί αν δεν υπάρχει χώρος */
    }
}