/* app/assets/stylesheets/design_edit_tabs.css */
/* Styles for the tabbed edit interface */

/* Main container */
.design-edit-tabs {
    margin-bottom: 2rem;
  }
  
  /* Tab Navigation - more specific to avoid conflicts */
  .design-edit-tabs .tab-nav {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1rem;
  }
  
  .design-edit-tabs .tab-nav-item {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .design-edit-tabs .tab-nav-item:hover {
    color: #495057;
  }
  
  .design-edit-tabs .tab-nav-item.active {
    color: #007bff;
    border-bottom-color: #007bff;
  }
  
  .design-edit-tabs .tab-nav-item i {
    margin-right: 0.5rem;
  }
  
  /* Tab Panes */
  .design-edit-tabs .tab-content .tab-pane {
    display: none;
    padding: 1.5rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }
  
  .design-edit-tabs .tab-content .tab-pane.active {
    display: block;
  }
  
  .design-edit-tabs .tab-pane-content {
    max-width: 1000px;
  }
  
  .design-edit-tabs .tab-pane-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
  }
  
  .design-edit-tabs .tab-pane-content .tab-description {
    color: #6c757d;
    margin-bottom: 2rem;
  }
  
  /* Form Actions - more specific selector to avoid conflicts */
  .design-edit-tabs .form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
  }
  
  .design-edit-tabs .left-actions {
    display: flex;
    gap: 0.5rem;
  }
  
  .design-edit-tabs .right-actions {
    display: flex;
    gap: 0.5rem;
  }
  
  /* Admin Badge */
  .design-edit-tabs .admin-badge {
    margin-top: 0.5rem;
  }
  
  .design-edit-tabs .admin-badge .badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: #ffc107;
    color: #212529;
  }
  
  /* File Tab Specific Styles */
  .design-edit-tabs .current-file-preview {
    display: flex;
    margin-bottom: 2rem;
  }
  
  .design-edit-tabs .file-preview {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    background: #f8f9fa;
  }
  
  .design-edit-tabs .file-info {
    margin-left: 1.5rem;
  }
  
  .design-edit-tabs .file-metadata > div {
    margin-bottom: 0.5rem;
  }
  
  /* Scale Preview - highly specific selectors to avoid conflicts */
  .design-edit-tabs .scale-preview {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    overflow: hidden;
  }
  
  .design-edit-tabs .scale-preview canvas {
    width: 100%;
    height: auto;
    display: block;
  }
  
  /* Scale Controls */
  .design-edit-tabs .scale-inputs {
    max-width: 600px;
    margin: 0 auto;
  }
  
  .design-edit-tabs .scale-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
  }
  
  .design-edit-tabs .scale-readout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
  }
  
  .design-edit-tabs .scale-percent {
    font-weight: 600;
    font-size: 1.2rem;
  }
  
  .design-edit-tabs .dpi-readout {
    color: #6c757d;
  }
  
  .design-edit-tabs .dpi-warning {
    color: #dc3545;
    font-size: 0.9rem;
  }
  
  /* Placeholder for development phases */
  .design-edit-tabs .coming-soon {
    color: #6c757d;
    font-style: italic;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px dashed #dee2e6;
  }
  
  /* Segmented control styles - different from upload steps */
  .design-edit-tabs .segmented {
    display: flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
  }
  
  .design-edit-tabs .segmented-item {
    flex: 1;
    position: relative;
  }
  
  .design-edit-tabs .segmented-item input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
  }
  
  .design-edit-tabs .segmented-item span {
    display: block;
    padding: 0.5rem 1rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.2s;
    border-right: 1px solid #dee2e6;
  }
  
  .design-edit-tabs .segmented-item:last-child span {
    border-right: none;
  }
  
  .design-edit-tabs .segmented-item input:checked + span {
    background: #007bff;
    color: white;
  }

  /* Form Grid Layout */
  .design-edit-tabs .form-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
  }

  /* Preview Column */
  .design-edit-tabs .preview-column {
    position: sticky;
    top: 2rem;
    align-self: start;
  }

  .design-edit-tabs .design-preview-container {
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f8f9fa;
    text-align: center;
  }

  .design-edit-tabs .design-preview-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
  }

  .design-edit-tabs .design-thumbnail-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-weight: 500;
  }

  /* File Details Panel */
  .design-edit-tabs .file-details-panel {
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    overflow: hidden;
  }

  .design-edit-tabs .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
  }

  .design-edit-tabs .panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
  }

  .design-edit-tabs .panel-toggle {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
  }

  .design-edit-tabs .panel-content {
    padding: 1rem;
  }

  .design-edit-tabs .file-info-row {
    display: flex;
    margin-bottom: 0.5rem;
  }

  .design-edit-tabs .info-label {
    flex: 0 0 100px;
    font-weight: 500;
    color: #495057;
  }

  .design-edit-tabs .info-value {
    color: #6c757d;
  }

  /* Form Fields */
  .design-edit-tabs .label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }

  .design-edit-tabs .btn-generate-ai {
    background-color: #7952b3;
    border-color: #7952b3;
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
  }

  .design-edit-tabs .btn-generate-ai:hover {
    background-color: #673ab7;
    border-color: #673ab7;
  }

  /* Form Sections */
  .design-edit-tabs .form-section {
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    overflow: hidden;
  }

  .design-edit-tabs .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
  }

  .design-edit-tabs .section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
  }

  .design-edit-tabs .section-toggle {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
  }

  .design-edit-tabs .section-content {
    padding: 1rem;
  }

  /* Form Rows */
  .design-edit-tabs .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  /* Form Link */
  .design-edit-tabs .form-link {
    display: inline-block;
    font-size: 0.875rem;
    color: #007bff;
    margin-top: 0.25rem;
  }

  /* Exclusive Checkbox */
  .design-edit-tabs .exclusive-checkbox {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .design-edit-tabs .tab-content {
    display: block !important; /* Ensure tab content container is always visible */
  }
  
  .design-edit-tabs .tab-pane {
    display: none; /* Hide all tab panes by default */
  }
  
  .design-edit-tabs .tab-pane.active {
    display: block !important; /* Force active tab to be visible with !important */
  }
  
  /* Fix for margin-bottom to ensure proper spacing */
  .tab-nav {
    margin-bottom: 1.5rem !important;
  }
  
  /* Fix for incorrect form-grid layout */
  .design-edit-tabs .form-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
  }

  /* Zoom Modal */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .modal-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .zoom-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: transparent;
  }

  .zoom-container img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  }

  .close-zoom {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
    line-height: 1;
    padding: 0;
    transition: transform 0.2s;
  }

  .close-zoom:hover {
    transform: scale(1.1);
  }

  /* File Tab Specific Styles */
  .file-update-form .current-file-preview {
    display: flex;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #f8f9fa;
  }
  
  .file-update-form .file-preview {
    width: 300px; /* Increased from 150px to match details tab */
    height: auto; /* Changed from fixed height to auto to maintain aspect ratio */
    max-height: 300px; /* Added max-height to match details tab */
    object-fit: contain;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
  }
  
  .file-update-form .file-preview-placeholder {
    width: 300px; /* Increased from 150px */
    height: 300px; /* Increased from 150px */
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #adb5bd;
    font-size: 3rem;
  }
  
  .file-update-form .file-info {
    margin-left: 1.5rem;
    flex: 1;
  }

  .file-update-form .file-metadata > div {
    margin-bottom: 0.5rem;
  }

  .file-update-form .upload-section {
    margin: 2rem 0;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: white;
  }

  .file-update-form .file-preview-container {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
  }

  .file-update-form .new-file-preview {
    max-width: 100%;
    max-height: 300px;
    display: block;
    margin: 0 auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: white;
  }
  
  /* Responsive adjustments */
  @media (max-width: 768px) {
    .design-edit-tabs .current-file-preview {
      flex-direction: column;
    }
    
    .design-edit-tabs .file-info {
      margin-left: 0;
      margin-top: 1rem;
    }
    
    .design-edit-tabs .scale-readout {
      flex-direction: column;
      gap: 0.5rem;
    }

    .design-edit-tabs .form-grid {
      grid-template-columns: 1fr;
    }
    
    .design-edit-tabs .form-row {
      grid-template-columns: 1fr;
    }
  }
