/* Conversion modal styles */
.conversion-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent; /* Remove dimming */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

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

.conversion-modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  border: 1px solid #e2e8f0; /* Add border */
  box-shadow: 0 4px 6px rgba(0,0,0,0.5); /* Add shadow */
}

.conversion-modal.active .conversion-modal-content {
  transform: translateY(0);
}

.dark-theme .conversion-modal-content {
  background: #1e293b;
  border-color: #334155; /* Dark theme border */
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 34px 10px 44px;
}

/* Search Container */
.search-container {
  padding: 15px 20px 0 24px;
  position: relative;
}

.format-search {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background-color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.format-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-color: white;
}

.dark-theme .format-search {
  background-color: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.dark-theme .format-search:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
  background-color: #1e293b;
}

/* Modal Body */
.modal-body {
  height: 400px; /* Fixed height */
  overflow-y: auto; /* Add scroll if content exceeds height */
  padding: 0 20px 20px;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 15px;
}

.tab-button {
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  position: relative;
}

.tab-button.active {
  color: #1e40af;
  font-weight: 500;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #1e40af;
}

.dark-theme .tab-button {
  color: #94a3b8;
}

.dark-theme .tab-button.active {
  color: #60a5fa;
}

.dark-theme .tab-button.active::after {
  background: #60a5fa;
}

/* Category Content */
.category-content {
  display: none;
}

.category-content.active {
  display: block;
}

/* Format Items */
.format-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

/* Format Tabs */
.format-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px 0 44px; /* Added left padding to match list items */
  margin-bottom: 15px;
}

.format-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  position: relative;
}

.format-tab.active {
  color: #3b82f6;
}

.format-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
}

.dark-theme .format-tab {
  color: #94a3b8;
}

.dark-theme .format-tab.active {
  color: #60a5fa;
}

.dark-theme .format-tab.active::after {
  background: #60a5fa;
}

/* Vertical Tab Layout */
.tab-container {
  display: flex;
  height: 100%;
}

.tab-bar.vertical {
  display: flex;
  flex-direction: column;
  width: 120px;
  border-right: 1px solid #e0e0e0;
}

.tab-button.vertical {
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tab-button.vertical.active {
  background-color: #f0f0f0;
  font-weight: bold;
}

.tab-content {
  flex: 1;
  padding: 0 16px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Format menu styles - consolidated */
.format-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px 20px 20px;
  margin: 0;
}

.format-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: 4px;
  background: #f8f8f8;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-bottom: 8px;
}

.format-item:hover {
  background: #f1f5f9;
}

.dark-theme .format-item {
  background: #1e293b;
}

.dark-theme .format-item:hover {
  background: #334155;
}

.format-extension {
  min-width: 80px;
  display: inline-block;
  font-weight: 600;
  color: #1a73e8;
}

.dark-theme .format-extension {
  color: #60a5fa;
}

.format-separator {
  color: #aaa;
  margin: 0 10px;
}

.format-description {
  color: #555;
  flex-grow: 1;
}

.dark-theme .format-description {
  color: #94a3b8;
}

/* Empty search state */
.empty-state {
  padding: 20px !important;
  text-align: center !important;
  color: #666 !important;
  font-style: italic;
}

.format-search-container {
  position: static;
  top: auto;
  z-index: auto;
  
  background: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  padding: 5px 0;
}

.format-search {
  width: calc(100% - 40px) !important;
  margin: 0 20px 15px 20px !important;
  box-sizing: border-box;
}

/* Prevent body scrolling when modal is open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Ensure modal content is scrollable */
.conversion-modal .conversion-modal-content {
  max-height: 100vh;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .conversion-modal {
    padding: 0;
    align-items: flex-start;
  }
  
  .conversion-modal-content {
    height: 100%;
    width: 100%;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  
  .modal-header, 
  .format-tabs {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 15px 20px 0;
  }
  
  .modal-header {
    padding-top: 40px; /* Space for mobile status bar */
  }
  
  .modal-body {
    padding: 15px 20px;
    height: calc(100vh - 180px); /* Adjust based on header/tabs height */
    overflow-y: auto;
  }
  
  .format-menu {
    height: 100%;
  }
  
  .search-container {
    padding: 15px 0 0 0;
  }

  .format-search {
    padding: 5px 8px;
    margin: 0 0 5px 0px;
  }
  .format-extension {
    width: 60px !important;
  }
  .format-tabs {
    padding: 10px 20px 0 20px;
  }
  .format-menu {
    padding: 5px 10px;
  }
  .format-item {
    padding: 15px 15px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .modal-header {
    padding: 5px 10px;
  }

  .modal-header h3 {
    white-space: nowrap;
    max-width: 50%;
  }

  .modal-body {
    height: 100%;
    padding: 0 0;
  }
  
  .format-extension {
    width: 60px !important;
    min-width: 60px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .format-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 5px; /* Space for scroll */
  }
  
  .format-tabs::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
  }
  
  .format-tab {
    flex: 0 0 auto; /* Prevent tabs from shrinking */
  }
}

@media (max-width: 300px) {
  .format-search {
    font-size: 10px;
  }
}