.progetto-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  opacity: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease;
}

.progetto-modal.show {
  opacity: 1;
}

.progetto-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.7);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.progetto-modal.show .progetto-modal-content {
  transform: scale(1);
}

.progetto-popup-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.progetto-popup-header {
  position: relative;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.progetto-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  z-index: 10;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.progetto-popup-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #000;
}

.progetto-popup-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.progetto-popup-title-area {
  padding: 20px;
}

.progetto-popup-title {
  margin: 0 0 10px 0;
  font-size: 24px;
  color: #333;
}

.progetto-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.progetto-status-pianificato {
  background: #e3f2fd;
  color: #1976d2;
}
.progetto-status-in_corso {
  background: #fff3e0;
  color: #f57c00;
}
.progetto-status-completato {
  background: #e8f5e8;
  color: #388e3c;
}
.progetto-status-sospeso {
  background: #ffebee;
  color: #d32f2f;
}

.progetto-popup-body {
  display: flex;
  overflow-y: auto;
  flex: 1;
  max-height: calc(90vh - 240px);
  min-height: 0;
  padding-bottom: 40px;
}

.progetto-popup-main {
  flex: 2;
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 240px);
  min-height: 0;
  padding-bottom: 40px;
}

.progetto-popup-sidebar {
  flex: 1;
  background: #f8f9fa;
  padding: 20px;
  border-left: 1px solid #dee2e6;
  overflow-y: auto;
  max-height: calc(90vh - 240px);
  min-height: 0;
  padding-bottom: 40px;
}

.progetto-excerpt {
  margin-bottom: 20px;
  font-style: italic;
  color: #6c757d;
}

.progetto-content {
  margin-bottom: 30px;
  line-height: 1.6;
}

.progetto-galleria h4 {
  margin-bottom: 15px;
  color: #333;
}

.progetto-galleria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.progetto-galleria-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.progetto-galleria-image:hover {
  transform: scale(1.05);
}

.progetto-details h4 {
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #007cba;
  padding-bottom: 5px;
}

.progetto-detail {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.progetto-detail strong {
  display: block;
  margin-bottom: 5px;
  color: #495057;
}

.progetto-actions {
  margin-top: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: #007cba;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn:hover {
  background: #20497e;
  color: white;
}

.progetto-loading,
.progetto-error {
  padding: 50px;
  text-align: center;
  font-size: 18px;
}

.progetto-error {
  color: #d32f2f;
}

body.modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .progetto-modal {
    padding: 10px;
  }

  .progetto-popup-body {
    flex-direction: column;
  }

  .progetto-popup-sidebar {
    border-left: none;
    border-top: 1px solid #dee2e6;
  }

  .progetto-popup-title {
    font-size: 20px;
  }
}
