/**
 * DICE-ROLL-STYLES.CSS - Dice roll page specific styles
 * Based on classic-wheel-styles.css but adapted for dice
 */

/* ===== ROOT VARIABLES ===== */
:root {
  --dice-color: #ffffff;
}

/* ===== BODY & LAYOUT ===== */
body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* ===== CARD STYLES ===== */
.card {
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wheel-card-mobile .card-body {
  padding: 1rem 1.25rem;
}

.wheel-card-mobile .card-title {
  margin-bottom: 1rem !important;
}

/* ===== DICE CONTAINER ===== */
.spin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0;
}

.dice-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 1;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#diceContainer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#diceContainer canvas {
  max-width: 100%;
  max-height: 100%;
}

/* Reduce spacing in dice display section */
#diceRoll .text-center.mt-3 {
  margin-top: 0.5rem !important;
}

/* ===== SPIN MODE CARDS ===== */
.spin-mode-card {
  padding: 1rem;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
  text-decoration: none;
  color: inherit;
  display: block;
}

.spin-mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border-color: #0d6efd;
  text-decoration: none;
}

.spin-mode-card.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
}

.spin-mode-card.active .mode-title,
.spin-mode-card.active small {
  color: white !important;
}

.mode-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.mode-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

/* ===== PRESET CARDS ===== */
.preset-card {
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preset-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color) !important;
}

.preset-card:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.preset-card .preset-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
  line-height: 1;
}

.preset-card .preset-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  margin: 0;
  line-height: 1.3;
}

.preset-card:hover .preset-title {
  color: var(--primary-color);
}

/* ===== ADVANCED OPTIONS TOGGLE ===== */
.advanced-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  transition: all 0.2s ease;
}

.advanced-toggle:hover {
  transform: scale(1.05);
}

#advancedOptions {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

#advancedOptions.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
  color: var(--primary-color);
}

.btn-theme-color {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* ===== ACCORDION CUSTOMIZATION ===== */
.accordion-button:not(.collapsed) {
  background-color: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

/* ===== AD CONTAINER STYLES ===== */
.ad-container {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  position: relative;
}

.ad-container-middle {
  min-height: 150px;
  max-width: 100%;
}

.ad-label {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 10px;
  color: #6c757d;
  text-transform: uppercase;
}

/* ===== STICKY SIDE ADS ===== */
.sticky-ad-left,
.sticky-ad-right {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  z-index: 100;
  transition: all 0.3s ease;
}

.sticky-ad-left {
  left: 0;
}

.sticky-ad-right {
  right: 0;
}

.sticky-ad-left .ad-container,
.sticky-ad-right .ad-container {
  min-height: 600px;
  width: 160px;
}

.sticky-ad-left.collapsed {
  left: -150px;
}

.sticky-ad-right.collapsed {
  right: -150px;
}

.ad-close-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.ad-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* ===== BOTTOM STICKY AD ===== */
.bottom-sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
}

.bottom-sticky-ad .ad-container {
  min-height: 90px;
}

.bottom-sticky-ad.collapsed {
  bottom: -100%;
}

/* ===== THEME COLOR CLASSES ===== */
.theme-food { 
  --primary-color: #FF6F61; 
  --secondary-color: #FFD5CC; 
}

.theme-family { 
  --primary-color: #F6C947; 
  --secondary-color: #FFF2C5; 
}

.theme-kids { 
  --primary-color: #7ED6F3; 
  --secondary-color: #D6F6FF; 
}

.theme-classroom { 
  --primary-color: #667EEA; 
  --secondary-color: #DDE3FF; 
}

.theme-travel { 
  --primary-color: #4CAF50; 
  --secondary-color: #DFF5E1; 
}

.theme-home { 
  --primary-color: #B0BEC5; 
  --secondary-color: #ECEFF1; 
}

.theme-fitness { 
  --primary-color: #FF8A65; 
  --secondary-color: #FFDACC; 
}

.theme-games { 
  --primary-color: #9C27B0; 
  --secondary-color: #F3D1FA; 
}

.theme-gaming {
  --primary-color: #9C27B0;
  --secondary-color: #F3D1FA;
}

.theme-tasks { 
  --primary-color: #607D8B; 
  --secondary-color: #CFD8DC; 
}

.theme-lifestyle { 
  --primary-color: #8E44AD; 
  --secondary-color: #EEDDF8; 
}

.theme-fun { 
  --primary-color: #FF9800; 
  --secondary-color: #FFE0B2; 
}

.theme-creative {
  --primary-color: #667EEA;
  --secondary-color: #DDE3FF;
}

.theme-crypto {
  --primary-color: #f7931a;
  --secondary-color: #345d9d;
}

body[class*="theme-"] {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* ===== DICE ROLL BUTTON ===== */
.roll-center-btn {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 50px;
  border-radius: 25px;
  border: 2px solid #fff;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.roll-center-btn:hover:not(:disabled) {
  transform: translateX(-50%) scale(1.05);
}

.roll-center-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===== ITEMS CONTAINER (Fixed 6 items) ===== */
.items-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
}

.item-entry {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.32rem;
  background: white;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  align-items: start;
}

.item-entry input[type="text"] {
  flex: 1;
}

.item-entry select {
  width: 120px;
}

.item-entry input[type="file"] {
  font-size: 0.875rem;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1400px) {
  .sticky-ad-left,
  .sticky-ad-right {
    display: none;
  }
}

@media (max-width: 768px) {
  .bottom-sticky-ad {
    display: block;
  }

  .dice-wrapper {
    min-height: 300px;
  }

  .roll-center-btn {
    width: 100px;
    height: 45px;
    font-size: 0.9rem;
  }

  .item-entry {
    flex-direction: column;
  }

  .item-entry select {
    width: 100%;
  }

  .main-layout-row {
    display: flex;
    flex-direction: column;
  }

  /* Preserve gutter spacing for cards on mobile */
  .main-layout-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .advanced-toggle {
    position: static;
    margin-bottom: 1rem;
  }

  .preset-card .preset-emoji {
    font-size: 2rem;
  }

  .preset-card .preset-title {
    font-size: 0.75rem;
  }

  .mode-icon {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .dice-wrapper {
    min-height: 250px;
  }

  .roll-center-btn {
    width: 90px;
    height: 40px;
    font-size: 0.85rem;
  }
}

/* ===== FACE LABELS ===== */
.face-label {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

/* Disable add/remove buttons for dice (always 6 faces) */
.dice-fixed-faces .btn-add-item,
.dice-fixed-faces .btn-remove-item {
  display: none !important;
}
