/* style_users.css */
@import url('https://fonts.googleapis.com/css2?family=Righteous&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #333;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 20px;
    flex-grow: 1;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    /* max-height: 20px; */
}

.logo {
    width: 100%;
    max-width: 200px;
    height: auto;
}

h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
    text-align: center;
    /* flex-grow: 1; */
}

h2 {
    font-size: 1.5rem;
    color: #34495e;
    margin-bottom: 20px;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    padding: 4px;
}

.logout-btn {
    padding: 8px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e74c3c; /* Rosso per il logout */
}

.logout-btn:hover {
    background: #c0392b;
}

.reload-btn {
    padding: 8px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2ecc71;
}

.reload-btn:hover {
    background: #27ae60;
}

.user-info {
    background: #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #34495e;
    flex: 1;
}

.value {
    color: #2c3e50;
    flex: 2;
    text-align: right;
}

/* Stili input copiati da manager/style.css */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #34495e;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.form-group-inline label {
    margin-bottom: 0; /* Rimuove il margine inferiore per allineamento */
    white-space: nowrap; /* Evita che il testo vada a capo */
}

.form-group-inline input[type="color"] {
    width: 50px; /* Dimensione fissa per il color picker */
    height: 30px;
    padding: 0; /* Rimuove padding interno per il color picker */
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

label {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
    outline: none;
}

.error-input {
    background-color: #ffe6e6;
    border-color: #e74c3c;
}

/* Stili per il calendario */
.calendar {
    background: #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: #34495e;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-body span {
    padding: 10px;
    border-radius: 5px;
    background: #fff;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-body .empty {
    background: transparent;
}

.calendar-body .booked {
    background: #e74c3c;
    color: #fff;
}

.calendar-body .today {
    border: 2px solid #3498db;
}

/* Stili per l'overlay di aggiornamento */
.update-overlay {
    display: none; /* Nascosto di default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Sfondo grigio semitrasparente */
    z-index: 9999; /* Alto z-index */
    justify-content: center;
    align-items: center;
}

.update-message {
    background: #fff;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: #34495e;
    font-weight: 600;
}

.update-message i {
    font-size: 1.5rem;
    color: #2ecc71; 
}

.calendar-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.calendar-btn {
    padding: 8px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
}

.calendar-btn:hover {
    background: #2980b9;
}

.calendar-body .info {
    grid-column: 1 / -1;
    text-align: center;
    color: #34495e;
    padding: 10px;
}

.settings-btn {
    padding: 8px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1c40f; /* Giallo per distinguere */
}

.settings-btn:hover {
    background: #e67e22;
}

.message {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.message.success {
    background: #2ecc71;
    color: #fff;
}

.message.error {
    background: #e74c3c;
    color: #fff;
}

.case-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.case-table th,
.case-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.case-table th {
    background: #34495e;
    color: #fff;
}

.case-table tr:nth-child(even) {
    background: #f9f9f9;
}

.case-table tr:hover {
    background: #f1f1f1;
}

.case-table th:nth-child(3),
.case-table td:nth-child(3) {
    text-align: center;
}

.case-table th:nth-child(4),
.case-table td:nth-child(4) {
    text-align: center;
    width: 141px;
}

.case-table td:nth-child(4) {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.edit-btn, .delete-btn {
    padding: 5px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: #fff;
    vertical-align: middle;
}

.edit-btn {
    background: #f1c40f;
}

.edit-btn:hover {
    background: #e67e22;
}

.delete-btn {
    background: #e74c3c;
}

.delete-btn:hover {
    background: #c0392b;
}

/* modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.modal-content h3 {
    margin-top: 0;
    color: #34495e;
}

#add-case-btn {
    padding: 8px;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
    background: #2ecc71; /* Verde per "aggiungi" */
}

#add-case-btn:hover {
    background: #27ae60;
}

/* Stili per il form inline */
.form-group-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group-inline label {
    margin-bottom: 0;
    white-space: nowrap;
    color: #34495e;
    font-weight: 600;
}

/* Stili per la select personalizzata */
.custom-select {
    appearance: none; /* Rimuove lo stile nativo */
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path fill="%2334495e" d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center; /* Freccia personalizzata */
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px 30px 10px 10px; /* Spazio per la freccia */
    font-size: 1rem;
    color: #34495e;
    width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.custom-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
    outline: none;
}

.custom-select:hover {
    border-color: #2980b9;
}

.custom-select:invalid {
    color: #999; /* Colore grigio per l'opzione placeholder */
}

/* Stili per la leggenda */
.legend {
    display: flex;
    align-items: center;
    margin: 10px 0; /* Ridotto il margine */
    padding: 5px; /* Ridotto il padding */
    background: #f9f9f9;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.legend h3 {
    font-size: 1rem; /* Ridotto il font-size */
    color: #34495e;
    margin-bottom: 0; /* Rimuove il margine inferiore */
    margin-right: 10px; /* Aggiunge spazio tra il titolo e la leggenda */
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* Ridotto il gap */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px; /* Ridotto il gap */
}

.legend-color {
    width: 15px; /* Ridotto la larghezza */
    height: 15px; /* Ridotto l'altezza */
    border-radius: 3px;
    border: 1px solid #ddd;
    display: inline-block;
}

.legend-name {
    font-size: 0.9rem; /* Ridotto il font-size */
    color: #2c3e50;
}

/* Stili per FullCalendar */
#calendar {
    margin: 4px auto;
}

.fc-event-title {
    font-weight: 600;
}

.fc-event-details {
    font-size: 0.85rem;
    opacity: 0.8;
}
/* Removed inline font import from here */

/* Sidebar Styles */
.app-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    z-index: 99999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.app-sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.sidebar-logo {
    max-width: 150px;
    height: auto;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #555;
    cursor: pointer;
    padding: 5px;
}

.sidebar-close-btn:hover {
    color: #e74c3c;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-link i {
    width: 25px;
    font-size: 1.1rem;
    margin-right: 15px;
    color: #7f8c8d;
    text-align: center;
}

.sidebar-link:hover {
    background: #f8f9fa;
    color: #3498db;
    border-left-color: #3498db;
}

.sidebar-link:hover i {
    color: #3498db;
}

.sidebar-link.active {
    background: #ebf5fb;
    color: #2980b9;
    border-left-color: #2980b9;
    font-weight: 600;
}

.sidebar-link.active i {
    color: #2980b9;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.sidebar-link.logout-link {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: #e74c3c;
}

.sidebar-link.logout-link i {
    color: #e74c3c;
}

.sidebar-link.logout-link:hover {
    background: #fdf2f0;
    border-left-color: #e74c3c;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    padding: 8px 12px;
    margin-right: 10px;
    border-radius: 5px;
    transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.app-wrapper .container > .header {
    display: flex;
    align-items: center;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    padding: 10px 20px;
    background: #34495e;
    color: #fff;
    border-bottom: 2px solid #2b3e50;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.app-wrapper > .header {
    position: sticky;
    top: 0;
    z-index: 1000;
    color: #fff;
    border-bottom: 2px solid #2b3e50;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
}

.header .logo {
    height: 40px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.header-structure-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    /* gap: 10px; */
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.logo-link::after {
    content: "PrenotaBeB";
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.logo-link:hover {
    opacity: 0.8;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    text-align: left;
    margin-left: 10px;
    color: #fff;
}

.header-sep {
    color: #dbe6f0;
    font-weight: 400;
    margin: 0 4px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ── Bottoni salva rossi ── */
.btn.save-main-btn,
button.save-main-btn,
#fixedSaveBtn {
    background: linear-gradient(180deg, #de2f45, #bf1f32) !important;
    color: #fff !important;
    border: 1px solid #9f1527 !important;
}

.btn.save-main-btn:hover,
button.save-main-btn:hover,
#fixedSaveBtn:hover {
    filter: brightness(1.08);
}

.btn.save-main-btn:disabled,
button.save-main-btn:disabled,
#fixedSaveBtn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ── Bottone salva fisso in basso a destra ── */
.save-fixed {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100001;
    padding: 10px 20px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0,0,0,.28);
    background: linear-gradient(180deg, #de2f45, #bf1f32) !important;
    color: #fff !important;
    border: 1px solid #9f1527 !important;
}

@media (max-width: 600px) {
    .logo-link::after {
        content: none;
    }
    .header-sep {
        display: none;
    }
}

@media screen and (max-width: 800px) {
    .container {
        margin: 0;
        /* padding: 0; */
        padding-left: 4px;
        padding-right: 6px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    .header h1 {
        font-size: 1.2rem;
    }
    .app-wrapper .container > .header {
        padding: 10px;
    }
    .sidebar-toggle-btn {
        margin-right: 5px;
        padding: 5px 8px;
    }
    .save-fixed {
        right: 1%;
        left: 1%;
        width: 98%;
        border-radius: 12px;
        text-align: center;
    }
}
