/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal-backdrop);
  padding: 20px;
}

/* Modal Container */
.project-detail-modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.close-button:hover {
  background-color: #f3f4f6;
  color: #374151;
}

/* Modal Content */
.modal-content {
  padding: 0;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
}

/* Loading and Error States */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 16px;
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 16px;
  color: #ef4444;
}

.retry-button {
  padding: 8px 16px;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

/* Project Details */
.project-details {
  padding: 24px;
}

/* Project Header */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 24px;
}

.project-title-section h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.work-id {
  font-size: 14px;
  color: #6b7280;
  font-family: 'Monaco', 'Menlo', monospace;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.completed {
  background-color: #dcfce7;
  color: #16a34a;
}

.status-badge.in-progress {
  background-color: #fef3c7;
  color: #d97706;
}

.status-badge.recommended {
  background-color: #dbeafe;
  color: #2563eb;
}

.status-badge.pending {
  background-color: #f3f4f6;
  color: #6b7280;
}

.status-icon {
  width: 14px;
  height: 14px;
}

.project-amount {
  text-align: right;
  flex-shrink: 0;
}

.amount-label {
  display: block;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
}

.amount-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #059669;
}

/* Info Grid */
.project-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.info-section {
  background-color: #f9fafb;
  border-radius: 8px;
  padding: 20px;
}

.info-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}

.info-content {
  space-y: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.info-label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
  flex-shrink: 0;
}

.info-value {
  font-size: 14px;
  color: #111827;
  text-align: right;
  flex: 1;
  word-break: break-word;
}

/* Impact Section */
.impact-section {
  margin-bottom: 32px;
}

.impact-section h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

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

.impact-item {
  background-color: #f0f9ff;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.impact-label {
  display: block;
  font-size: 12px;
  color: #0369a1;
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.impact-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #0c4a6e;
}

/* Quality Rating */
.quality-section {
  margin-bottom: 32px;
}

.quality-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.rating-display {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rating-value {
  font-size: 32px;
  font-weight: 700;
  color: #f59e0b;
}

.rating-stars {
  display: flex;
  gap: 4px;
}

.star-filled {
  color: #f59e0b;
  fill: currentColor;
}

.star-empty {
  color: #d1d5db;
}

/* Photos Section */
.photos-section {
  margin-bottom: 32px;
}

.photos-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

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

.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f3f4f6;
  aspect-ratio: 4/3;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* Expenditure Section */
.expenditure-section {
  margin-bottom: 32px;
}

.expenditure-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.expenditure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.expenditure-item {
  background-color: #f0fdf4;
  padding: 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.expenditure-label {
  font-size: 14px;
  color: #15803d;
  font-weight: 500;
}

.expenditure-value {
  font-size: 16px;
  font-weight: 600;
  color: #166534;
}

/* Loading Spinner */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f4f6;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 10px;
  }
  
  .project-detail-modal {
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 16px;
  }
  
  .project-details {
    padding: 16px;
  }
  
  .project-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .project-amount {
    text-align: left;
  }
  
  .project-info-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .impact-grid {
    grid-template-columns: 1fr;
  }
  
  .expenditure-grid {
    grid-template-columns: 1fr;
  }
  
  .photos-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}