/* Tile Modals - Lucid Glass Style */

/* Overlay del modale */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

/* Container del modale */
.modal-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

/* Header del modale */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: scale(1.1);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

/* Contenuto del modale */
.modal-content {
    padding: 24px;
    color: #ffffff;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
    line-height: 1.6;
}

/* Stili per il contenuto specifico dei tile */
.tile-detail-section {
    margin-bottom: 24px;
}

.tile-detail-section:last-child {
    margin-bottom: 0;
}

.tile-detail-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tile-detail-title svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.tile-detail-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.tile-detail-content:last-child {
    margin-bottom: 0;
}

.tile-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.tile-status-badge.green {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.tile-status-badge.yellow {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.tile-status-badge.orange {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.tile-status-badge.red {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.tile-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tile-info-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.tile-info-value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.tile-alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tile-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
}

.tile-alert-item:last-child {
    margin-bottom: 0;
}

.tile-alert-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.tile-alert-text {
    flex: 1;
    font-size: 14px;
    color: #ffffff;
}

.tile-alert-level {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tile-alert-level.green {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.tile-alert-level.yellow {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.tile-alert-level.orange {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.tile-alert-level.red {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Responsive design */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 16px;
    }
    
    .modal-container {
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-content {
        padding: 20px;
        max-height: calc(90vh - 60px);
    }
    
    .tile-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tile-detail-content {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 12px;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-content {
        padding: 16px;
    }
    
    .tile-detail-title {
        font-size: 14px;
    }
    
    .tile-detail-content {
        padding: 10px;
    }
}

/* Animazioni per il contenuto */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content .tile-detail-section {
    animation: fadeInUp 0.3s ease forwards;
}

.modal-content .tile-detail-section:nth-child(1) { animation-delay: 0.1s; }
.modal-content .tile-detail-section:nth-child(2) { animation-delay: 0.2s; }
.modal-content .tile-detail-section:nth-child(3) { animation-delay: 0.3s; }
.modal-content .tile-detail-section:nth-child(4) { animation-delay: 0.4s; }

/* Scrollbar personalizzata */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Nuovi stili per i bollettini */
.tile-bulletin-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(234, 88, 12, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(234, 88, 12, 0.3);
    border-radius: 12px;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.tile-bulletin-button:hover {
    background: rgba(234, 88, 12, 0.3);
    border-color: rgba(234, 88, 12, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.2);
}

.tile-bulletin-button svg {
    width: 16px;
    height: 16px;
}

/* Stili per le zone di rischio */
.tile-zones-list {
    margin-top: 16px;
}

.tile-zones-list h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.tile-zone-risk {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
    min-width: 60px;
    text-align: center;
}

.tile-zone-risk.red {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tile-zone-risk.orange {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.tile-zone-risk.yellow {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.tile-zone-risk.green {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Stili per i messaggi di alert */
.tile-alert-message {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

.tile-alert-message p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-style: italic;
    line-height: 1.5;
}

/* Loading spinner per i modali */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #ea580c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messaggi di errore */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.9);
}

.error-message h3 {
    color: #fca5a5;
    margin: 0 0 16px 0;
    font-size: 1.2rem;
}

.error-message p {
    margin: 8px 0;
    line-height: 1.5;
}

/* Responsive per i nuovi elementi */
@media (max-width: 768px) {
    .tile-bulletin-button {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .tile-zone-risk {
        font-size: 0.7rem;
        padding: 3px 6px;
        min-width: 50px;
    }
    
    .tile-zones-list h4 {
        font-size: 0.9rem;
    }
}
