/**
 * Modal Component Styles
 * Centralizes overlay, container, header, body, and success messaging
 * Extracted from legacy styles.css during Oct 2025 refactor
 */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(7, 6, 17, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 9000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.u-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  width: min(640px, 100%);
  max-height: min(85vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    155deg,
    rgba(16, 15, 28, 0.92) 0%,
    rgba(24, 23, 42, 0.85) 60%,
    rgba(30, 26, 45, 0.82) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(90, 55, 255, 0.35);
  position: relative;
  animation: modalEnter 0.28s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    160deg,
    rgba(109, 75, 255, 0.18) 0%,
    rgba(157, 118, 255, 0.12) 40%,
    rgba(212, 182, 255, 0.06) 100%
  );
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--text-color, #f7f3ff);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fdf6e3;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border 0.18s ease;
}

.modal-close:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 1.75rem 2rem 2.25rem;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
}

.modal-body::-webkit-scrollbar {
  width: 10px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(153, 118, 255, 0.8),
    rgba(245, 175, 255, 0.9)
  );
  border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(170, 135, 255, 0.95),
    rgba(255, 195, 255, 1)
  );
}

.modal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem 2.4rem;
  text-align: center;
  color: var(--text-color, #fdf6e3);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-overlay.modal-closing {
  animation: modalOverlayExit 0.32s ease forwards;
}

.modal-overlay.modal-closing .modal-content {
  animation: modalContentExit 0.32s ease forwards;
}

@keyframes modalOverlayExit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes modalContentExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
}

/* Development log content styling */
.version-block {
  background: rgba(139, 69, 19, 0.15);
  border: 1px solid #8b4513;
  border-radius: 18px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(245, 222, 179, 0.08);
}

.version-block:last-child {
  margin-bottom: 0;
}

.version-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.version-badge {
  background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
  color: #f5deb3;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid rgba(245, 222, 179, 0.3);
  letter-spacing: 0.02em;
}

.version-badge.in-progress {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1a0f08;
  animation: pulse-version 2s ease-in-out infinite;
}

@keyframes pulse-version {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0);
  }
}

.version-date {
  color: #d4a574;
  font-size: 0.88rem;
}

.version-highlights {
  color: #f5deb3;
  font-size: 0.94rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.change-category {
  margin-bottom: 1rem;
}

.change-category:last-child {
  margin-bottom: 0;
}

.category-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-title.features {
  color: #fbbf24;
}

.category-title.improvements {
  color: #60a5fa;
}

.category-title.fixes {
  color: #4ade80;
}

.category-title.breaking {
  color: #ef4444;
}

.category-title.documentation {
  color: #a78bfa;
}

.category-title.technical {
  color: #94a3b8;
}

.change-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.change-list li {
  color: #d4a574;
  padding: 0.35rem 0 0.35rem 1.2rem;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.6;
}

.change-list li::before {
  content: "•";
  position: absolute;
  left: 0.4rem;
  color: inherit;
}

.roadmap-section {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.roadmap-title {
  color: #93c5fd;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.roadmap-version {
  margin-bottom: 1rem;
}

.roadmap-version:last-child {
  margin-bottom: 0;
}

.roadmap-version-title {
  color: #60a5fa;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.roadmap-version ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.roadmap-version li {
  color: #d4a574;
  padding: 0.35rem 0 0.35rem 1.4rem;
  position: relative;
  font-size: 0.9rem;
}

.roadmap-version li::before {
  content: "→";
  position: absolute;
  left: 0.4rem;
  color: #60a5fa;
}

/* Donation modal */
.donation-modal {
  max-width: 600px;
}

.donation-intro {
  text-align: center;
  margin-bottom: 1.5rem;
}

.donation-intro p {
  color: #d4a574;
  font-size: 1rem;
  margin: 0.35rem 0;
}

.cost-breakdown {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.cost-breakdown h3 {
  color: #a78bfa;
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.cost-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.cost-item:last-child {
  border-bottom: none;
}

.cost-item.cost-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 2px solid rgba(139, 92, 246, 0.4);
}

.cost-name {
  color: #d4a574;
}

.cost-amount {
  color: #fbbf24;
  font-weight: 600;
}

.donation-benefits {
  margin: 1.25rem 0;
}

.donation-benefits h3 {
  color: #93c5fd;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.donation-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.donation-benefits li {
  color: #d4a574;
  padding: 0.45rem 0 0.45rem 1.4rem;
  position: relative;
}

.donation-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0.1rem;
  color: #4ade80;
  font-weight: 600;
}

.donation-amounts {
  margin: 1.5rem 0;
}

.donation-amounts h3 {
  color: #fbbf24;
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.amount-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.amount-btn {
  background: rgba(251, 191, 36, 0.1);
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
}

.amount-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.5);
  transform: translateY(-2px);
}

.amount-emoji {
  font-size: 2rem;
}

.amount-value {
  color: #fbbf24;
  font-size: 1.1rem;
  font-weight: 700;
}

.amount-label {
  color: #d4a574;
  font-size: 0.8rem;
}

.donation-footer {
  text-align: center;
  margin: 1.5rem 0;
}

.donation-quote {
  color: #93c5fd;
  font-style: italic;
  margin: 0.75rem 0;
}

.donation-note {
  color: #94a3b8;
  font-size: 0.82rem;
}

.community-stats {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.community-stats h3 {
  color: #93c5fd;
  font-size: 1rem;
  margin: 0 0 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.stat-label {
  color: #d4a574;
}

.stat-value {
  color: #fbbf24;
  font-weight: 600;
}

/* Feedback modal */
.feedback-modal {
  max-width: 500px;
}

#feedbackIntro {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #d4a574;
  font-size: 1rem;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feedback-comment label {
  display: block;
  color: #93c5fd;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

#feedbackText {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 10px;
  padding: 0.75rem;
  color: #d4a574;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 6rem;
}

#feedbackText:focus {
  outline: none;
  border-color: rgba(212, 165, 116, 0.5);
  box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.2);
}

.feedback-tags label {
  display: block;
  color: #93c5fd;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.tag-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-btn {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  color: #93c5fd;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tag-btn:hover {
  background: rgba(96, 165, 250, 0.2);
}

.tag-btn.selected {
  background: rgba(96, 165, 250, 0.3);
  border-color: rgba(96, 165, 250, 0.5);
  color: #fff;
}

.feedback-context label {
  color: #d4a574;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.feedback-context input[type="checkbox"] {
  cursor: pointer;
}

.feedback-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: rgba(74, 222, 128, 0.2);
  border: 2px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

.btn-primary:hover {
  background: rgba(74, 222, 128, 0.3);
  border-color: rgba(74, 222, 128, 0.6);
}

.btn-primary:disabled,
.btn-primary.btn-disabled {
  background: rgba(148, 163, 184, 0.1);
  border: 2px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-primary:disabled:hover,
.btn-primary.btn-disabled:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.2);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.1);
  border: 2px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.2);
}

.success-message {
  text-align: center;
  padding: 2.5rem 1.25rem;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1.25rem;
}

.success-message h3 {
  color: #4ade80;
  margin: 1rem 0;
}

.success-message p {
  color: #d4a574;
  margin: 0.5rem 0;
}

.success-message button {
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .amount-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .donation-modal {
    max-width: 95%;
  }
}

/* Quick Play Express modal layout */
.quickplay-modal .modal-body {
  padding-bottom: 1.5rem;
}

.quickplay-custom-input-block {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quickplay-custom-label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.7);
}

.quickplay-custom-input {
  min-height: 48px;
}

.quickplay-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.25rem 2rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    160deg,
    rgba(16, 15, 28, 0.75),
    rgba(18, 17, 35, 0.82)
  );
  position: sticky;
  bottom: 0;
}

.quickplay-start-btn {
  min-width: 180px;
}

@media (max-width: 768px) {
  .quickplay-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .quickplay-start-btn,
  .quickplay-footer .btn-secondary {
    width: 100%;
  }
}
