/* ============================================
   SLOT.CSS — Slot Machine Page Styles
   Lucky Draw Lottery Application
   ============================================ */

.slot-page {
  display: flex;
  min-height: 100vh;
  padding-top: 60px; /* for fixed header */
  overflow-x: hidden;
}

/* Left panel - slot machine area (65%) */
.slot-main {
  flex: 0 0 65%;
  max-width: 65%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  background: var(--bg-primary);
  transition: flex 0.3s ease, max-width 0.3s ease;
}

/* Right panel - sidebar (35%) */
.slot-sidebar {
  flex: 0 0 35%;
  max-width: 35%;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  position: sticky;
  top: 60px;
  overflow-y: auto;
  background: var(--bg-primary);
  transition: flex 0.3s ease, max-width 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

/* Sidebar collapsed state */
.sidebar-collapsed .slot-main {
  flex: 0 0 100%;
  max-width: 100%;
}

.sidebar-collapsed .slot-sidebar {
  flex: 0 0 0%;
  max-width: 0%;
  border-left-color: transparent;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

/* Entry count display */
.entry-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.entry-count-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Slot Machine Frame */
.slot-machine-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
}

.slot-machine {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: relative;
  box-sizing: border-box;
}

/* Gold decorative lights on the frame */
.slot-machine::before,
.slot-machine::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: pulse 1s infinite alternate;
}
.slot-machine::before { left: 24px; }
.slot-machine::after { right: 24px; }

.slot-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: 1px;
}

/* Slot Window Viewport */
.slot-window {
  --item-h: 100px; /* Responsive height */
  position: relative;
  height: calc(3 * var(--item-h));
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-sizing: border-box;
}

/* The Reel Container */
.slot-reel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* Slot Item */
.slot-item {
  height: var(--item-h);
  line-height: var(--item-h);
  text-align: center;
  font-family: 'Roboto Mono', monospace;
  font-size: 38px;
  font-weight: 700;
  color: var(--text-primary);
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 16px;
  transition: opacity 0.2s;
}

/* Fade out top and bottom rows using gradient overlays */
.slot-overlay {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--item-h);
  pointer-events: none;
  z-index: 10;
}

.slot-overlay-top {
  top: 0;
  background: linear-gradient(to bottom, 
    rgba(248, 248, 248, 0.95) 0%, 
    rgba(248, 248, 248, 0.6) 60%, 
    rgba(248, 248, 248, 0) 100%
  );
  border-bottom: 1px dashed rgba(0,0,0,0.03);
}

.slot-overlay-bottom {
  bottom: 0;
  background: linear-gradient(to top, 
    rgba(248, 248, 248, 0.95) 0%, 
    rgba(248, 248, 248, 0.6) 60%, 
    rgba(248, 248, 248, 0) 100%
  );
  border-top: 1px dashed rgba(0,0,0,0.03);
}

/* Middle Highlight Box */
.slot-highlight {
  position: absolute;
  top: var(--item-h);
  left: 8px;
  right: 8px;
  height: var(--item-h);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px rgba(212, 168, 83, 0.15), inset 0 0 10px rgba(212, 168, 83, 0.05);
  pointer-events: none;
  z-index: 15;
  box-sizing: border-box;
  animation: glow-pulse 2s infinite ease-in-out;
}

@keyframes glow-pulse {
  0% { border-color: var(--accent-gold); box-shadow: 0 0 10px rgba(212, 168, 83, 0.15); }
  50% { border-color: var(--accent-gold-dark); box-shadow: 0 0 20px rgba(212, 168, 83, 0.35); }
  100% { border-color: var(--accent-gold); box-shadow: 0 0 10px rgba(212, 168, 83, 0.15); }
}

/* Decorative side arrows pointing inwards */
.slot-highlight::before,
.slot-highlight::after {
  content: '▶';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--accent-gold-dark);
}
.slot-highlight::before {
  left: -20px;
  animation: bounce-right 0.8s infinite alternate;
}
.slot-highlight::after {
  right: -20px;
  transform: translateY(-50%) rotate(180deg);
  animation: bounce-left 0.8s infinite alternate;
}

@keyframes bounce-right {
  0% { transform: translateY(-50%) translateX(0); }
  100% { transform: translateY(-50%) translateX(4px); }
}
@keyframes bounce-left {
  0% { transform: translateY(-50%) rotate(180deg) translateX(0); }
  100% { transform: translateY(-50%) rotate(180deg) translateX(4px); }
}

/* Action button area */
.slot-spin-btn {
  margin-top: 32px;
  padding: 14px 48px;
  font-size: 18px;
}

/* Header style sharing */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  box-sizing: border-box;
}

.header-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 24px;
}

.header-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 18px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.header-link:hover {
  color: var(--text-primary);
}

.header-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* Responsiveness */
@media (max-width: 1024px) {
  .slot-page {
    flex-direction: column;
  }
  .slot-main {
    flex: auto;
    padding: 32px 16px;
  }
  .slot-sidebar {
    flex: auto;
    position: static;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
}

@media (max-width: 640px) {
  .slot-window {
    --item-h: 70px;
  }
  .slot-item {
    font-size: 26px;
  }
  .slot-machine {
    padding: 24px 16px;
  }
  .slot-highlight::before { left: -14px; font-size: 10px; }
  .slot-highlight::after { right: -14px; font-size: 10px; }
}
