/* ========================================
   RESET
======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    color: #222;
    line-height: 1.4;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #006600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================
   HEADER
======================================== */

#topHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;

    background: #004d00;
    color: #fff;

    padding: 10px 20px;
}

.top-left,
.top-center,
.top-right {
    padding: 5px;
}

.top-left .icon {
    width: 70px;
}

.top-center {
    text-align: center;
}

.top-center .logo {
    width: 100%;
    max-width: 350px;
}

.top-right {
    text-align: right;
}

.counter-title {
    font-weight: bold;
}

.counter-value {
    margin: 5px 0;
}

.timestamp {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ========================================
   STATISTICHE
======================================== */

#statsBar {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;

    background: #006600;
    color: white;

    padding: 10px;
}

.stat-box {
    text-align: center;
    padding: 5px 10px;
}

.stat-value {
    display: block;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
}

/* ========================================
   LAYOUT
======================================== */

#layout-container {
    display: flex;
    align-items: flex-start;
    min-height: 70vh;
}

#sidebar {
    width: 240px;
    flex-shrink: 0;
}

#mainContent {
    flex: 1;
    padding: 20px;
}

/* ========================================
   MENU
======================================== */

#menusx {
    width: 100%;
}

.hamburger {
    display: none;
}

#sidebarMenu {
    background: #004d00;
    color: white;
    padding: 10px;
}

.menu-section {
    margin-bottom: 15px;
}

.menu-section h3 {
    background: #006600;
    padding: 8px;
    color: white;
    margin-bottom: 5px;
}

.menu-section a {
    display: block;
    color: white;
    padding: 6px 10px;
}

.menu-section a:hover {
    background: #008000;
    text-decoration: none;
}

/* ========================================
   LOGIN
======================================== */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.inputField {
    width: 100%;
    padding: 8px;
    border: none;
}

.btnSubmit {
    background: #008000;
    color: white;
    border: none;
    padding: 8px;
    cursor: pointer;
}

/* ========================================
   HOME
======================================== */

.home-intro {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.welcome-card,
.news-card {
    flex: 1;
    min-width: 280px;

    background: white;
    border-radius: 8px;
    padding: 20px;

    box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

.welcome-card h1,
.news-card h2 {
    margin-bottom: 15px;
}

.welcome-card p {
    margin-bottom: 15px;
}

.campo-img {
    display: block;
    width: 220px;
    max-width: 100%;
    margin: 15px auto;
}

/* ========================================
   NEWS
======================================== */

.news-list {
    max-height: 400px;
    overflow-y: auto;
}

.news-item {
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
}

/* ========================================
   INFO BOX
======================================== */

.home-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;

    margin-top: 20px;
}

.info-box {
    flex: 1;

    min-width: 250px;

    background: white;
    padding: 15px;

    border-radius: 8px;
    text-align: center;

    box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

.info-box h3 {
    margin-bottom: 10px;
}

/* ========================================
   BUTTON
======================================== */

.btn-primary {
    display: inline-block;

    background: #006600;
    color: white;

    padding: 10px 15px;

    border-radius: 5px;
}

.btn-primary:hover {
    background: #008000;
    text-decoration: none;
}

/* ========================================
   TABELLE
======================================== */

.table-responsive {
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.modern-table th {
    background: #006600;
    color: white;
    padding: 10px;
    text-align: left;
}

.modern-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.modern-table tr:nth-child(even) {
    background: #f7f7f7;
}

/* ========================================
   PAGINAZIONE
======================================== */

.pagination {
    text-align: center;
    margin-top: 20px;
}

.page-btn {
    display: inline-block;

    background: #006600;
    color: white;

    padding: 8px 12px;

    margin: 3px;

    border-radius: 4px;
}

.page-info {
    margin: 0 10px;
}

/* ========================================
   ADS
======================================== */

.ads-section {
    text-align: center;
    margin-top: 25px;
}

/* ========================================
   FOOTER
======================================== */

#bottomFooter {
    background: #004d00;
    color: white;

    text-align: center;

    padding: 20px;
    margin-top: 30px;
}

.footer-image img {
    max-width: 100%;
}

.footer-text {
    line-height: 1.6;
    margin: 15px 0;
}

.footer-links a {
    color: #aaffaa;
}

/* ========================================
   MOBILE
======================================== */

@media screen and (max-width:768px) {

    #topHeader {
        flex-direction: column;
        text-align: center;
    }

    .top-left,
    .top-center,
    .top-right {
        width: 100%;
        text-align: center;
    }

    .top-center .logo {
        max-width: 300px;
    }

    #statsBar {
        flex-direction: column;
    }

    .stat-box {
        margin: 5px 0;
    }

    #layout-container {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
    }

    #mainContent {
        width: 100%;
        padding: 10px;
    }

    .hamburger {
        display: block;

        width: 100%;
        padding: 12px;

        background: #006600;
        color: white;

        border: none;
        cursor: pointer;

        font-size: 18px;
        font-weight: bold;
    }

    #sidebarMenu {
        display: none;
        width: 100%;
    }

    #sidebarMenu.open {
        display: block;
    }

    .home-intro {
        flex-direction: column;
    }

    .welcome-card,
    .news-card {
        min-width: unset;
        width: 100%;
    }

    .home-links {
        flex-direction: column;
    }

    .info-box {
        min-width: unset;
        width: 100%;
    }

    .campo-img {
        width: 180px;
    }

    .modern-table th,
    .modern-table td {
        padding: 8px;
    }
}