/* Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  font-size: 12px;
  font-family: Arial, sans-serif;
}

#app {
  display: flex;
  height: 100%;
  width: 100%;
}

#loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.473); /* Semi-transparent background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Ensure it is on top of all other elements */
}

#loading-container img {
  width: 500px; /* Adjust size as needed */
  height: 500px; /* Adjust size as needed */
}

/* Left Container */
.left-container {
  position: relative;
  width: 12%;
  padding: 5px; /* Reduced padding */
  background-color: #f4f4f4;
  overflow-y: auto;
}

.search-container {
  display: flex;
  flex-direction: column;
  gap: 5px; /* Reduced gap */
  margin-bottom: 15px; /* Reduced margin */
}

.search-container input {
  padding: 8px; /* Reduced padding */
  font-size: 14px;
  width: 100%;
}

.photo-container {
  flex: 1;
  margin-bottom: 15px; /* Reduced margin */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ddd;
}

.product-header {
  margin-bottom: 8px; /* Reduced margin */
  padding: 8px; /* Reduced padding */
  background-color: #ccc;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

.product-info-container {
  flex: 2;
  overflow-y: auto;
}

/* Right Container */
.right-container {
  width: 67%;
  padding: 5px; /* Reduced padding */
  background-color: #ffffff;
  overflow-y: auto;
  display: flex;
  flex-direction: row;
  gap: 15px; /* Reduced gap */
  position: relative;
}

/* Routes and Profits Section */
#routes_and_profits {
  width: 25%; /* Adjusted width */
  padding: 8px; /* Reduced padding */
  background-color: #e4e4e4;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px; /* Reduced gap */
}

/* Scanned Value Route Box */
#scannedval_route {
  width: 100%;
  height: 100px;
  background-color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  color: white;
}

/* Profits Box */
#profits {
  width: 100%;
  background-color: #fff;
  padding: 8px; /* Reduced padding */
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

/* Current Stats Box */
#currentstats {
  width: 100%;
  background-color: #fff;
  padding: 8px; /* Reduced padding */
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  margin-top: 8px; /* Reduced margin */
}

/* Table Styling */
.stats-table-container {
  width: 100%;
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th, .stats-table td {
  padding: 10px 12px; /* Reduced padding */
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.stats-table th {
  background-color: #f4f4f4;
  font-weight: bold;
}

.stats-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.stats-table tr:hover {
  background-color: #f1f1f1;
}

#pricechartingdata {
  width: 100%;
  background-color: #fff;
  padding: 8px; /* Reduced padding */
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

/* Container for the two tables inside #pricechartingdata */
.pricecharting-tables-container {
  display: flex;
  gap: 8px; /* Reduced gap */
}

/* Each table container inside pricechartingdata */
.pricecharting-tables-container .stats-table-container {
  flex: 1;
  overflow-x: auto;
}

/* Table Styling */
.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th, .stats-table td {
  padding: 10px 12px; /* Reduced padding */
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.stats-table th {
  background-color: #f4f4f4;
  font-weight: bold;
}

.stats-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.stats-table tr:hover {
  background-color: #f1f1f1;
}

/* Historical Data Section */
#historical_data_section {
  width: 75%; /* Adjusted width */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Radar Chart Container */
#radar_chart_container {
  width: 100%;
  /* min-width: 400px; */
  height: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px; /* Reduced padding */
  background-color: #f9f9f9; 
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Radar Chart */
#radar_chart {
  width: 50%;
  height: 100%; /* Set a height for the chart */
}

/* Historical Data Table */
#historical_data_table {
  width: 50%;
  height: 94%;
  margin-top: 8px; /* Reduced margin */
  margin-bottom: 8px; /* Reduced margin */
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  padding: 8px; /* Reduced padding */
}

#pricecharts_container {
  width: 100%;
  height: 20%;
  margin-top: 15px;
  padding: 8px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

#pricecharts {
  width: 100%;
  height: 100%; /* Adjust as needed */
}

#offers {
  width: 100%;
  height: 20%;
  margin-top: 15px; /* Space above the offers table */
  padding: 8px; /* Padding inside the offers section */
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

#offers table {
  width: 100%;
  border-collapse: collapse;
}

#offers th, #offers td {
  padding: 10px 12px; /* Padding inside table cells */
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#offers th {
  background-color: #f4f4f4;
  font-weight: bold;
}

#offers tr:nth-child(even) {
  background-color: #f9f9f9;
}

#offers tr:hover {
  background-color: #f1f1f1;
}

#historical_data_table table {
  width: 100%;
  border-collapse: collapse;
}

#historical_data_table th, #historical_data_table td {
  padding: 6px 9px; /* Reduced padding */
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#historical_data_table th {
  background-color: #f4f4f4;
  font-weight: bold;
}

#historical_data_table tr:nth-child(even) {
  background-color: #f9f9f9;
}

#historical_data_table tr:hover {
  background-color: #f1f1f1;
}

#historical_data_table td:first-child {
  font-weight: bold;
}

/* Stats Table Styles */
.stats-table-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 15px; /* Reduced margin */
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th, .stats-table td {
  padding: 10px 12px; /* Reduced padding */
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.stats-table th {
  background-color: #f4f4f4;
  font-weight: bold;
}

.stats-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.stats-table tr:hover {
  background-color: #f1f1f1;
}

/* Offers Table Styles */
#offers {
  width: 100%;
  overflow-x: auto;
}

#offers table {
  width: 100%;
  border-collapse: collapse;
}

#offers th, #offers td {
  padding: 6px 9px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#offers th {
  background-color: #f4f4f4;
  font-weight: bold;
}

#offers tr:nth-child(even) {
  background-color: #f9f9f9;
}

#offers tr:hover {
  background-color: #f1f1f1;
}

#search2-results {
  position: absolute; /* Ensure it appears below the search bar */
  z-index: 9999; /* Make sure it appears on top of other content */
  background-color: white; /* Set the background color */
  border: 1px solid #ccc; /* Add a border */
  width: calc(100% - 20px); /* Match the width of the search input, adjust for padding */
  /* max-width: 400px;  */
  max-height: 500px; 
  overflow-y: auto; /* Add scroll if too many results */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Add a shadow for visibility */
  display: none; /* Initially hidden */
}

/* Style for individual dropdown items */
.dropdown-item {
  padding: 10px;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: #f1f1f1;
}

.result-thumbnail {
  width: 50px; /* Adjust the size as needed */
  height: 50px;
  margin-right: 10px;
  object-fit: cover; /* Ensures image covers the area without distortion */
  vertical-align: middle;
}

#historical_amazon_chart_container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px; /* Space between the two charts */
  padding: 8px; /* Padding around the container */
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  margin-top: 15px;
}

#historical_amazon_price_charts,
#historical_amazon_sr_offers_charts {
  width: 100%;
  height: 300px; /* Adjust the height as needed */
}

#historical_amazon_price_charts {
  /* Specific styling for price chart */
  background-color: #f9f9f9; 
  padding: 8px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#historical_amazon_sr_offers_charts {
  /* Specific styling for sales rank/offers chart */
  background-color: #f9f9f9; 
  padding: 8px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


@media (max-width: 768px) {
  /* Set the overall app container to column layout */
  #app {
    flex-direction: column;
    width: 100%;
  }

  /* Ensure each input, div, or container takes full width */
  #search1, 
  #search2, 
  #search2-results,
  .photo-container,
  .product-header,
  .product-info-container,
  #scannedval_route,
  #profits,
  #currentstats,
  #pricechartingdata,
  #radar_chart,
  #historical_data_table,
  #pricecharts,
  #historical_amazon_price_charts,
  #historical_amazon_sr_offers_charts {
    width: 100%;
    max-width: 100%; /* Ensure no element exceeds the screen width */
    margin-bottom: 15px; /* Add some spacing between elements */
    padding: 8px; /* Add padding for a cleaner look */
  }

  /* Additional adjustments for specific elements if necessary */
  #search2-results {
    max-height: 300px; /* Limit the dropdown height */
    overflow-y: auto; /* Scroll if too many results */
  }

  /* Specific styles for tables, charts, etc. */
  .photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #radar_chart, 
  #pricecharts, 
  #historical_amazon_price_charts,
  #historical_amazon_sr_offers_charts {
    height: auto;
    min-height: 300px; /* Ensure charts have some height */
  }
}

#lot_calculator {
  width: 21%; /* Take up 7% of the width */
  height: 100%; /* Take up the full height of the app */
  background-color: #f1f1f1; /* Optional background color */
  display: flex;
  flex-direction: column; /* Stack results on top of options */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Optional shadow for better visibility */
  padding: 5px;
  position: relative;
}

/* Style for lot_calculator_results (75% height with scroll) */
#lot_calculator_results {
  flex: 3; /* 75% of the height */
  overflow-y: auto; /* Allow scrolling if content exceeds height */
  background-color: #ffffff; /* Optional background color */
  padding: 10px; /* Optional padding */
  border-bottom: 1px solid #ddd; /* Optional border to separate from lot_calculator_options */
}

/* Style for lot_calculator_options (25% height) */
#lot_calculator_options {
  flex: 1; /* 25% of the height */
  background-color: #e4e4e4; /* Optional background color */
  padding: 10px; /* Optional padding */
}