/**
 * generator.css
 * Layout and styling for the Number Generator system.
 */

:root {
  --primary-color: var(--color-primary, #3b82f6);
  --border-color: var(--color-border, #e2e8f0);
  --text-muted: var(--color-text-muted, #64748b);
  --text-primary: var(--color-text, #1e293b);
  --text-secondary: var(--color-text-muted, #64748b);
  --bg-card: var(--color-surface, #ffffff);
  --shadow-sm: var(--shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));
}


.generator-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.generator-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.generator-tab-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.generator-tab-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}

/* Entry Warning Page styles */
.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 35px;
  margin: 20px auto;
  max-width: 750px;
  box-shadow: var(--shadow-sm);
}

.entry-card h1 {
  font-size: 1.8rem;
  margin-bottom: 25px;
  color: var(--text-primary);
  text-align: center;
}

.entry-card p {
  line-height: 1.6;
  margin-bottom: 18px;
  color: var(--text-secondary);
}

/* Ad Space Margins - Ensure sufficient padding for mobile to avoid misclicks */
.ad-space {
  background: rgba(0, 0, 0, 0.05);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  margin: 40px 0; /* Clear margin to avoid misclicks */
  font-weight: 500;
}

.small-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 15px;
}

.button-area {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 35px;
  flex-wrap: wrap;
}

.button-area .main-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 4px 10px rgba(74, 144, 226, 0.2);
}

.button-area .main-button:hover {
  background: #357ebd;
}

.button-area .sub-button {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 12px 25px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.button-area .sub-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Copy buttons styling */
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 10px;
}

.result-numbers {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--text-primary);
}

.copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.copy-btn.copied {
  background: #2ebd59;
  color: white;
  border-color: #2ebd59;
}

.all-copy-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

/* Condition Inputs */
.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-inputs input {
  width: 80px;
  text-align: center;
}

.section-counts-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  text-align: center;
}

.section-counts-grid div {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px;
}

.section-counts-grid input {
  width: 100%;
  text-align: center;
  margin-top: 5px;
}

/* Recommendation groups */
.recommend-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.recommend-group-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  position: relative;
}

.recommend-group-box.high { border-top: 4px solid #d9534f; }
.recommend-group-box.middle { border-top: 4px solid #f0ad4e; }
.recommend-group-box.low { border-top: 4px solid #5cb85c; }
.recommend-group-box.exclude { border-top: 4px solid #777; background: #fafafa; }

.recommend-numbers-display {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-primary);
  margin: 10px 0;
  word-break: break-all;
}

/* Statistics & Evaluation Section */
.stats-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  margin-top: 40px;
}

.stats-container h3 {
  margin-bottom: 20px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stats-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  text-align: center;
}

.stats-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-top: 5px;
}

.eval-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 15px;
}

/* --- 광고 모달 및 타이머 스타일 (Glassmorphism & High-end design) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75); /* Slate 900 투명도 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 35px 30px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.modal-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.modal-content p {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 25px;
}

/* Spinner styling */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Timer Countdown badge */
.timer-countdown {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #3b82f6;
  text-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
  margin-top: 10px;
  animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: rgba(30, 41, 59, 0.95); /* Slate 800 */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  }
  .modal-content h3 {
    color: #f8fafc;
  }
  .modal-content p {
    color: #94a3b8;
  }
}

