/* Base styles are imported from base.css */

.pre-auction-active {
  overflow: hidden;
}

.display-container {
  width: 95%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px;
  text-align: center;
  padding-top: var(--header-height); /* Use padding instead of margin */
  height: 100vh; /* Full height */
  overflow-y: auto; /* Allow internal scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  transition: opacity 0.4s ease;
}

.pre-auction-panel {
  position: absolute;
  inset: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.98),
    rgba(15, 81, 50, 0.25)
  );
  border-radius: 18px;
  padding: 20px;
  border: 4px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.pre-auction-panel img {
  width: min(95%, 1500px);
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  border: 6px solid rgba(255, 255, 255, 0.9);
}

.pre-auction-panel[aria-hidden="false"] {
  display: flex;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 81, 50, 0.95) 0%,
    rgba(25, 135, 84, 0.9) 100%
  );
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 15px 20px;
  z-index: 1000;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 5px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.logo {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.title {
  color: #ffffff;
  font-size: 2.2em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  background: linear-gradient(45deg, #ffffff, #ffc107);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.2em;
  text-align: left;
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.developer-credit {
  font-size: 0.7rem;
  margin-top: 0;
  opacity: 0.7;
  font-weight: 300;
  text-align: left;
  color: #fff;
}

#auction-display {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  height: 100%;
  overflow: hidden;
}

.auction-live-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 70% 30%;
  gap: 20px;
  width: 100%;
  height: 100%;
  align-items: stretch;
}

.auction-live-content[aria-hidden="true"] {
  display: none;
}

.item-image {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 15px;
  padding: 10px;
  width: 100%;
  height: 100%;
  border: 1px solid #eee;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative; /* Added for overlay positioning */
  aspect-ratio: 4/3; /* Maintain aspect ratio */
}

.sold-overlay {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: clamp(2rem, 8vw, 5rem); /* Responsive font size */
  font-weight: 800;
  color: #dc3545;
  border: 8px solid #dc3545;
  padding: 10px 40px;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 5px;
}

.item-image img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  border: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.item-image img:hover {
  transform: scale(1.02);
}

.item-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 20px;
}

#item-name {
  font-size: 2rem;
  color: #333;
  margin: 0;
  border-bottom: 3px solid var(--secondary-color);
  padding-bottom: 10px;
  display: inline-block;
  align-self: center;
}

.price-box {
  background: #fff;
  border: 2px solid var(--secondary-color);
  color: #333;
  padding: 10px;
  border-radius: 12px;
  margin: 0 auto;
  width: 80%;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.price-box .label {
  display: block;
  font-size: 1.5em; /* Increased from 1em */
  margin-bottom: 5px;
  color: #666;
  font-weight: 500;
}

.price-box .price {
  font-size: clamp(4rem, 12vw, 8rem); /* Significantly increased size */
  font-weight: 800;
  color: var(--primary-color);
  display: block;
  line-height: 1.1;
  margin: 10px 0;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.price-box .currency {
  font-size: 1.5em; /* Increased from 1em */
  color: #666;
  margin-top: 5px;
  display: inline-block;
  font-weight: 500;
}

.start-price-display {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 5px;
  font-weight: 500;
}

.start-price-display span {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.3rem;
}

.history-box {
  background: #fff;
  padding: 15px;
  border-radius: 15px;
  flex-grow: 1;
  border: 1px solid #eee;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Contain scrollbar */
}

.history-box h3 {
  margin-top: 0;
  color: #495057;
  font-size: 1.2rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
  margin-bottom: 15px;
  flex-shrink: 0;
  text-align: center;
}

.history-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 5px;
}

/* Custom Scrollbar for History */
.history-box ul::-webkit-scrollbar {
  width: 6px;
}

.history-box ul::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.history-box ul::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.history-box ul::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.history-box li {
  padding: 10px;
  border-bottom: 1px solid #e9ecef;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  margin-bottom: 6px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s;
}

.history-box li:first-child {
  background-color: #e8f5e9;
  border-left: 5px solid var(--primary-color);
  font-weight: bold;
  transform: scale(1.02);
}

.history-box li:hover {
  transform: translateX(5px);
}

/* Responsive Design Improvements */

@media (max-width: 1366px) {
  .display-container {
    margin-top: 140px;
    height: calc(100vh - 160px);
  }

  .title {
    font-size: 1.8em;
  }

  .logo {
    height: 60px;
  }
}

@media (max-width: 1024px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    padding-bottom: 20px;
  }

  .display-container {
    width: 95%;
    margin-top: 120px;
    height: auto;
    overflow: visible;
    padding-bottom: 20px;
  }

  #auction-display {
    padding: 20px;
  }

  .auction-live-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    height: auto;
  }

  .item-image {
    height: 400px; /* Fixed height for tablet */
  }

  .item-image img {
    max-height: 100%;
    width: auto;
  }

  .item-info {
    height: auto;
    gap: 15px;
  }

  .price-box {
    width: 60%;
  }
}

@media (max-width: 768px) {
  .display-container {
    width: 100%;
    padding: 10px;
    margin-top: 110px;
  }

  .header {
    padding: 10px 15px;
  }

  .header-content {
    gap: 10px;
  }

  .logo {
    height: 50px;
  }

  .title {
    font-size: 1.4em;
  }

  .subtitle {
    font-size: 0.9em;
    display: none; /* Hide subtitle on mobile to save space */
  }

  .developer-credit {
    display: none; /* Hide credit on mobile */
  }

  #auction-display {
    padding: 15px;
  }

  .auction-live-content {
    gap: 15px;
  }

  .item-image {
    height: 300px;
  }

  #item-name {
    font-size: 1.5rem;
  }

  .price-box {
    width: 100%;
    padding: 15px;
  }

  .price-box .price {
    font-size: 2.5em;
  }

  .history-box {
    max-height: 300px;
  }
}

@media (max-width: 480px) {
  .display-container {
    margin-top: 100px;
  }

  .header-content {
    flex-direction: row; /* Keep logo and text side by side */
    text-align: left;
  }

  .title {
    font-size: 1.1em;
    line-height: 1.3;
  }

  .item-image {
    height: 250px;
    padding: 5px;
  }

  .sold-overlay {
    font-size: 3rem;
    padding: 5px 20px;
    border-width: 5px;
  }

  #item-name {
    font-size: 1.3rem;
  }

  .start-price-display {
    font-size: 1rem;
  }

  .start-price-display span {
    font-size: 1.1rem;
  }

  .price-box .label {
    font-size: 0.9em;
  }

  .price-box .price {
    font-size: 2em;
  }

  .history-box h3 {
    font-size: 1.1rem;
  }

  .history-box li {
    font-size: 0.85rem;
    padding: 8px;
  }
}
