/* 
 * DocFlow Connect - Modern UI Update
 * This CSS file provides a comprehensive UI update to create a more modern,
 * full-width, professional interface for the DocFlow Connect application.
 */

/* ===== MAIN LAYOUT STRUCTURE ===== */

/* Main container to use full width with proper padding */
#app-container {
    min-height: 100vh;
    width: 100%;
    background-color: #f8fafc; /* Light gray background for modern look */
    display: flex;
    flex-direction: column;
  }
  
  /* Header styling */
  #main-app > div:first-child {
    max-width: none !important; /* Remove max-width constraint */
    width: 100%;
    padding: 0 2rem;
    /* background: #fff; */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  /* App header with logo and user info */
  #main-app .flex.justify-between.items-center.mb-6 {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem 0;
    border-bottom: none;
  }
  
  /* Main content area */
  #main-app > div:first-child > div:not(:first-child) {
    max-width: 100% !important;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
  }
  
  /* Footer */
  #main-app .mt-8.text-center.text-sm.text-gray-500 {
    padding: 1.5rem 0;
    margin-top: 4rem !important;
    background-color: #fff;
    border-top: 1px solid #f0f0f0;
    width: 100%;
  }
  
  /* ===== CARDS AND CONTAINERS ===== */
  
  /* Section containers with shadow */
  .bg-white.shadow.overflow-hidden.sm\:rounded-lg.mb-6 {
    border-radius: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
    margin-bottom: 1.25rem !important;
  }
  
  /* Section headers */
  .bg-white.shadow.overflow-hidden.sm\:rounded-lg.mb-6 .px-4.py-5.sm\:px-6 {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
  }
  
  /* Section content */
  .bg-white.shadow.overflow-hidden.sm\:rounded-lg.mb-6 .border-t.border-gray-200.px-4.py-5.sm\:p-6 {
    padding: 1.5rem;
  }
  
  /* ===== PROJECTS SECTION ===== */
  
  /* Projects grid - more responsive */
  #projects-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1rem !important;
  }
  
  /* Project card */
  .project-card {
    border-radius: 0.5rem;
    border: 1px solid #eaecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    padding: 1.25rem !important;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  /* Selected project */
  .project-selected {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6, 0 3px 6px rgba(59, 130, 246, 0.1) !important;
  }
  
  /* ===== MANUALS SECTION ===== */
  
  /* Tabs navigation */
  .manual-tabs {
    background-color: #fff;
    border-bottom: none;
    margin-bottom: 0;
    /* padding: 0 1.5rem; */
  }
  
  .manual-tabs nav {
    gap: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .tab-button {
    padding: 1rem 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
  }
  
  .tab-button.tab-active, 
  .tab-button[aria-selected="true"], 
  #tab-all-manuals.text-blue-600 {
    color: #3b82f6;
    border-bottom: 2px solid #3b82f6;
  }
  
  .tab-button:hover:not(.tab-active) {
    color: #4b5563;
    border-bottom: 2px solid #e5e7eb;
  }
  
  /* Manuals grid - more responsive */
  #manuals-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 1rem !important;
  }
  
  /* Manual card */
  .manual-card {
    border-radius: 0.5rem;
    border: 1px solid #eaecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    padding: 1.25rem !important;
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
  }
  
  .manual-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
  }
  
  /* Selected manual */
  .manual-selected {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6, 0 3px 6px rgba(59, 130, 246, 0.1) !important;
  }
  
  /* Status badges */
  .badge-container {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
  }
  
  .badge-container span {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
  }
  
  /* ===== EXTRACTED PAGES SECTION ===== */
  
  /* Extracted pages container */
  #extracted-pages-container {
    margin-top: 1.5rem;
  }
  
  /* Page numbers display */
  #extracted-pages-numbers {
    padding: 0.75rem 1.5rem;
    background-color: #f9fafb;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
  }
  
  /* Pages grid - responsive */
  #extracted-pages-grid {
    padding: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 1rem !important;
  }
  
  /* Page card */
  .page-card {
    border-radius: 0.5rem;
    border: 1px solid #eaecef;
    overflow: hidden;
    transition: all 0.2s ease;
  }
  
  .page-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
  }
  
  .page-card-selected {
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6, 0 3px 6px rgba(59, 130, 246, 0.1) !important;
  }
  
  /* Preview buttons */
  .view-pdf-btn, .view-markdown-btn {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
  }
  
  .page-card:hover .view-pdf-btn,
  .page-card:hover .view-markdown-btn {
    opacity: 1;
    transform: scale(1);
  }
  
  /* ===== WORKFLOW ACTIONS SECTION ===== */
  
  #workflow-actions-container {
    margin-top: 1.5rem;
  }
  
  /* Workflow buttons */
  #workflow-actions-container .grid button {
    padding: 0.75rem 1rem;
    font-weight: 500;
    transform: translateY(0);
    transition: all 0.2s ease;
  }
  
  #workflow-actions-container .grid button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  /* ===== EXCEL FILES SECTION ===== */
  
  #excel-files-container {
    margin-top: 1.5rem;
  }
  
  /* Excel files grid */
  #excel-files-list {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 0.75rem !important;
  }
  
  /* Master excel card */
  #master-excel-card {
    transition: all 0.2s ease;
  }
  
  #master-excel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  }
  
  /* ===== MODALS ===== */
  
  /* Modal styling */
  .fixed.inset-0.z-50.overflow-y-auto {
    background-color: rgba(0, 0, 0, 0.5);
  }
  
  /* Modal content */
  .inline-block.align-bottom.bg-white.rounded-lg.text-left.overflow-hidden.shadow-xl.transform.transition-all.sm\:my-8.sm\:align-middle {
    border-radius: 0.5rem;
    max-width: 90% !important;
    width: auto !important;
  }
  
  /* Modal header */
  .bg-white.px-4.pt-5.pb-4.sm\:p-6.sm\:pb-4 {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
  }
  
  /* Modal footer */
  .bg-gray-50.px-4.py-3.sm\:px-6.sm\:flex.sm\:flex-row-reverse {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
  }
  
  /* Buttons in modals */
  .modal-btn, 
  .bg-gray-50.px-4.py-3.sm\:px-6.sm\:flex.sm\:flex-row-reverse button {
    font-weight: 500;
    transform: translateY(0);
    transition: all 0.2s ease;
  }
  
  .modal-btn:hover,
  .bg-gray-50.px-4.py-3.sm\:px-6.sm\:flex.sm\:flex-row-reverse button:hover {
    transform: translateY(-1px);
  }
  
  /* ===== FORM ELEMENTS ===== */
  
  /* Input styling */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea {
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
  }
  
  input[type="text"]:focus,
  input[type="email"]:focus,
  input[type="password"]:focus,
  textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }
  
  /* Checkbox styling */
  input[type="checkbox"] {
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
  }
  
  /* ===== BUTTONS ===== */
  
  /* Primary button */
  .bg-blue-600 {
    background-color: #2563eb;
  }
  
  .bg-blue-600:hover {
    background-color: #1d4ed8;
  }
  
  /* Secondary button */
  .bg-gray-50.px-4.py-3.sm\:px-6.sm\:flex.sm\:flex-row-reverse button:not(.bg-blue-600) {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #4b5563;
  }
  
  .bg-gray-50.px-4.py-3.sm\:px-6.sm\:flex.sm\:flex-row-reverse button:not(.bg-blue-600):hover {
    background-color: #f3f4f6;
  }

  .no-left-padding {
    padding-left: 0 !important;
  }
  
  /* ===== NOTIFICATIONS ===== */
  
  /* Notification styling */
  #notification {
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(0);
    animation: notification-slide-in 0.3s ease forwards;
  }
  
  @keyframes notification-slide-in {
    0% {
      transform: translateY(20px);
      opacity: 0;
    }
    100% {
      transform: translateY(0);
      opacity: 1;
    }
  }
  
  /* ===== RESPONSIVE ADJUSTMENTS ===== */
  
  /* Mobile adjustments */
  @media (max-width: 640px) {
    #main-app > div:first-child {
      padding: 0 1rem;
    }
    
    #main-app > div:first-child > div:not(:first-child) {
      padding: 0 1rem;
    }
    
    .manual-tabs {
      padding: 0;
    }
    
    .bg-white.shadow.overflow-hidden.sm\:rounded-lg.mb-6 .px-4.py-5.sm\:px-6,
    .bg-white.shadow.overflow-hidden.sm\:rounded-lg.mb-6 .border-t.border-gray-200.px-4.py-5.sm\:p-6 {
      padding: 1rem;
    }
    
    #extracted-pages-grid,
    #excel-files-list,
    #manuals-list,
    #projects-list {
      grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)) !important;
    }
  }
  
  /* Small tablets */
  @media (min-width: 641px) and (max-width: 768px) {
    #manuals-list,
    #projects-list {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
    
    #extracted-pages-grid {
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    }
    
    #excel-files-list {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }
  }
  
  /* Tablets and small laptops */
  @media (min-width: 769px) and (max-width: 1024px) {
    #manuals-list,
    #projects-list {
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }
    
    #extracted-pages-grid {
      grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    }
  }
  
  /* Large screens */
  @media (min-width: 1536px) {
    #main-app > div:first-child > div:not(:first-child) {
      padding: 0 4rem;
    }
  }