/* Custom styles for Fiber Permit AI */

/* Symbol PNG Icon Styles */
.symbol-icon-display {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.symbol-png-icon {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    flex-shrink: 0;
}

.symbol-na-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 200, 200, 0.3);
    border: 2px dashed #999;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
}

.symbol-name {
    font-size: 14px;
    font-weight: 400;
    color: #000;
    line-height: 1.3;
    text-transform: capitalize;
}

.symbol-description {
    font-size: 11px;
    font-weight: 300;
    color: #666;
    margin-top: 2px;
}

.symbol-meaning {
    font-size: 11px;
    font-weight: 300;
    color: #666 !important;
    margin-top: 2px;
}

/* Fiber Company Color Palette */
:root {
  /* Primary Blues - Professional & Trustworthy */
  --fiber-primary: #1e40af;      /* Deep blue for primary elements */
  --fiber-primary-dark: #1e3a8a; /* Darker blue for hover states */
  --fiber-primary-light: #3b82f6; /* Lighter blue for accents */
  
  /* Secondary Colors */
  --fiber-secondary: #374151;     /* Professional gray */
  --fiber-accent: #f97316;        /* Orange for CTAs and highlights */
  
  /* Success/Status Colors */
  --fiber-success: #10b981;       /* Green for success states */
  --fiber-warning: #f59e0b;       /* Amber for warnings */
  --fiber-danger: #ef4444;        /* Red for errors */
  
  /* Neutral Colors */
  --fiber-gray-50: #f9fafb;
  --fiber-gray-100: #f3f4f6;
  --fiber-gray-200: #e5e7eb;
  --fiber-gray-300: #d1d5db;
  --fiber-gray-400: #9ca3af;
  --fiber-gray-500: #6b7280;
  --fiber-gray-600: #4b5563;
  --fiber-gray-700: #374151;
  --fiber-gray-800: #1f2937;
  --fiber-gray-900: #111827;
  
  /* Text Colors */
  --fiber-text-primary: #ffffff;
  --fiber-text-secondary: #e5e7eb;
  --fiber-text-muted: #9ca3af;
  
  /* Background Colors */
  --fiber-bg-primary: #0f172a;
  --fiber-bg-secondary: #1e293b;
  --fiber-bg-tertiary: #334155;
}

/* Global Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--fiber-bg-primary) 0%, var(--fiber-bg-secondary) 100%);
  color: var(--fiber-text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* Navigation Styling */
.bg-fiber-primary {
  background: linear-gradient(135deg, var(--fiber-primary) 0%, var(--fiber-primary-dark) 100%) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 700;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--fiber-text-secondary);
  font-weight: 400;
  line-height: 1;
}

.text-fiber-accent {
  color: var(--fiber-accent) !important;
}

.nav-link {
  font-weight: 500;
  border-radius: 6px;
  margin: 0 2px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fiber-accent) !important;
}

/* Main Content */
.main-content {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* Results Page Specific Styling */
.results-header {
  background: linear-gradient(135deg, var(--fiber-primary) 0%, var(--fiber-primary-dark) 100%);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-icon {
  width: 60px;
  height: 60px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--fiber-success);
}

.status-icon i {
  width: 32px;
  height: 32px;
}

/* Summary Card */
.summary-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--fiber-gray-200);
  overflow: hidden;
}

.summary-card .card-body {
  color: var(--fiber-gray-800);
}

.summary-item {
  margin-bottom: 1rem;
}

.summary-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fiber-gray-600);
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fiber-gray-900);
}

.summary-value.text-primary {
  color: var(--fiber-primary) !important;
}

/* Confidence Score */
.confidence-score {
  text-align: center;
}

.confidence-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fiber-gray-600);
  margin-bottom: 0.5rem;
}

.confidence-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--fiber-success);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.confidence-bar {
  width: 100%;
  height: 8px;
  background: var(--fiber-gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fiber-success) 0%, var(--fiber-primary-light) 100%);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Action Buttons */
.action-buttons .btn {
  font-weight: 600;
  border-radius: 8px;
  border: none;
  padding: 0.875rem 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--fiber-primary) 0%, var(--fiber-primary-light) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--fiber-primary-dark) 0%, var(--fiber-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
  color: white;
}

.btn-outline-primary {
  border: 2px solid var(--fiber-primary);
  color: var(--fiber-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--fiber-primary);
  color: white;
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--fiber-accent) 0%, #ea580c 100%);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  transform: translateY(-1px);
  color: white;
}

/* Cards */
.card {
  background: white;
  border: 1px solid var(--fiber-gray-200);
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  color: var(--fiber-gray-800);
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.card-header {
  background: var(--fiber-gray-50);
  border-bottom: 1px solid var(--fiber-gray-200);
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--fiber-gray-800);
}

.card-body {
  padding: 1.5rem;
}

/* Contact Information */
.contact-info {
  color: var(--fiber-gray-700);
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.contact-item i {
  width: 16px;
  height: 16px;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--fiber-gray-700);
}

.checklist-item i {
  width: 16px;
  height: 16px;
}

/* Modal Styling */
.modal-content {
  background: white;
  border: none;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  background: var(--fiber-gray-50);
  border-bottom: 1px solid var(--fiber-gray-200);
  border-radius: 12px 12px 0 0;
  padding: 1.5rem;
}

.modal-title {
  font-weight: 600;
  color: var(--fiber-gray-900);
}

.modal-body {
  padding: 2rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  background: var(--fiber-gray-50);
  border-top: 1px solid var(--fiber-gray-200);
  border-radius: 0 0 12px 12px;
  padding: 1.5rem;
}

/* Permit Fields Styling */
.field-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fiber-gray-900);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--fiber-gray-200);
}

.field-item {
  margin-bottom: 1rem;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fiber-gray-700);
  margin-bottom: 0.5rem;
  display: block;
}

.field-value-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.field-value {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--fiber-gray-50);
  border: 1px solid var(--fiber-gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--fiber-gray-800);
  font-weight: 500;
}

.copy-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.copy-btn i {
  width: 16px;
  height: 16px;
}

.copy-btn:hover {
  transform: scale(1.05);
}

/* User Required Fields */
.user-required .field-value-container .form-control {
  border: 2px solid var(--fiber-warning);
  background: #fef3c7;
  color: var(--fiber-gray-800);
}

.user-required .field-value-container .form-control:focus {
  border-color: var(--fiber-accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.user-required .copy-btn {
  border: 2px solid var(--fiber-warning);
  color: var(--fiber-warning);
  background: #fef3c7;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
}

.toast-notification {
  background: white;
  color: var(--fiber-gray-800);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  border-left: 4px solid var(--fiber-success);
}

.toast-notification.toast-warning {
  border-left-color: var(--fiber-warning);
}

.toast-notification.show {
  transform: translateX(0);
}

.toast-notification i {
  width: 16px;
  height: 16px;
}

/* Badge Styling */
.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
}

.bg-primary {
  background: var(--fiber-primary) !important;
}

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--fiber-gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--fiber-primary) 0%, var(--fiber-primary-light) 100%);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Step numbering styling */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #6c757d;
  color: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.step-card[data-step] .card.border-warning .step-number {
  background-color: #ffc107;
  color: #000;
}

.step-card[data-step] .card.border-success .step-number {
  background-color: #198754;
  color: white;
}

.step-card[data-step] .card.border-danger .step-number {
  background-color: #dc3545;
  color: white;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--fiber-text-muted);
}

/* Form Controls */
.form-control {
  border-radius: 8px;
  border: 1px solid var(--fiber-gray-300);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  background: white;
  color: var(--fiber-gray-800);
}

.form-control:focus {
  border-color: var(--fiber-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
  background: white;
  color: var(--fiber-gray-800);
}

.form-control::placeholder {
  color: var(--fiber-gray-500);
}

/* Responsive Design */
@media (max-width: 768px) {
  .results-header {
    padding: 1.5rem;
  }
  
  .main-content {
    padding: 1rem 0;
  }
  
  .summary-card .card-body {
    padding: 1.5rem;
  }
  
  .action-buttons .btn {
    margin-bottom: 0.75rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .field-value-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .copy-btn {
    width: 100%;
    height: 40px;
  }
  
  .confidence-value {
    font-size: 2rem;
  }
  
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--fiber-gray-400);
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  .field-value {
    border: 2px solid var(--fiber-gray-400);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Theme Overrides for Forms in Modal */
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
  background: white !important;
  color: var(--fiber-gray-800) !important;
}

[data-bs-theme="dark"] .modal-title {
  color: var(--fiber-gray-900) !important;
}

/* Print Styles */
@media print {
  .navbar,
  .footer,
  .action-buttons,
  .modal {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }
}

/* Sample Documents Styling */
.sample-card {
  transition: all 0.3s ease;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.sample-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-color: var(--fiber-primary-light) !important;
  background: rgba(255, 255, 255, 0.05);
}

.sample-card:active {
  transform: translateY(0);
}

.sample-card.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.sample-card h6 {
  color: var(--fiber-text-primary);
}

.sample-card .text-muted {
  color: var(--fiber-text-muted) !important;
}

.sample-card .badge {
  font-size: 0.75rem;
}

.use-sample-btn {
  transition: all 0.2s ease;
  border-color: var(--fiber-primary-light);
  color: var(--fiber-primary-light);
}

.use-sample-btn:hover {
  background-color: var(--fiber-primary-light);
  border-color: var(--fiber-primary-light);
  color: white;
  transform: scale(1.05);
}

/* Drag and drop styling */
.input-group.border-primary {
  border-color: var(--fiber-primary-light) !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.sample-file-label {
  border: 1px solid var(--fiber-success) !important;
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: var(--fiber-text-primary) !important;
}

.sample-file-label .btn-close {
  filter: invert(1);
}

/* Sample message styling */
.sample-message {
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: var(--fiber-text-primary) !important;
}

/* PDF Preview Modal Styling */
.modal-xl {
  max-width: 90vw;
}

#pdfPreviewModal .modal-content {
  background: var(--fiber-bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#pdfPreviewModal .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--fiber-bg-primary);
}

#pdfPreviewModal .modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--fiber-bg-primary);
}

#pdfPreviewModal .modal-title {
  color: var(--fiber-text-primary);
}

#pdfPreviewContainer {
  background: #f8f9fa;
  border-radius: 4px;
}

#pdfLoadingSpinner {
  background: var(--fiber-bg-secondary);
  color: var(--fiber-text-primary);
}

/* PDF Viewer Controls */
#pdfControls {
  background: #ffffff !important;
  border-bottom: 1px solid #dee2e6 !important;
}

#pdfControls .btn {
  font-size: 0.875rem;
}

#pdfCanvas {
  max-width: 100%;
  height: auto;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 4px;
}

#pdfCanvasContainer {
  background: #f8f9fa;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PDF Controls styling */
#pdfControls span {
  font-weight: 500;
  color: #495057;
}

#zoomLevel {
  min-width: 50px;
  text-align: center;
  font-weight: 500;
}

/* Sample card click feedback */
.sample-card {
  position: relative;
}

.sample-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(59, 130, 246, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
  pointer-events: none;
}

.sample-card:hover::after {
  opacity: 1;
}

.sample-card:active {
  transform: translateY(1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sample-card {
    margin-bottom: 1rem;
  }
  
  .sample-card h6 {
    font-size: 1rem;
  }
  
  .sample-card .text-muted {
    font-size: 0.85rem;
  }
  
  .modal-xl {
    max-width: 95vw;
  }
  
  #pdfPreviewContainer {
    height: 60vh !important;
  }
}