/* =========================================
   1. ΓΕΝΙΚΕΣ ΡΥΘΜΙΣΕΙΣ & ΒΑΣΙΚΟΙ ΚΑΝΟΝΕΣ
   ========================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
}

/* Καθολικός κανόνας για όλες τις εικόνες */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Η κλάση για την εικόνα στη σελίδα Energy */
.card-img-small {
    width: 100%;         /* Γεμίζει το πλάτος του container */
    max-width: 600px;    /* Δεν ξεπερνά τα 600px σε desktop */
    height: auto;        /* Διατηρεί αναλογίες */
    display: block;
    margin: 20px auto;   /* Κεντράρισμα */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* =========================================
   2. HEADER & NAVBAR
   ========================================= */
header {
    background: linear-gradient(135deg, #1a5f7a, #08aeea);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navbar {
    background: #1a5f7a;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.nav-menu a:hover, .nav-menu a.active {
    color: #57e2e5;
}

/* =========================================
   3. ΔΟΜΗ ΠΕΡΙΕΧΟΜΕΝΟΥ & GRIDS
   ========================================= */
main {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

.content-page {
    background: white;
    margin: 30px auto;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.text-section h1, .text-section h2 {
    color: #1a5f7a;
    border-bottom: 2px solid #08aeea;
    padding-bottom: 10px;
}

/* Grid Εικονιδίων Αρχικής */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.icon-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-decoration: none;
    color: #1a5f7a;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.icon-item:hover {
    transform: translateY(-10px);
    background-color: #1a5f7a;
    color: white;
}

/* Hardware & Sensors */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.sensor-card {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: 0.3s;
}

/* Network & IoT */
.network-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* =========================================
   4. MODALS, ΚΑΡΤΕΣ & ΛΙΣΤΕΣ
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
}

.modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 2001;
    width: 80%;
    max-width: 500px;
    text-align: center;
}

.icon-list {
    list-style: none;
    padding-left: 0;
}

.icon-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

/* =========================================
   5. 3D CAROUSEL (DESKTOP DEFAULT)
   ========================================= */
.carousel-container { 
    width: 100%; height: 250px; position: relative; 
    perspective: 1000px; display: flex; justify-content: center; 
}
.carousel-3d { 
    width: 200px; height: 150px; position: absolute; 
    transform-style: preserve-3d; animation: rotateCarousel 20s infinite linear; 
}
.carousel-item { 
    position: absolute; width: 200px; height: 150px; 
    border: 3px solid #fff; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.carousel-item:nth-child(1) { transform: rotateY(0deg) translateZ(300px); }
.carousel-item:nth-child(2) { transform: rotateY(72deg) translateZ(300px); }
.carousel-item:nth-child(3) { transform: rotateY(144deg) translateZ(300px); }
.carousel-item:nth-child(4) { transform: rotateY(216deg) translateZ(300px); }
.carousel-item:nth-child(5) { transform: rotateY(288deg) translateZ(300px); }

@keyframes rotateCarousel { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

/* =========================================
   6. RESPONSIVE SETTINGS (Media Queries)
   ========================================= */
@media (max-width: 768px) {
    main, .nav-container, .content-page {
        max-width: 100%;
        margin: 10px;
        padding: 15px;
    }

    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    /* Grids σε 1 στήλη */
    .icon-grid, .goals-container, .sensor-grid, .network-grid {
        grid-template-columns: 1fr !important;
    }

    /* Προσαρμογή 3D Carousel για κινητά */
    .carousel-item {
        width: 150px;
        height: 110px;
    }

    .carousel-item:nth-child(1) { transform: rotateY(0deg) translateZ(180px); }
    .carousel-item:nth-child(2) { transform: rotateY(72deg) translateZ(180px); }
    .carousel-item:nth-child(3) { transform: rotateY(144deg) translateZ(180px); }
    .carousel-item:nth-child(4) { transform: rotateY(216deg) translateZ(180px); }
    .carousel-item:nth-child(5) { transform: rotateY(288deg) translateZ(180px); }
}

footer {
    text-align: center;
    padding: 20px;
    background: #333;
    color: white;
    margin-top: 50px;
}

/* --- Εφέ Hover για το Μενού --- */

/* 1. Βασικό στυλ των συνδέσμων */
.nav-menu li a {
    position: relative;
    text-decoration: none;
    color: #ffffff; /* Το χρώμα των γραμμάτων */
    padding: 8px 15px;
    font-weight: 500;
    transition: all 0.3s ease; /* Ομαλή μετάβαση για όλα */
}

/* 2. Η γραμμή που θα εμφανίζεται (Underline) */
.nav-menu li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px; /* Πάχος γραμμής */
    display: block;
    bottom: -5px; /* Απόσταση κάτω από το κείμενο */
    left: 50%; /* Ξεκινάει από το κέντρο */
    background: #08aeea; /* Το κυανό χρώμα σου */
    transition: all 0.3s ease;
    transform: translateX(-50%); /* Τέλεια στοίχιση στο κέντρο */
}

/* 3. Τι συμβαίνει στο Hover (όταν πας το ποντίκι) */
.nav-menu li a:hover {
    color: #08aeea; /* Αλλάζει το γράμμα σε κυανό */
    transform: translateY(-2px); /* Μικρή ανύψωση για "βάθος" */
}

.nav-menu li a:hover::after {
    width: 80%; /* Η γραμμή απλώνει στο 80% του κειμένου */
}

/* 4. Στυλ για την ενεργή σελίδα (Active) */
.nav-menu li a.active {
    color: #08aeea;
}

.nav-menu li a.active::after {
    width: 80%;
    background: #ffffff; /* Η ενεργή σελίδα έχει λευκή γραμμή */
}
/* Για να μένει η γραμμή ανοιχτή στη σελίδα που βρισκόμαστε */
.nav-menu li a.active::after {
    width: 80%;
    background: #ffffff; /* Λευκή γραμμή για την ενεργή σελίδα */
}