/* Main Styles */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
}

.container {
  flex: 1;
}

/* PDF Viewer Styles */
#pdf-container {
  /* height:÷ 70vh; */
  overflow: auto;
  border: 1px solid #dee2e6;
  background-color: #e9ecef;
}

#pdf-viewer {
  display: block;
  margin: 0 auto;
  width: -webkit-fill-available;
}

/* Word document signature styles */
#word-signature-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
  z-index: 100;
}

/* Signature Field Styles */
.signature-field {
  position: absolute;
  border: 2px dashed #007bff;
  background-color: rgba(0, 123, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.signature-field span {
  color: #007bff;
  font-weight: bold;
  text-align: center;
  pointer-events: none;
}

/* Draggable Signature Styles */
.draggable-signature {
  position: absolute;
  cursor: move;
  z-index: 20;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.draggable-signature:hover {
  border: 2px solid #28a745;
}

.draggable-signature.dragging {
  opacity: 0.8;
  border: 2px dashed #28a745;
}

.draggable-signature img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.draggable-signature .signature-controls {
  position: absolute;
  top: -30px;
  right: 0;
  display: none;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 2px;
}

.draggable-signature:hover .signature-controls {
  display: flex;
}

/* Text field styles */
.draggable-text {
  min-width: 100px;
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px dashed #007bff;
  border-radius: 3px;
}

.draggable-text .text-content {
  font-family: Arial, sans-serif;
  color: #000;
  word-break: break-word;
}

/* Saved text container */
#saved-text {
  font-family: Arial, sans-serif;
  word-break: break-word;
  padding: 5px;
  border: 1px dashed #007bff;
  border-radius: 3px;
  background-color: #f8f9fa;
}

.signature-control-btn {
  border: none;
  background: none;
  font-size: 14px;
  padding: 2px 5px;
  color: #6c757d;
  cursor: pointer;
}

.signature-control-btn:hover {
  color: #dc3545;
}

.signature-field:hover {
  background-color: rgba(0, 123, 255, 0.2);
}

.signature-field.signed {
  border: 2px solid #28a745;
  background-color: transparent;
}

/* Signature Pad Styles */
#signature-pad {
  border: 1px solid #ced4da;
  background-color: #fff;
}

/* Footer Styles */
.footer {
  margin-top: auto;
}

/* AdSense & AMP Ad Styles */
.adsbygoogle,
amp-ad {
  display: block;
  margin: 20px 0;
}

.ad-container {
  text-align: center;
  margin: 20px 0;
  padding: 10px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}

.ad-container.horizontal {
  min-height: 90px;
}

.ad-container.square {
  min-height: 250px;
}

.ad-container.rectangle {
  min-height: 280px;
}

/* AMP Ad specific styles */
amp-ad {
  width: 100%;
  max-width: 100%;
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
  .display-4 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 1.75rem;
  }
  
  .display-6 {
    font-size: 1.5rem;
  }
  
  .lead {
    font-size: 1.1rem;
  }
  
  .card-body.p-5 {
    padding: 2rem !important;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .badge.fs-6 {
    font-size: 0.8rem !important;
  }
  
  /* Signature tools mobile optimization */
  .card-header h4 {
    font-size: 1.1rem;
  }
  
  .btn-group .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
  }
  
  /* Mobile ad sizing */
  .ad-container.rectangle {
    min-height: 200px;
  }
  
  .ad-container.square {
    min-height: 200px;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .display-4 {
    font-size: 1.75rem;
  }
  
  .btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
  
  /* Stack badges vertically on very small screens */
  .d-flex.flex-wrap.gap-3 {
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .badge {
    margin-bottom: 0.5rem;
  }
}

/* Performance Optimizations */
.card {
  will-change: transform;
}

.card:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease-in-out;
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Print Styles */
@media print {
  .navbar,
  .footer,
  .btn,
  .alert,
  .ad-container,
  .adsbygoogle,
  amp-ad {
    display: none !important;
  }
  
  .card {
    border: none !important;
    box-shadow: none !important;
  }
  
  body {
    background: white !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid #000;
  }
  
  .btn-primary {
    background-color: #000;
    border-color: #000;
  }
  
  .text-muted {
    color: #333 !important;
  }
}

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