/* Retro Button Styles - Modern Integration */
.retro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  border: none;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-align: center;
  position: relative;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
  overflow: hidden;
}

.retro-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.retro-btn:hover::before {
  width: 300px;
  height: 300px;
}

.retro-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Pagination Ellipsis */
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  color: #6b7280;
  font-weight: 500;
  user-select: none;
}

.dark .pagination-ellipsis {
  color: #9ca3af;
}
.dark .retro-btn {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.25);
}
.retro-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transform: translateY(0);
}
.dark .retro-btn:disabled {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1) !important;
}

.retro-btn:not([disabled]):active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.dark .retro-btn:not([disabled]):active {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
}

.retro-btn-indigo { 
  background: linear-gradient(135deg, #d946ef 0%, #c026d3 100%);
  color: white;
}
.retro-btn-indigo:hover:not([disabled]) { 
  background: linear-gradient(135deg, #e879f9 0%, #d946ef 100%);
  box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4), 0 2px 6px rgba(217, 70, 239, 0.2);
}

.retro-btn-green { 
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
}
.retro-btn-green:hover:not([disabled]) { 
  background: linear-gradient(135deg, #a3e635 0%, #84cc16 100%);
  box-shadow: 0 6px 20px rgba(132, 204, 22, 0.4), 0 2px 6px rgba(132, 204, 22, 0.2);
}

.retro-btn-blue { 
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: white;
}
.retro-btn-blue:hover:not([disabled]) { 
  background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 100%);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4), 0 2px 6px rgba(56, 189, 248, 0.2);
}

.retro-btn-gray { 
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  color: white;
}
.dark .retro-btn-gray { 
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}
.retro-btn-gray:hover:not([disabled]) { 
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  box-shadow: 0 6px 20px rgba(148, 163, 184, 0.4), 0 2px 6px rgba(148, 163, 184, 0.2);
}
.dark .retro-btn-gray:hover:not([disabled]) { 
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.retro-btn-red { 
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: white;
}
.retro-btn-red:hover:not([disabled]) { 
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4), 0 2px 6px rgba(244, 63, 94, 0.2);
}

/* Quiz options need a different shape */
.retro-option-btn {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 0.75rem; /* Rounded rectangle */
  font-weight: 500;
  border: 2px solid #111827; /* A dark border for depth */
  box-shadow: 0 4px 0 0 #111827; /* The 3D bottom edge */
  transition: all 0.1s ease-in-out;
  cursor: pointer;
  position: relative;
}
.retro-option-btn span {
  white-space: normal;
  word-break: break-word;
}

.dark .retro-option-btn {
  border-color: #000;
  box-shadow: 0 4px 0 0 #000;
}

.retro-option-btn:not([disabled]):active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 0 #111827; /* Remove shadow on click */
}

.dark .retro-option-btn:not([disabled]):active {
  box-shadow: 0 0px 0 0 #000;
}

.retro-option-btn:disabled {
  cursor: not-allowed;
  transform: translateY(0) !important;
  box-shadow: 0 4px 0 0 #111827 !important;
}
.dark .retro-option-btn:disabled {
  box-shadow: 0 4px 0 0 #000 !important;
}

.retro-option-btn:not([disabled]):hover {
  filter: brightness(110%);
}

/* Mobile Responsive Button Styles */
@media (max-width: 640px) {
  .retro-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    min-height: 2.5rem;
    width: 100%;
    max-width: 280px;
    margin: 0.25rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .retro-option-btn {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    margin: 0.375rem auto;
    text-align: center;
    justify-content: center;
    min-height: 3rem;
  }

  /* Improve button spacing in mobile menus */
  #mobile-auth-buttons .retro-btn,
  #mobile-menu .retro-btn {
    margin: 0.5rem auto;
    display: block;
    width: 90%;
    max-width: 260px;
  }
}

/* Additional fixes for very small screens */
@media (max-width: 390px) {
  .retro-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.875rem;
    max-width: 240px;
  }

  .retro-option-btn {
    font-size: 0.8rem;
    padding: 0.625rem 0.875rem;
  }
}
