/* petition-modal.css - Petition Modal Styling (Phase 5.1) */

/* ===================================== */
/* PETITION STATUS BADGES */
/* ===================================== */
.wb-petition-status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wb-petition-status-badge.active {
  background: #10b981;
  color: white;
}

.wb-petition-status-badge.successful {
  background: #808080;
  color: white;
}

.wb-petition-status-badge.closed {
  background: #6b7280;
  color: white;
}

.wb-petition-category-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: #e0e7ff;
  color: #4f46e5;
  font-weight: 500;
}

/* ===================================== */
/* PROGRESS BAR */
/* ===================================== */
.wb-petition-progress-section {
  background: #f9fafb;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.wb-petition-progress-bar-container {
  width: 100%;
  height: 24px;
  background: #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin: 12px 0;
}

.wb-petition-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: 12px;
  transition: width 0.5s ease;
  position: relative;
}

.wb-petition-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.wb-petition-progress-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #374151;
  margin-top: 8px;
}

.wb-petition-success-message {
  margin-top: 12px;
  padding: 12px;
  background: #d1fae5;
  border: 1px solid #10b981;
  border-radius: 8px;
  color: #065f46;
  font-weight: 600;
  text-align: center;
}

/* ===================================== */
/* SIGN BUTTON */
/* ===================================== */
.wb-petition-sign-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.wb-petition-sign-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.wb-petition-sign-btn:active:not(:disabled) {
  transform: translateY(0);
}

.wb-petition-sign-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wb-petition-sign-btn.signed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

/* ===================================== */
/* UPDATE BUTTON */
/* ===================================== */
.wb-petition-update-btn {
  width: 100%;
  padding: 12px;
  background: #4682B4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  transition: all 0.3s ease;
}

.wb-petition-update-btn:hover {
  background: #5a9fd4;
  transform: translateY(-1px);
}

/* ===================================== */
/* UPDATES SECTION */
/* ===================================== */
.wb-petition-updates {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.wb-petition-update-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.wb-petition-update-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.wb-petition-update-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.wb-petition-update-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #667eea;
}

.wb-petition-update-meta {
  flex: 1;
}

.wb-petition-update-author {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
  margin-bottom: 2px;
}

.wb-petition-update-time {
  font-size: 12px;
  color: #6b7280;
}

.wb-petition-update-content {
  padding-left: 52px;
}

.wb-petition-update-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.wb-petition-update-message {
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
  font-size: 14px;
}

/* ===================================== */
/* UPDATE FORM OVERLAY */
/* ===================================== */
.wb-update-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000200;
  animation: fadeIn 0.2s ease;
}

.wb-update-form-container {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.wb-update-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.wb-update-form-header h3 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.wb-update-form-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px; /* ACT 1: 8px radius for small buttons */
  transition: all 0.2s ease;
}

.wb-update-form-close:hover {
  background: #f3f4f6;
  color: #111827;
}

#wbUpdateForm {
  padding: 20px;
}

.wb-update-form-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #dbeafe;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  font-size: 13px;
  color: #1e3a8a;
  margin-bottom: 20px;
}

.wb-update-form-info i {
  color: #3b82f6;
  font-size: 16px;
}

.wb-update-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.wb-update-form-cancel {
  padding: 12px 24px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wb-update-form-cancel:hover {
  background: #e5e7eb;
}

.wb-update-form-submit {
  padding: 12px 24px;
  background: #4682B4 !important;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.wb-update-form-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(70, 130, 180, 0.4);
  background: #5a9fd4 !important;
}

.wb-update-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===================================== */
/* LOCATION INPUT STYLING */
/* ===================================== */
.location-method-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-radius: 12px; /* ACT 1: 12px radius for containers */
  background: #f3f4f6;
  padding: 4px;
}

.location-method-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px; /* ACT 1: 8px radius for small buttons */
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.location-method-btn:hover {
  color: #374151;
  background: rgba(255, 255, 255, 0.5);
}

.location-method-btn.active {
  background: white;
  color: #667eea;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.location-input-section {
  margin-top: 12px;
}

.postcode-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.postcode-input-wrapper input {
  flex: 1;
  padding-right: 40px;
}

.postcode-status {
  position: absolute;
  right: 12px;
  font-size: 16px;
  pointer-events: none;
}

.postcode-status.validating {
  color: #667eea;
}

.postcode-status.valid {
  color: #10b981;
  animation: checkPop 0.3s ease;
}

.postcode-status.invalid {
  color: #ef4444;
  animation: shake 0.3s ease;
}

.postcode-status.error {
  color: #808080;
}

@keyframes checkPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.postcode-hint {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-top: 6px;
}

.postcode-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: #4338ca;
  font-size: 14px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.postcode-preview i {
  color: #667eea;
  font-size: 16px;
}

.device-location-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.device-location-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.device-location-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.device-location-btn.success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ===================================== */
/* FIELD HELP SYSTEM */
/* ===================================== */
.field-help-icon {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  cursor: help;
  padding: 2px 4px;
  margin-left: 4px;
  transition: all 0.2s ease;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.field-help-icon:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  transform: scale(1.1);
}

.field-help-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  z-index: 10001;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.field-help-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.field-help-toast-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.field-help-icon-emoji {
  font-size: 24px;
  flex-shrink: 0;
}

.field-help-toast-header strong {
  flex: 1;
  color: #111827;
  font-size: 16px;
}

.field-help-toast-close {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px; /* ACT 1: 8px radius for small buttons */
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.field-help-toast-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.field-help-toast-body {
  padding: 16px;
  color: #374151;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .field-help-toast {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(-100px);
  }

  .field-help-toast.show {
    transform: translateY(0);
  }
}

/* ===================================== */
/* FORM STYLING */
/* ===================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group small {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-top: 4px;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* ===================================== */
/* FREEMIUM NOTICE */
/* ===================================== */
.freemium-notice {
  background: #f3f4f6;
  border: 1px solid #808080;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #374151;
  margin-bottom: 20px;
}

.freemium-notice i {
  color: #808080;
  font-size: 16px;
}

/* ===================================== */
/* SUBMIT BUTTON */
/* ===================================== */
.submit-petition-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.submit-petition-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.submit-petition-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-petition-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===================================== */
/* PLACEHOLDER */
/* ===================================== */
.placeholder {
  text-align: center;
  color: #9ca3af;
  padding: 20px;
  font-style: italic;
}

/* ===================================== */
/* OFFICIAL RESPONSE STYLING */
/* ===================================== */
.wb-petition-official-response {
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  border: 2px solid #0284c7;
  position: relative;
  padding-top: 50px;
}

.wb-petition-official-response:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #0369a1;
}

.wb-petition-response-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0284c7;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.3);
}

.wb-petition-response-badge i {
  font-size: 14px;
}

.wb-petition-official-response .wb-petition-update-icon {
  border-color: #0284c7;
}

.wb-petition-official-response .wb-petition-update-title {
  color: #0c4a6e;
}

/* ===================================== */
/* LOG RESPONSE DRAWER (ACT 1 PATTERN) */
/* ===================================== */
.wb-response-drawer {
  z-index: 1000200; /* Layer over petition drawer (1000100) */
  transform: translateX(100%); /* Hidden off-screen to the right */
  transition: transform 300ms ease-in-out;
}

.wb-response-drawer.open {
  transform: translateX(0); /* Slide in from right */
}

/* Cadet Blue Title Background with White Text - Override base .wb-incident-title */
.wb-update-drawer-title {
  background: #5F9EA0 !important; /* Cadet Blue background */
  color: white !important; /* White text */
  padding: 6px 18px !important; /* Match style guide */
  margin: 0 auto 24px !important; /* Centered with auto margins */
  border-radius: 8px !important; /* Match style guide */
  width: 75% !important; /* Match style guide - centered at 75% width */
  max-width: 75% !important;
  text-align: center !important;
  border-left: 1.5px solid #000000 !important; /* Black highlight on left */
  border-bottom: 1.5px solid #000000 !important; /* Black highlight on bottom */
}

/* Remove triangle down-point from update drawer title */
.wb-update-drawer-title::after {
  display: none !important; /* Remove the triangle arrow */
}

/* Reduced Padding - Half of Original */
.wb-response-drawer .wb-response-section {
  padding: 10px !important; /* Reduced from 20px */
  border-left: 3px solid #5F9EA0 !important; /* Cadet blue left border */
  border-bottom: 3px solid #5F9EA0 !important; /* Cadet blue bottom border */
  background: #F5F5F5 !important;
  box-shadow: none !important; /* Remove firebrick red box-shadow */
}

/* Increased Top Padding for Title and Details Sections */
.wb-update-title-section {
  margin-top: 20px !important;
}

.wb-update-details-section {
  margin-top: 20px !important;
}

.wb-update-attachment-section {
  margin-top: 20px !important;
}

/* White Background Choose File Button with Cadet Blue Border */
.wb-update-file-btn {
  width: 100%;
  padding: 12px;
  background: white !important;
  border: 2px solid #5F9EA0 !important;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #5F9EA0 !important;
  font-weight: 500;
  transition: all 0.2s ease;
}

.wb-update-file-btn:hover {
  background: #f0f9f9 !important;
  border-color: #4a7c7e !important;
}

/* Footer Buttons */
.wb-response-footer {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: white;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.wb-response-cancel {
  flex: 1;
  padding: 12px 24px;
  background: white;
  color: #374151;
  border: 2px solid #5F9EA0; /* Cadet Blue border */
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wb-response-cancel:hover {
  background: #f3f4f6;
  border-color: #4a7c7e;
}

.wb-response-submit {
  flex: 1;
  padding: 12px 24px;
  background: #5F9EA0; /* Cadet Blue */
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.wb-response-submit:hover:not(:disabled) {
  background: #4a7c7e; /* Darker cadet blue */
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(95, 158, 160, 0.4);
}

.wb-response-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Response Detail Drawer */
.wb-response-detail-drawer {
  z-index: 1000200; /* Layer over petition drawer */
  transform: translateX(100%);
  transition: transform 300ms ease-in-out;
}

.wb-response-detail-drawer.open {
  transform: translateX(0);
}

/* Single Close Button for Detail Drawer */
.wb-response-close-btn {
  width: 100%;
  padding: 12px 24px;
  background: #5F9EA0; /* Cadet Blue */
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.wb-response-close-btn:hover {
  background: #4a7c7e;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(95, 158, 160, 0.4);
}

/* Detail Drawer Cadet Blue Title - Override base .wb-incident-title */
.wb-update-detail-title {
  background: #5F9EA0 !important; /* Cadet Blue background */
  color: white !important; /* White text */
  padding: 6px 18px !important; /* Match style guide */
  margin: 0 auto 24px !important; /* Centered with auto margins */
  border-radius: 8px !important; /* Match style guide */
  width: 75% !important; /* Match style guide - centered at 75% width */
  max-width: 75% !important;
  text-align: center !important;
  border-left: 1.5px solid #000000 !important; /* Black highlight on left */
  border-bottom: 1.5px solid #000000 !important; /* Black highlight on bottom */
}

/* Remove triangle down-point from detail drawer title */
.wb-update-detail-title::after {
  display: none !important; /* Remove the triangle arrow */
}

/* Detail Drawer Sections with Spacing and No Firebrick Shadow */
.wb-response-detail-drawer .wb-response-section {
  box-shadow: none !important; /* Remove firebrick red box-shadow */
  border-left: 3px solid #5F9EA0 !important; /* Cadet blue left border */
  border-bottom: 3px solid #5F9EA0 !important; /* Cadet blue bottom border */
}

.wb-update-detail-meta {
  margin-top: 20px !important;
}

.wb-update-detail-title-section {
  margin-top: 20px !important;
}

.wb-update-detail-details-section {
  margin-top: 20px !important;
}

.wb-update-detail-attachment-section {
  margin-top: 20px !important;
}

/* ===================================== */
/* RESPONSIVE */
/* ===================================== */
@media (max-width: 768px) {
  .wb-petition-progress-section {
    padding: 16px;
  }

  .wb-petition-sign-btn,
  .submit-petition-btn {
    padding: 14px;
    font-size: 15px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .wb-petition-response-badge {
    font-size: 11px;
    padding: 5px 10px;
  }
}
