/* Sudoku Generator Styles */

:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #64748b;
  --background: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --border-thick: #1e293b;
  --success-color: #22c55e;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

/* Navigation Header */
.main-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  margin: 0;
  color: var(--text-primary);
}

.container {
  padding: 0 1rem 4rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
  text-align: center;
}

/* Form Styles */
.sudoku-form {
  max-width: 500px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group>label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--background);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.radio-label:hover {
  background: #f1f5f9;
  border-color: var(--primary-color);
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked+.radio-text {
  color: var(--primary-color);
  font-weight: 600;
}

.radio-text {
  font-size: 1rem;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--background);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: var(--secondary-color);
}

.form-actions {
  margin-top: 2rem;
}

.form-actions .btn {
  width: 100%;
}

/* Results Container */
.results-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.puzzles-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
  justify-content: center;
}

/* 4 or 6 units depending on grid size */
.puzzles-grid.count-4 {
  grid-template-columns: repeat(2, 1fr);
}

.puzzles-grid.count-6 {
  grid-template-columns: repeat(2, 1fr);
}

.sudoku-instance {
  display: flex;
  flex-direction: column;
  align-items: center;
  page-break-inside: avoid;
}

/* Sudoku Grid */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-size), 1fr);
  gap: 0;
  border: 3px solid var(--border-thick);
  background: var(--border-thick);
  width: 100%;
  aspect-ratio: 1;
}

.sudoku-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  aspect-ratio: 1;
  font-size: clamp(0.8rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.sudoku-cell.box-right {
  border-right: 3px solid var(--border-thick);
}

.sudoku-cell.box-bottom {
  border-bottom: 3px solid var(--border-thick);
}

.sudoku-cell.empty {
  background: #fafafa;
}

.sudoku-cell.prefilled {
  background: white;
}

/* Color circles for color mode */
.color-circle {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

/* Grid size specific max-widths for non-print */
.size-4 {
  max-width: 200px;
}

.size-6 {
  max-width: 300px;
}

.size-9 {
  max-width: 350px;
}

/* Solution Grid */
.solution-section {
  margin-top: 2rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 1rem;
}

.solutions-only {
  transform: scale(0.6);
  transform-origin: top center;
  gap: 1rem;
}

.solution-section details {
  background: var(--background);
  border-radius: 8px;
  padding: 1rem;
}

.solution-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem;
}

.solution-section summary:hover {
  color: var(--primary-color);
}

/* Puzzle Actions */
.puzzle-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* Print Styles */
@media print {
  body {
    background: white !important;
    padding: 0;
    margin: 0;
  }

  .results-container {
    box-shadow: none;
    padding: 0;
    max-width: 100%;
    background: transparent;
  }

  .puzzles-grid {
    gap: 1cm;
    margin: 0;
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Force 2x3 or 2x2 on a single page */
  .puzzles-grid.count-6 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .sudoku-instance {
    padding: 0.5cm;
  }

  .sudoku-grid {
    border-width: 2pt;
    background: black;
  }

  .sudoku-cell {
    border-width: 0.5pt;
    font-size: 14pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sudoku-cell.box-right {
    border-right-width: 2pt;
  }

  .sudoku-cell.box-bottom {
    border-bottom-width: 2pt;
  }

  .color-circle {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .sudoku-form,
  .results-container {
    padding: 1.5rem;
  }

  .puzzles-grid {
    grid-template-columns: 1fr !important;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .sudoku-form,
  .sudoku-container {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
