/* Auction Layout */
.auction-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Lots Panel */
.lots-panel {
  background: var(--bg-card);
  border: 2px solid var(--neon-purple);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.panel-header h2 {
  font-family: var(--font-main);
  font-size: 1.2rem;
  color: var(--neon-cyan);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.lots-table-container {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
  margin-bottom: 1rem;
}

.lots-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
}

.lots-table th,
.lots-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lots-table th {
  background: rgba(0, 245, 255, 0.1);
  color: var(--neon-cyan);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  position: sticky;
  top: 0;
}

.lots-table tbody tr:hover {
  background: rgba(255, 0, 110, 0.1);
}

.lots-table .empty-row td {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 2rem;
}

.lot-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Actions cell - relative positioning for menu */
.actions-cell {
  position: relative;
}

.lot-actions-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.2rem;
}

/* Menu positioned next to button */
.lot-actions-menu {
  position: absolute;
  right: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--neon-purple);
  border-radius: 4px;
  z-index: 100;
  display: none;
  min-width: 150px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.lot-actions-menu.active {
  display: block;
}

.lot-actions-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  white-space: nowrap;
}

.lot-actions-menu button:hover {
  background: rgba(255, 0, 110, 0.2);
}

.lot-actions-menu button svg {
  width: 16px;
  height: 16px;
}

/* Lots Controls */
.lots-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lots-controls-left,
.lots-controls-right {
  display: flex;
  gap: 0.5rem;
}

.new-lot-btn {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border: none;
  padding: 0.75rem 1.5rem;
  color: white;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
}

.new-lot-btn:hover {
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.5);
  transform: translateY(-2px);
}

.icon-btn {
  background: rgba(50, 50, 80, 0.8);
  border: 2px solid var(--neon-purple);
  padding: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  border-color: var(--neon-pink);
  background: rgba(255, 0, 110, 0.2);
}

.delete-all-btn:hover {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.2);
}

/* Right Panel */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Timer Panel - Compact */
.timer-panel {
  background: var(--bg-card);
  border: 2px solid var(--neon-purple);
  padding: 1rem;
}

/* Timer with fixed-width segments */
.timer-display {
  font-family: var(--font-main);
  font-size: 2.5rem;
  text-align: center;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px var(--neon-cyan);
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.timer-segment {
  display: inline-block;
  width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-colon {
  display: inline-block;
  width: 0.5ch;
  text-align: center;
}

.timer-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.timer-btn {
  background: rgba(50, 50, 80, 0.8);
  border: 2px solid var(--neon-purple);
  padding: 0.6rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.8rem;
}

.timer-btn:hover {
  border-color: var(--neon-pink);
}

.timer-btn.play-btn {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
}

.timer-btn.play-btn.active {
  background: linear-gradient(135deg, #ff4444, #aa0000);
}

/* Cards Panel - Expanded */
.cards-panel {
  background: var(--bg-card);
  border: 2px solid var(--neon-purple);
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 350px;
}

.auction-cards-container {
  flex: 1;
  height: 280px;
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  align-content: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.empty-cards {
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  width: 100%;
  align-self: center;
}

/* Auction Card */
.auction-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--font-main);
  font-weight: 900;
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.auction-card:hover {
  transform: scale(1.08);
  z-index: 10;
}

.auction-card.highlight {
  animation: cardHighlight 0.15s ease;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

.auction-card.eliminated {
  animation: cardEliminate 0.5s ease forwards;
}

.auction-card.winner-glow {
  animation: winnerGlow 0.5s ease infinite alternate;
}

@keyframes cardHighlight {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes cardEliminate {
  0% { opacity: 1; transform: scale(1) rotateY(0deg); }
  50% { transform: scale(1.1) rotateY(90deg); }
  100% { opacity: 0; transform: scale(0) rotateY(180deg); }
}

@keyframes winnerGlow {
  from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
  to { box-shadow: 0 0 40px rgba(255, 215, 0, 1); }
}

/* Eliminated name overlay animation */
.eliminated-name-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1500;
  pointer-events: none;
}

.eliminated-name-text {
  font-family: var(--font-main);
  font-size: 3rem;
  font-weight: 900;
  color: #ff4444;
  text-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
  animation: fadeOutUp 0.6s ease forwards;
}

@keyframes fadeOutUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(0.8);
  }
}

/* Raffle Controls */
.raffle-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.interval-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.interval-control input {
  width: 55px;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--neon-purple);
  color: var(--text-primary);
  text-align: center;
}

.raffle-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border: none;
  padding: 0.8rem;
  color: white;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.raffle-btn:hover {
  box-shadow: 0 0 25px rgba(0, 245, 255, 0.5);
}

.raffle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid var(--neon-purple);
  padding: 2rem;
  min-width: 300px;
  max-width: 400px;
}

.modal-content h3 {
  font-family: var(--font-main);
  color: var(--neon-cyan);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.modal-content input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--neon-purple);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.cancel-btn {
  background: rgba(100, 100, 100, 0.5);
  color: white;
}

.confirm-btn {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  color: white;
}

/* Winner Modal */
.winner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.winner-modal.active {
  display: flex;
}

.winner-content {
  text-align: center;
  animation: winnerPop 0.5s ease;
}

.winner-content h2 {
  font-family: var(--font-main);
  font-size: 2rem;
  color: var(--neon-cyan);
  margin-bottom: 1rem;
}

.winner-content .winner-name {
  font-family: var(--font-main);
  font-size: 3rem;
  color: var(--neon-pink);
  text-shadow: 0 0 30px var(--neon-pink);
  margin-bottom: 2rem;
}

.winner-content button {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border: none;
  padding: 1rem 3rem;
  color: white;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
}

@keyframes winnerPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Search highlight */
.lots-table tr.search-highlight {
  background: rgba(0, 245, 255, 0.3) !important;
}

/* Responsive */
@media (max-width: 900px) {
  .auction-layout {
    grid-template-columns: 1fr;
  }
  
  .right-panel {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .timer-panel,
  .cards-panel {
    flex: 1;
    min-width: 280px;
  }
}

@media (max-width: 600px) {
  .timer-display {
    font-size: 1.8rem;
  }
  
  .timer-controls {
    grid-template-columns: repeat(2, 1fr);
  }
}
