/* Estimate View Styles (public + admin preview) */

.cmp-estimate-view {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #1f2937;
}

/* Loading & Error */
.cmp-ev-loading {
  text-align: center;
  padding: 4rem 1rem;
  color: #6b7280;
  font-size: 18px;
}

.cmp-ev-error {
  text-align: center;
  padding: 4rem 1rem;
  color: #991b1b;
  font-size: 18px;
}

/* Toolbar */
.cmp-ev-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

/* Buttons */
.cmp-ev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 16px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cmp-ev-btn-pdf {
  background: white;
  color: #374151;
  border-color: #d1d5db;
}

.cmp-ev-btn-pdf:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.cmp-ev-btn-accept {
  background: #347F09;
  color: white;
  border-color: #347F09;
  padding: 0.75rem 2rem;
  font-size: 18px;
}

.cmp-ev-btn-accept:hover {
  background: #2a6607;
}

.cmp-ev-btn-accept:disabled {
  background: #8bc270;
  cursor: not-allowed;
}

.cmp-ev-btn-decline {
  background: white;
  color: #63151C;
  border-color: #63151C;
  padding: 0.75rem 2rem;
  font-size: 18px;
}

.cmp-ev-btn-decline:hover {
  background: #fef2f2;
}

.cmp-ev-btn-cancel {
  background: white;
  color: #6b7280;
  border-color: #d1d5db;
}

.cmp-ev-btn-cancel:hover {
  background: #f9fafb;
}

.cmp-ev-btn-decline-confirm {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.cmp-ev-btn-decline-confirm:hover {
  background: #b91c1c;
}

.cmp-ev-btn-decline-confirm:disabled {
  background: #fca5a5;
  cursor: not-allowed;
}

/* Estimate Content */
.cmp-ev-estimate-html {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Action Buttons */
.cmp-ev-actions {
  text-align: center;
  padding: 2rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.cmp-ev-actions-label {
  font-size: 18px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 1rem 0;
}

.cmp-ev-actions-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Status Message */
.cmp-ev-status {
  text-align: center;
  padding: 1.5rem;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.cmp-ev-status.status-accepted {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.cmp-ev-status.status-declined {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.cmp-ev-status.status-expired {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

/* Decline Modal */
.cmp-ev-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.cmp-ev-modal {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.cmp-ev-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.cmp-ev-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.cmp-ev-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 4px;
}

.cmp-ev-modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.cmp-ev-modal-body {
  padding: 1.5rem;
}

.cmp-ev-decline-field {
  margin-top: 1rem;
}

.cmp-ev-decline-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.cmp-ev-decline-reason {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}

.cmp-ev-decline-reason:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.cmp-ev-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* ── Estimate Photos (read-only) ── */

.cmp-ev-photos {
  margin-bottom: 2rem;
}

.cmp-ev-photos-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 1rem 0;
}

.cmp-ev-photos-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cmp-ev-photo-thumb {
  width: 120px;
  height: 120px;
  flex: 0 0 120px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cmp-ev-photo-thumb img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: opacity 0.15s ease;
}

.cmp-ev-photo-thumb img:hover {
  opacity: 0.85;
}

/* Responsive */
@media (max-width: 768px) {
  .cmp-estimate-view {
    padding: 1rem;
  }

  .cmp-ev-estimate-html {
    padding: 1rem;
  }

  .cmp-ev-actions-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cmp-ev-btn-accept,
  .cmp-ev-btn-decline {
    width: 100%;
    max-width: 300px;
  }
}
