/* =================================
   TEXT TOOL SPECIFIC STYLES
   Form-specific styling for workplace interaction report
   ================================= */

/* Document Title Section */
.document-title {
  background: linear-gradient(135deg, #E5F4F4, #F6F8F9);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 5px solid #2D7D7D;
}

.document-title h2 { 
  color: #2D7D7D; 
  font-size: 24px; 
  margin-bottom: 8px; 
}

.document-title p { 
  color: #6B7280; 
  font-size: 14px; 
  line-height: 1.5;
}

/* Instructions Section */
.instructions-section {
  background-color: #F6F8F9;
  border: 1px solid #E5F4F4;
  border-radius: 8px;
  margin-bottom: 25px;
  overflow: hidden;
}

.instructions-header {
  background-color: #FFFFFF;
  color: #FF6B47;
  border-left: 4px solid #FF6B47;
  border-bottom: 1px solid #E5F4F4;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
}

.instructions-content { 
  padding: 20px; 
}

.instructions-content p { 
  margin-bottom: 12px; 
  color: #3F4C5C; 
  font-size: 14px; 
  line-height: 1.6; 
}

.instructions-content p:last-child { 
  margin-bottom: 0; 
}

.instructions-content em { 
  color: #6B7280; 
  font-style: italic; 
}

.privacy-note { 
  text-align: center; 
  padding-top: 15px; 
  margin-top: 15px; 
  border-top: 1px solid #E5F4F4; 
}

.instructions-content.steps { 
  display: flex; 
  gap: 20px; 
}

.step { 
  display: flex; 
  align-items: flex-start; 
  gap: 10px; 
  flex: 1; 
  font-size: 14px; 
}

.number {
  background: none; 
  color: #FF6B47; 
  width: 24px; 
  height: 24px; 
  border-radius: 50%;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px; 
  font-weight: bold; 
  flex-shrink: 0; 
  margin-top: 2px;
}

/* Form Sections */
.section {
  margin-bottom: 20px; 
  background-color: #FFFFFF; 
  border: 1px solid #E5F4F4; 
  border-radius: 8px; 
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-header {
  background-color: #2D7D7D; 
  color: #FFFFFF; 
  padding: 12px 15px; 
  margin: -20px -20px 20px -20px;
  border-radius: 8px 8px 0 0; 
  font-size: 16px; 
  font-weight: 600;
}

/* Form Fields */
.field-group { 
  margin-bottom: 20px; 
}

.field-label { 
  display: block; 
  font-weight: 600; 
  margin-bottom: 6px; 
  font-size: 14px; 
  color: #3F4C5C; 
}

.field-input, .field-textarea {
  width: 100%; 
  padding: 10px; 
  border: 2px solid #E5F4F4; 
  border-radius: 4px; 
  font-size: 14px; 
  font-family: inherit; 
  color: #3F4C5C; 
  background-color: #FFFFFF; 
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field-input:focus, .field-textarea:focus { 
  outline: none; 
  border-color: #2D7D7D; 
  box-shadow: 0 0 0 3px rgba(45, 125, 125, 0.1); 
}

.field-input:invalid {
  border-color: #EF4444;
}

.field-input:invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-textarea { 
  min-height: 80px; 
  resize: vertical; 
}

/* Field Layouts */
.field-row { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 15px; 
}

.field-row-three { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr; 
  gap: 15px; 
}

/* Checkbox Groups */
.checkbox-group { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  margin-bottom: 10px; 
}

.checkbox-input { 
  width: 18px; 
  height: 18px; 
  accent-color: #2D7D7D; 
  cursor: pointer;
}

.checkbox-group label {
  cursor: pointer;
  font-weight: 500;
}

.checkbox-group:hover .checkbox-input {
  transform: scale(1.05);
}

/* Sticky Submit Bar */
.submit-bar {
  position: sticky; 
  bottom: 0; 
  background: #fff; 
  border-top: 1px solid #E5F4F4;
  padding: 12px; 
  display: flex; 
  gap: 10px; 
  justify-content: flex-end; 
  align-items: center; 
  z-index: 90;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.submit-bar .help-text {
  margin-right: auto;
  margin-top: 0;
}

/* ================================
   PDF PREVIEW MODAL
   ================================ */

.pdf-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.pdf-preview-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 1;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pdf-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 2px solid #E5F4F4;
  background: linear-gradient(135deg, #E5F4F4, #F6F8F9);
  border-radius: 12px 12px 0 0;
}

.pdf-preview-header h3 {
  margin: 0;
  color: #2D7D7D;
  font-size: 20px;
  font-weight: 600;
}

.pdf-preview-content {
  flex: 1;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-preview-content iframe {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  border: 1px solid #E5F4F4;
  flex: 1;
}

/* Mobile responsive for PDF preview */
@media (max-width: 768px) {
  .pdf-preview-container {
    width: 95%;
    height: 95vh;
    border-radius: 8px;
  }
  
  .pdf-preview-header {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border-radius: 8px 8px 0 0;
  }
  
  .pdf-preview-header h3 {
    font-size: 18px;
  }
  
  .pdf-preview-content {
    padding: 10px;
  }
}

/* Error States */
.field-error {
  border-color: #EF4444 !important;
}


.error-message {
  color: #EF4444;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

/* Success States */
.field-success {
  border-color: #10B981 !important;
}

/* Progress Indicator */
.progress-container {
  background: #E5F4F4;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  display: none; /* Show when implementing progress tracking */
}

.progress-bar {
  background: #D1D5DB;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  background: linear-gradient(90deg, #2D7D7D, #FF6B47);
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-text {
  font-size: 12px;
  color: #6B7280;
  font-weight: 600;
}

/* Character Counter */
.char-counter {
  font-size: 11px;
  color: #9CA3AF;
  text-align: right;
  margin-top: 2px;
}

.char-counter.warning {
  color: #F59E0B;
}

.char-counter.error {
  color: #EF4444;
}

/* ================================
   BADGES (Prefill + PDF Note)
   ================================ */

.prefill-badge {
  background: linear-gradient(135deg, #E5F4F4, #D1E8E8);
  color: #2D7D7D;
  font-size: 13px;
  font-weight: 500;
  padding: 14px 16px;
  border-left: 4px solid #2D7D7D;
  border-radius: 6px;
  margin: -5px 0 25px 0; /* Negative top margin pulls it closer to section header */
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}

.prefill-badge::before {
  content: "✨";
  font-size: 16px;
  flex-shrink: 0;
}

.pdf-note {
  background: #FEF3C7;
  color: #92400E;
  font-size: 13px;
  font-weight: 500;
  padding: 14px 16px;
  border-left: 4px solid #F59E0B;
  border-radius: 6px;
  margin: 0 0 20px 0;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pdf-note::before {
  content: "📄";
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Mobile responsive for badges */
@media (max-width: 768px) {
  .prefill-badge,
  .pdf-note {
    font-size: 12px;
    padding: 12px 14px;
  }
  
  .prefill-badge::before,
  .pdf-note::before {
    font-size: 14px;
  }
}

/* Form Animations */
.field-input, .field-textarea {
  transform: translateY(0);
  transition: all 0.2s ease;
}

.field-input:focus, .field-textarea:focus {
  transform: translateY(-1px);
}

.section {
  animation: slideUp 0.3s ease-out;
}

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

/* Print Styles for Forms */
@media print {
  .section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #000;
  }
  
  .section-header {
    margin: -15px -15px 15px -15px;
    padding: 8px 12px;
    background: #f0f0f0 !important;
    color: #000 !important;
  }
  
  .field-group {
    margin-bottom: 12px;
  }
  
  .field-input, .field-textarea {
    border: 1px solid #000;
    background: white;
  }
  
  .instructions-section {
    margin-bottom: 15px;
  }
  
  .instructions-header {
    padding: 8px 15px;
    font-size: 14px;
    background: #f0f0f0 !important;
    color: #000 !important;
  }
  
  .instructions-content {
    padding: 15px;
  }
  
  .instructions-content p {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .submit-bar,
  .draft-banner,
  .notification {
    display: none !important;
  }
}

/* Mobile Responsive for Forms */
@media (max-width: 768px) {
  .field-row, .field-row-three {
    grid-template-columns: 1fr;
  }
  
  .instructions-content.steps {
    flex-direction: column;
    gap: 15px;
  }
  
  .section {
    padding: 15px;
  }
  
  .section-header {
    margin: -15px -15px 15px -15px;
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .submit-bar {
    flex-direction: column-reverse;
    gap: 8px;
    padding: 15px;
  }
  
  .submit-bar .help-text {
    margin-right: 0;
    text-align: center;
  }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
  .field-row-three {
    grid-template-columns: 1fr 1fr;
  }
  
  .field-row-three .field-group:nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* =================================
   INFORMATIONAL BADGES & UX ENHANCEMENTS
   User guidance, notices, and progress indicators
   ================================= */

/* Smart formatting notice (blue) */
.info-badge {
  background: #EFF6FF;
  color: #1E40AF;
  font-size: 13px;
  font-weight: 500;
  padding: 14px 16px;
  border-left: 4px solid #3B82F6;
  border-radius: 6px;
  margin: 0 0 25px 0;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-badge::before {
  content: "💡";
  font-size: 16px;
  flex-shrink: 0;
}

/* Preservation notice (coral) */
.preservation-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: #FFF4F0;
  border-left: 3px solid #FF6B47;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #3F4C5C;
}

.preservation-notice::before {
  content: "✓";
  flex-shrink: 0;
  color: #FF6B47;
  font-weight: bold;
  font-size: 14px;
}

/* Optional section badge (light blue) */
.optional-section-badge {
  background: #F0F9FF;
  color: #0369A1;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  margin: -5px 0 15px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.optional-section-badge::before {
  content: "ℹ️";
  flex-shrink: 0;
}

/* Summary badge (Phase 2 recap) */
.summary-badge {
  background: linear-gradient(135deg, #E5F4F4, #F6F8F9);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  border-left: 5px solid #2D7D7D;
  line-height: 1.6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-badge-title {
  font-size: 16px;
  font-weight: 600;
  color: #2D7D7D;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-badge-title::before {
  content: "📋";
  flex-shrink: 0;
}

.summary-badge-content {
  font-size: 14px;
  color: #3F4C5C;
}

/* Time estimate badge */
.time-estimate {
  margin-top: 15px;
  padding: 12px 15px;
  background: rgba(45, 125, 125, 0.1);
  border-radius: 6px;
  font-size: 13px;
  color: #2D7D7D;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.time-estimate::before {
  content: "⏱️";
  flex-shrink: 0;
  font-size: 16px;
}

/* Progress indicator */
.progress-indicator {
  background: #F6F8F9;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #E5F4F4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-indicator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-indicator-label {
  font-size: 13px;
  font-weight: 600;
  color: #3F4C5C;
}

.progress-indicator-text {
  font-size: 12px;
  color: #6B7280;
  font-weight: 500;
}

.progress-indicator-bar {
  background: #E5F4F4;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.progress-indicator-fill {
  background: linear-gradient(90deg, #2D7D7D, #FF6B47);
  height: 100%;
  width: 33%;
  transition: width 0.4s ease;
  border-radius: 4px;
}

/* Auto-save indicator */
.auto-save-indicator {
  position: fixed;
  top: 80px;
  right: 20px;
  background: #10B981;
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.auto-save-indicator.show {
  opacity: 1;
}

.auto-save-indicator::before {
  content: "✓";
  font-weight: bold;
}

/* Character counter enhanced */
.char-counter-enhanced {
  font-size: 11px;
  color: #9CA3AF;
  white-space: nowrap;
  margin-left: 10px;
  transition: color 0.3s ease;
  font-weight: 500;
}

.char-counter-enhanced.short {
  color: #EF4444;
}

.char-counter-enhanced.medium {
  color: #F59E0B;
}

.char-counter-enhanced.good {
  color: #10B981;
}

/* Feature grid (for document title) */
.feature-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #3F4C5C;
  line-height: 1.4;
}

.feature-item::before {
  content: "✓";
  color: #10B981;
  font-size: 16px;
  flex-shrink: 0;
  font-weight: bold;
}

/* Mobile responsive for new badges and features */
@media (max-width: 768px) {
  .info-badge,
  .preservation-notice,
  .summary-badge,
  .optional-section-badge {
    font-size: 12px;
    padding: 12px 14px;
  }
  
  .info-badge::before,
  .preservation-notice::before,
  .optional-section-badge::before {
    font-size: 14px;
  }
  
  .summary-badge-title {
    font-size: 14px;
  }
  
  .summary-badge-content {
    font-size: 13px;
  }
  
  .time-estimate {
    font-size: 12px;
    padding: 10px 12px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .feature-item {
    font-size: 12px;
  }
  
  .auto-save-indicator {
    top: 70px;
    right: 10px;
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .progress-indicator {
    padding: 12px 15px;
  }
  
  .progress-indicator-label,
  .progress-indicator-text {
    font-size: 11px;
  }
  
  .char-counter-enhanced {
    font-size: 10px;
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Expandable Examples */
.examples-toggle {
  display: inline-block;
  color: #2D7D7D;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  padding: 6px 12px;
  background: #E5F4F4;
  border-radius: 4px;
  transition: all 0.2s ease;
  user-select: none;
  font-style: normal;
}

.examples-toggle:hover {
  background: #D1E8E8;
  transform: translateX(2px);
}

.examples-toggle::after {
  content: " ▼";
  font-size: 10px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.examples-toggle.expanded::after {
  transform: rotate(180deg);
}

.examples-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  margin-top: 0;
}

.examples-content.expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: 12px;
}

.examples-content-inner {
  font-style: normal;
  font-size: 13px;
  color: #6B7280;
  padding-left: 12px;
  border-left: 2px solid #E5F4F4;
  line-height: 1.6;
}

.examples-content-inner strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

/* =================================
   COLLAPSIBLE PHASE SECTIONS
   ================================= */

.phase-summary {
  background: linear-gradient(135deg, #E5F4F4, #F6F8F9);
  border: 2px solid #2D7D7D;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phase-summary:hover {
  background: linear-gradient(135deg, #D1E8E8, #E5F4F4);
  box-shadow: 0 2px 8px rgba(45, 125, 125, 0.15);
}

.phase-summary-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #2D7D7D;
}

.phase-summary-icon {
  font-size: 20px;
}

.phase-summary-toggle {
  color: #2D7D7D;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.3s ease;
}

.phase-summary.collapsed .phase-summary-toggle::after {
  content: " ▼";
}

.phase-summary.expanded .phase-summary-toggle::after {
  content: " ▲";
}

.phase-content {
  max-height: 10000px;
  overflow: visible;
  transition: max-height 0.5s ease, opacity 0.3s ease;
  opacity: 1;
}

.phase-content.collapsed {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

/* Mobile responsive for phase summaries */
@media (max-width: 768px) {
  .phase-summary {
    padding: 12px 15px;
  }
  
  .phase-summary-title {
    font-size: 14px;
    gap: 8px;
  }
  
  .phase-summary-icon {
    font-size: 18px;
  }
}

/* =================================
   COLLAPSIBLE SECTIONS (Phase 3)
   ================================= */

.section-collapsible {
  margin-bottom: 20px;
}

.section-collapsible .section-header {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
}

.section-collapsible .section-header:hover {
  background-color: #1E5A5A;
}

.section-collapsible .section-header::after {
  content: "▼";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  transition: transform 0.3s ease;
}

.section-collapsible.expanded .section-header::after {
  transform: translateY(-50%) rotate(180deg);
}

.section-collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.3s ease;
  opacity: 0;
}

.section-collapsible.expanded .section-collapsible-content {
  max-height: 5000px;
  opacity: 1;
}

/* Always show "Your Response" section expanded */
.section-collapsible.always-expanded .section-header {
  cursor: default;
}

.section-collapsible.always-expanded .section-header:hover {
  background-color: #2D7D7D;
}

.section-collapsible.always-expanded .section-header::after {
  display: none;
}

.section-collapsible.always-expanded .section-collapsible-content {
  max-height: none;
  opacity: 1;
  overflow: visible;
}
/* Print styles for new elements */
@media print {
  .info-badge,
  .preservation-notice,
  .optional-section-badge,
  .summary-badge,
  .time-estimate,
  .progress-indicator,
  .auto-save-indicator,
  .feature-grid {
    display: none !important;
  }
}