/* File: frontend/html/css/layout.css */
/* Layout, navigation e struttura delle pagine */

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-container h1 {
    margin-bottom: 2rem;
    color: #2c3e50;
    font-weight: 300;
}

#loginForm {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

/* Stile per il messaggio di errore del login */
#loginError {
    display: none; /* Nascosto di default */
    color: #e74c3c;
    background-color: #fdd;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 0.75rem;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

#loginError.show {
    display: block; /* Mostra quando ha la classe 'show' */
}


/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid #e1e8ed;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-brand h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 300;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #5a6c7d;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

/* Active page styling */
.nav-menu a.active {
    background-color: #3498db;
    color: white;
    font-weight: 500;
}

.nav-menu a.active:hover {
    background-color: #2980b9;
    color: white;
}

#logoutBtn {
    color: #e74c3c !important;
}

#logoutBtn:hover {
    background-color: #fdf2f2 !important;
    color: #c0392b !important;
}

/* Pagination - AGGIORNATO per nuovo layout */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
    gap: 1rem;
}

.pagination-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.pagination-btn:disabled {
    opacity: 0.5;
}

#pageNumbers,
#pageNumbersList {
    display: flex;
    gap: 0.25rem;
    margin: 0 1rem;
}

.page-number {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.page-number:hover {
    background: #e9ecef;
}

.page-number.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Pagination controls - AGGIORNATO per nuovo posizionamento */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pagination-controls label {
    font-size: 0.9rem;
    color: #666;
}

.pagination-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Responsive per pagination */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin-top: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }
    
    .pagination-left {
        align-items: center;
        width: 100%;
    }

    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }

    /* Hide sort arrows on mobile */
    .sort-arrows {
        display: none;
    }
}

@media (max-width: 480px) {
    .pagination-buttons {
        flex-direction: column;
    }

    #pageNumbers,
    #pageNumbersList {
        margin: 1rem 0;
    }
}

#loginForm .form-group {
    margin-bottom: 1.5rem;
}

#loginForm button[type="submit"] {
    margin-top: 1rem;
    width: 100%; /* Opzionale: rende il pulsante a larghezza piena */
}
