/* Sign PDF Styles */

/* Step containers */
.step-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .step-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
  }
  
  /* Upload area */
  .upload-area {
    border: 2px dashed #FF9800;
    border-radius: 8px;
    background-color: #FFF8E1;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .upload-area:hover {
    background-color: #FFECB3;
  }
  
  .upload-area.active {
    background-color: #FFE082;
    border-color: #F57C00;
  }
  
  .upload-icon {
    margin-bottom: 15px;
    color: #FF9800;
  }
  
  .upload-area p {
    margin: 0;
    color: #555;
    font-size: 16px;
  }
  
  /* Signature options */
  .signature-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .option-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
  }
  
  .tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
  }
  
  .tab-button:hover {
    color: #FF9800;
  }
  
  .tab-button.active {
    color: #FF9800;
    border-bottom: 2px solid #FF9800;
  }
  
  .tab-content {
    padding: 20px 0;
  }
  
  /* Drawing canvas */
  .canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  #signatureCanvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: crosshair;
    max-width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }
  
  .canvas-controls {
    display: flex;
    gap: 10px;
  }
  
  /* Image upload */
  .image-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .upload-label {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
  }
  
  .upload-label:hover {
    background-color: #e0e0e0;
  }
  
  .image-preview {
    min-height: 150px;
    width: 100%;
    max-width: 500px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .image-preview img {
    max-width: 100%;
    max-height: 200px;
  }
  
  /* PDF preview */
  .pdf-preview-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .pdf-viewer {
    position: relative;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    height: 70vh;
    overflow: auto;
    display: flex;
    justify-content: center;
    border-radius: 4px;
  }
  
  #pdfCanvas {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
  }
  
  #signatureLayer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
  }
  
  .signature-placeholder {
    position: absolute;
    background-color: rgba(255, 152, 0, 0.05);
    border: 2px dashed #FF9800;
    cursor: move;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  
  .signature-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  /* Resize handles */
  .resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #FF9800;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
  }
  
  .resize-handle:hover {
    transform: scale(1.2);
  }
  
  .resize-handle.nw {
    top: -7px;
    left: -7px;
    cursor: nwse-resize;
  }
  
  .resize-handle.ne {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
  }
  
  .resize-handle.se {
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
  }
  
  .resize-handle.sw {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
  }
  
  /* Added mid-point handles for independent resizing */
  .resize-handle.n {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
    background-color: #2196F3;
  }
  
  .resize-handle.s {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
    background-color: #2196F3;
  }
  
  .resize-handle.e {
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
    background-color: #2196F3;
  }
  
  .resize-handle.w {
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
    background-color: #2196F3;
  }
  
  .resize-handle.n:hover, .resize-handle.s:hover, 
  .resize-handle.e:hover, .resize-handle.w:hover {
    transform: scale(1.2);
  }
  
  /* Help section for resize controls */
  .resize-help {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
  }
  
  .help-item {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  
  .help-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
  }
  
  .corner-handle {
    background-color: #FF9800;
    border: 1px solid white;
  }
  
  .side-handle {
    background-color: #2196F3;
    border: 1px solid white;
  }
  
  .aspect-icon {
    background-color: #2196F3;
    position: relative;
  }
  
  .aspect-icon:before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid white;
    top: 3px;
    left: 3px;
  }
  
  .delete-icon {
    background-color: #f44336;
    position: relative;
  }
  
  .delete-icon:before, .delete-icon:after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    background-color: white;
    top: 7px;
    left: 4px;
  }
  
  .delete-icon:before {
    transform: rotate(45deg);
  }
  
  .delete-icon:after {
    transform: rotate(-45deg);
  }
  
  /* Control buttons on signature */
  .signature-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
  }
  
  .signature-delete-btn:hover {
    background-color: #d32f2f;
    transform: scale(1.1);
  }
  
  .aspect-ratio-toggle {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background-color: #2196F3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
  }
  
  .aspect-ratio-toggle:hover {
    background-color: #1976D2;
    transform: scale(1.1);
  }
  
  .placement-instructions {
    text-align: center;
    margin-top: 20px;
  }
  
  .placement-instructions p {
    margin-bottom: 15px;
    color: #666;
    font-size: 16px;
  }
  
  /* Action buttons */
  .action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
  }
  
  /* Apply to all pages toggle button */
  .toggle-button {
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .toggle-button.active {
    background-color: #FF9800;
    color: white;
    border-color: #F57C00;
  }
  
  /* Success & Download */
  .success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
  }
  
  .success-message svg {
    color: #4CAF50;
  }
  
  /* Progress overlay */
  #progressOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  
  .progress-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 80%;
    max-width: 400px;
    text-align: center;
  }
  
  .progress-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
  }
  
  .progress-bar {
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
  }
  
  .progress {
    height: 100%;
    background-color: #FF9800;
    width: 0%;
    transition: width 0.3s ease;
  }
  
  /* Buttons */
  .action-button {
    padding: 10px 20px;
    background-color: #FF9800;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .action-button:hover {
    background-color: #F57C00;
  }
  
  .action-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
  }
  
  .secondary-button {
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .secondary-button:hover {
    background-color: #e0e0e0;
  }
  
  /* Responsive adjustments */
  @media (max-width: 768px) {
    .upload-area {
      padding: 30px 15px;
    }
    
    .pdf-viewer {
      height: 50vh;
    }
    
    #signatureCanvas {
      width: 100%;
      max-width: 400px;
      height: auto;
    }
    
    .pdf-controls {
      flex-direction: column;
      align-items: stretch;
    }
    
    .toggle-button {
      margin-top: 10px;
    }
    
    .action-buttons {
      flex-direction: column;
    }
    
    .resize-help {
      flex-direction: column;
      align-items: flex-start;
    }
  }