:root {
    --primary-color: #4eb857;
    --background-color: #243a33;
    --accent-color: #ff;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --error-color: #ff6b6b;
    --success-color: #4eb857;
}

/* 
   Stili generali dell'applicazione FreedHome
   Colori principali: #4eb857 (verde), #243a33 (scuro)
*/

/* Stili generali */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0 auto;
    padding: 20px;
    color: var(--background-color);
    background-color: #f5f7fa;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    color: var(--background-color);
}

h1 {
    color: var(--primary-color);
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
}

h2 {
    color: var(--background-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
}

h3 {
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
    margin-top: 25px;
    margin-bottom: 15px;
}

/* Pagina di login */
.login-container {
    background-color: white;
    border-left: 4px solid var(--primary-color);
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

/* Pagina login - layout dimensioni */
body.login-page {
    max-width: 400px;
}

/* Form elements */
.form-group {
    margin-bottom: 15px;
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: var(--background-color);
}

input[type="email"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input[type="email"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(78, 184, 87, 0.2);
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.login-page button {
    width: 100%;
}

button:hover {
    background-color: #3a9745;
}

/* Messaggi generici */
.error-message {
    color: var(--error-color);
    margin-top: 10px;
    text-align: center;
    display: none;
}

/* Dashboard stili */
body.dashboard-page {
    max-width: 1200px;
}

.dashboard-header {
    background-color: var(--background-color);
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.dashboard-header h1 {
    margin: 0;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#accommodationsContainer {
    padding: 20px;
    background-color: transparent;
    border-radius: 10px;
    margin: 20px;
}

/* Vista a schede */
.accommodation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.accommodation-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 4px solid var(--primary-color);
}

.accommodation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.accommodation-card-header {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.accommodation-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.accommodation-card:hover .accommodation-card-image {
    transform: scale(1.05);
}

.accommodation-card-body {
    padding: 16px;
    flex-grow: 1;
}

.accommodation-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--background-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.5em;
}

.accommodation-card-id {
    display: inline-block;
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}

.accommodation-card-location {
    font-size: 14px;
    color: #555;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accommodation-card-footer {
    padding: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fbfbfb;
}

.accommodation-actions {
    display: flex;
    gap: 10px;
}

.card-button {
    border: none;
    background-color: #f2f2f2;
    color: #333;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.card-button.details {
    background-color: rgba(78, 184, 87, 0.1);
    color: var(--primary-color);
}

.card-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.card-status {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-block;
    white-space: nowrap;
    text-transform: uppercase;
}

.status, .card-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-active {
    background-color: rgba(78, 184, 87, 0.15);
    color: var(--primary-color);
}

.status-inactive {
    background-color: rgba(255, 173, 51, 0.15);
    color: #f90;
}

.status-deleted {
    background-color: rgba(255, 0, 0, 0.15);
    color: #e53935;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #777;
}

.dashboard-error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin: 20px;
    font-size: 14px;
    border-left: 4px solid #c62828;
}

.button, #refreshButton, #logoutButton {
    background-color: var(--primary-color);
    color: white;
}

#logoutButton {
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 5px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

#logoutButton:hover {
    background-color: #3d9947;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.button:hover, #refreshButton:hover {
    background-color: #3d9947;
}

.actions {
    display: flex;
    justify-content: space-between;
    margin: 20px;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.view-toggle {
    display: flex;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle button {
    border: none;
    background-color: transparent;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.view-toggle button:hover {
    background-color: rgba(78, 184, 87, 0.1);
}

.view-toggle button.active {
    background-color: var(--primary-color);
    color: white;
}

.view-toggle .material-icons {
    font-size: 24px;
}

/* Manteniamo anche la vista tabella ma la nascondiamo di default */
.accommodation-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.accommodation-list thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 60px;
    z-index: 1;
}

.accommodation-list th {
    padding: 15px;
    text-align: left;
    color: var(--background-color);
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
}

.accommodation-list td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.accommodation-list tr:hover {
    background-color: #f9f9f9;
}

/* Control per selezionare il numero di immobili */
.select-control {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
    background-color: white;
    outline: none;
    cursor: pointer;
}

.select-control:focus {
    border-color: var(--primary-color);
}

/* Modal dei dettagli */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border-radius: 12px;
    width: 80%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 20px var(--shadow-color);
    display: flex;
    flex-direction: column;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--background-color);
    color: white;
    padding: 15px 25px;
    border-bottom: 3px solid var(--primary-color);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    padding: 0;
    color: white;
    font-size: 1.4em;
    border-bottom: none;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

.close-button {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

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

#modalTitle {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--background-color);
}

/* Stili per i dettagli della proprietà */
.property-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-section {
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.detail-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 18px;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

.detail-row {
    margin-bottom: 8px;
    display: flex;
}

.detail-row .label {
    min-width: 150px;
    font-weight: 600;
    color: #666;
}

.detail-row .value {
    flex: 1;
    color: #333;
}

/* Stile per le azioni in tabella */
.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
}

.table-button {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-button.details {
    background-color: rgba(78, 184, 87, 0.1);
    color: var(--primary-color);
}

.table-button.edit {
    background-color: rgba(78, 184, 87, 0.1);
    color: var(--primary-color);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
}

.table-button .material-icons {
    font-size: 16px;
}

.table-button:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Pulsanti sulla scheda */
.card-edit, .card-options {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    border: none;
}

.card-edit {
    top: 10px;
    right: 56px;
}

.card-options {
    top: 10px;
    right: 10px;
}

.card-edit:hover, .card-options:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.card-edit .material-icons, .card-options .material-icons {
    font-size: 20px;
    color: var(--background-color);
    transition: color 0.2s ease;
}

.card-edit:hover .material-icons, .card-options:hover .material-icons {
    color: white;
}

/* Galleria immagini */
.detail-gallery-container {
    margin-bottom: 24px;
    width: 100%;
}

.detail-image-main {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-image-main.no-image {
    background-color: #f5f5f5;
    border: 1px dashed #ccc;
    color: #666;
}

.detail-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.thumbnail.active {
    border: 2px solid var(--primary-color);
}

/* Modal per dettagli */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 1000px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Stili per la galleria immagini */
.gallery-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.main-image-container {
    width: 100%;
    height: 300px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnails-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.thumbnail.active {
    border-color: var(--primary-color);
}

.thumbnail:hover {
    transform: scale(1.05);
}

.no-image {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-style: italic;
}

/* Modal header con colore di sfondo */
.modal-content h2 {
    background-color: var(--background-color);
    color: white;
    padding: 10px 15px;
    margin: -25px -25px 20px -25px;
    border-radius: 12px 12px 0 0;
    border-bottom: 3px solid var(--primary-color);
}

/* Stile per le sezioni di dettaglio */
.detail-section h3 {
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

/* Stile per le tabs */
.tabs-container {
    margin: 20px 0;
    border-bottom: 2px solid var(--primary-color);
}

.tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tabs li {
    padding: 10px 20px;
    background-color: #f1f1f1;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tabs li.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.tabs li:hover:not(.active) {
    background-color: #e0e0e0;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

/* Stats Bar Styles */
.stats-bar {
    display: flex;
    justify-content: space-between;
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

/* Sync Status Styles */
.accommodation-card .sync-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
}

.sync-status.synced {
    background-color: rgba(78, 184, 87, 0.2);
    color: var(--primary-color);
}

.sync-status.pending {
    background-color: rgba(255, 165, 0, 0.2);
    color: #ff8c00;
}

/* Stile per il placeholder delle immagini mancanti */
.accommodation-card-placeholder {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--background-color) 100%);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Variazioni di colore per i diversi tipi di immobili */
.accommodation-card-placeholder[data-type="APARTMENT"] {
    background: linear-gradient(135deg, #4eb857 0%, #2E7D32 100%);
}

.accommodation-card-placeholder[data-type="HOUSE"] {
    background: linear-gradient(135deg, #4CAF50 0%, #1B5E20 100%);
}

.accommodation-card-placeholder[data-type="VILLA"] {
    background: linear-gradient(135deg, #66BB6A 0%, #388E3C 100%);
}

.accommodation-card-placeholder[data-type="RURAL"] {
    background: linear-gradient(135deg, #81C784 0%, #43A047 100%);
}

.accommodation-card-placeholder[data-type="HOTEL"] {
    background: linear-gradient(135deg, #A5D6A7 0%, #2E7D32 100%);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.accommodation-card:hover .placeholder-icon {
    transform: scale(1.1);
}

.placeholder-text {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0 10px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

/* Pattern decorativo per il placeholder */
.accommodation-card-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.accommodation-card:hover .accommodation-card-placeholder::before {
    opacity: 0.5;
}

/* Positioning elements above the pattern */
.placeholder-icon, .placeholder-text {
    position: relative;
    z-index: 2;
}

/* Stile per l'immagine nel modale dei dettagli */
.detail-image-container {
    width: 100%;
    height: 250px;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stile per il placeholder nel modale dei dettagli */
.detail-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--background-color) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Variazioni di colore per i diversi tipi di immobili nel modale */
.detail-image-placeholder[data-type="APARTMENT"] {
    background: linear-gradient(135deg, #4eb857 0%, #2E7D32 100%);
}

.detail-image-placeholder[data-type="HOUSE"] {
    background: linear-gradient(135deg, #4CAF50 0%, #1B5E20 100%);
}

.detail-image-placeholder[data-type="VILLA"] {
    background: linear-gradient(135deg, #66BB6A 0%, #388E3C 100%);
}

.detail-image-placeholder[data-type="RURAL"] {
    background: linear-gradient(135deg, #81C784 0%, #43A047 100%);
}

.detail-image-placeholder[data-type="HOTEL"] {
    background: linear-gradient(135deg, #A5D6A7 0%, #2E7D32 100%);
}

/* Pattern decorativo per il placeholder nel modale */
.detail-image-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 1;
}

/* Icona nel placeholder del modale */
.detail-image-placeholder .placeholder-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

/* Testo nel placeholder del modale */
.detail-image-placeholder .placeholder-text {
    font-size: 18px;
    font-weight: 500;
}

/* Pulsante modifica piccolo con icona */
.card-button.edit {
    border: none;
    background-color: rgba(78, 184, 87, 0.1);
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.card-button.edit .material-icons {
    font-size: 18px;
}

.card-button.edit:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Stile per le azioni in tabella */
.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
}

.table-button {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-button.details {
    background-color: rgba(78, 184, 87, 0.1);
    color: var(--primary-color);
}

.table-button.edit {
    background-color: rgba(78, 184, 87, 0.1);
    color: var(--primary-color);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
}

.table-button .material-icons {
    font-size: 16px;
}

.table-button:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Pulsanti sulla scheda */
.card-edit, .card-options {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    border: none;
}

.card-edit {
    top: 10px;
    right: 56px;
}

.card-options {
    top: 10px;
    right: 10px;
}

.card-edit:hover, .card-options:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.card-edit .material-icons, .card-options .material-icons {
    font-size: 20px;
    color: var(--background-color);
    transition: color 0.2s ease;
}

.card-edit:hover .material-icons, .card-options:hover .material-icons {
    color: white;
}

/* Galleria immagini */
.detail-gallery-container {
    margin-bottom: 24px;
    width: 100%;
}

.detail-image-main {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-image-main.no-image {
    background-color: #f5f5f5;
    border: 1px dashed #ccc;
    color: #666;
}

.detail-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.thumbnail.active {
    border: 2px solid var(--primary-color);
}

/* Modal per dettagli */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 1000px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Stili per la galleria immagini */
.gallery-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.main-image-container {
    width: 100%;
    height: 300px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnails-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.thumbnail.active {
    border-color: var(--primary-color);
}

.thumbnail:hover {
    transform: scale(1.05);
}

.no-image {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-style: italic;
}

/* Modal header con colore di sfondo */
.modal-content h2 {
    background-color: var(--background-color);
    color: white;
    padding: 10px 15px;
    margin: -25px -25px 20px -25px;
    border-radius: 12px 12px 0 0;
    border-bottom: 3px solid var(--primary-color);
}

/* Stile per le sezioni di dettaglio */
.detail-section h3 {
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

/* Stile per le tabs */
.tabs-container {
    margin: 20px 0;
    border-bottom: 2px solid var(--primary-color);
}

.tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tabs li {
    padding: 10px 20px;
    background-color: #f1f1f1;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tabs li.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.tabs li:hover:not(.active) {
    background-color: #e0e0e0;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.accommodation-card .sync-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
}

.sync-status.synced {
    background-color: rgba(78, 184, 87, 0.2);
    color: var(--primary-color);
}

.sync-status.pending {
    background-color: rgba(255, 165, 0, 0.2);
    color: #ff8c00;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: row;
        align-items: center;
        padding: 15px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0;
    }

    .user-info {
        display: flex;
        gap: 10px;
    }

    .actions {
        justify-content: center;
    }

    .accommodation-list th, 
    .accommodation-list td {
        padding: 10px;
    }

    .property-details {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-row .label {
        width: auto;
        margin-bottom: 5px;
    }
}

/* Effetti dark mode (optional) - si attiva automaticamente se il sistema dell'utente è in modalità scura */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #f0f0f0;
    }

    .accommodation-list,
    .accommodation-card,
    .login-container,
    .modal-content {
        background-color: #2c2c2c;
        color: #f0f0f0;
    }

    .accommodation-list th,
    .accommodation-list td {
        border-color: #444;
    }

    .accommodation-card-footer {
        background-color: #333;
        border-color: #444;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #f0f0f0;
    }

    .accommodation-card-title {
        color: #f0f0f0;
    }

    .accommodation-card-location,
    .accommodation-card-id {
        color: #aaa;
    }

    .detail-section {
        background-color: #333;
    }

    .detail-row .label {
        color: #aaa;
    }

    .close-button {
        color: #ccc;
    }

    .close-button:hover,
    .close-button:focus {
        color: #fff;
    }

    .select-control {
        background-color: #333;
        border-color: #555;
        color: #f0f0f0;
    }

    input {
        background-color: #333;
        border-color: #555;
        color: #f0f0f0;
    }

    input:focus {
        border-color: var(--primary-color);
    }

    .card-button {
        background-color: #333;
        color: #f0f0f0;
    }

    .card-button.details {
        background-color: rgba(78, 184, 87, 0.2);
    }
}

/* Stili per il modale migliorato */
.modal-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.detail-section {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s;
    width: calc(50% - 10px);
    border-left: 3px solid var(--primary-color);
}

.detail-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.detail-section.primary-section {
    width: 100%;
    background-color: #f9fcf9;
    border-left: 4px solid var(--primary-color);
}

.detail-section h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(78, 184, 87, 0.2);
    border-left: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.detail-row {
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
}

.detail-row .label {
    font-weight: 600;
    color: var(--background-color);
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.detail-row .value {
    color: #444;
    font-size: 0.95rem;
    word-break: break-word;
}

/* Miglioramenti galleria */
.gallery-container {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-image-container {
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-image-container img:hover {
    transform: scale(1.02);
}

.thumbnails-container {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    gap: 8px;
    background-color: rgba(36, 58, 51, 0.05);
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(78, 184, 87, 0.3);
}

/* Responsive design per il modale */
@media (max-width: 768px) {
    .modal-layout {
        flex-direction: column;
    }
    
    .detail-section,
    .detail-section.primary-section {
        width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .main-image-container {
        height: 200px;
    }
}

/* Stili per il placeholder delle immagini nei dettagli dell'immobile */
.placeholder-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: white;
    text-align: center;
    border-radius: 8px;
}

.placeholder-image {
    visibility: hidden;
}

.placeholder-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.placeholder-label {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Aggiunta di un banner "Da Inviare" nell'angolo superiore destro del placeholder */
.placeholder-container::after {
    content: "Da Inviare";
    position: absolute;
    top: 10px;
    right: -25px;
    background-color: #ff9500;
    color: white;
    padding: 5px 25px;
    font-size: 12px;
    transform: rotate(45deg);
    transform-origin: top left;
    font-weight: bold;
}
