/*
 * ============================================================
 *  TNT | Sudoku Saga — AI Puzzle Generator
 *  File:    aiCreateSudokuStyles.css
 *  Coder:   KLP + GitHub Copilot
 *  Created: 2026-07-15
 *
 *  Generator palette — building, backtracking, removing.
 *  Requires CSS custom properties from tnt-base-styles.css.
 * ============================================================
 */


/* ── Local tokens ── */
:root {
    --sudoku-green:     #2e7d32;
    --sudoku-green-lt:  #e8f5e9;
    --sudoku-green-mid: #c8e6c9;
    --sudoku-ink:       #1a1a2e;
    --gen-teal:         #00796b;
    --gen-teal-lt:      #b2dfdb;
}


/* ─────────────────────────────────────────────────────────
   HERO
───────────────────────────────────────────────────────── */
#hero {
    min-height: 160px;
    background-image:
        linear-gradient(135deg,
            rgba(0, 60, 30, 0.72)  0%,
            rgba(10, 14, 50, 0.60) 100%),
        url('../images/einsteinSudoku.jpg');
    background-size: cover;
    background-position: center 30%;
    padding: 1.4rem 1rem 1.2rem;
    border-bottom: 4px solid var(--tnt-red);
}

#hero .hero-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9);
}

#hero .hero-eyebrow { color: var(--tnt-amber); }

#hero .hero-subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.88rem, 2vw, 1.1rem);
}

.hero-sudoku-icon {
    height: 2.6rem;
    vertical-align: middle;
    margin-right: 0.4rem;
    filter: brightness(0) invert(1);
}


/* ─────────────────────────────────────────────────────────
   APP SECTION
───────────────────────────────────────────────────────── */
#appSection {
    background: #f0f7f4;
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

#sudokuPanel { width: 360px; }


/* ─────────────────────────────────────────────────────────
   GENERATOR CELL STATES
   gen-fill    = digit being placed during Phase 1 fill (teal)
   gen-back    = backtrack: digit being cleared         (red flash)
   gen-restore = cell restored: needed for uniqueness   (amber flash)
   After generation: cells get 'frozen' or 'clickable' (same as loaded demo)
───────────────────────────────────────────────────────── */
table#sb td.gen-fill {
    background-color: #b2dfdb !important;   /* Material teal-100 */
    color: #004d40;
    font-weight: 600;
    transition: background-color 0.2s;
}

table#sb td.gen-back {
    background-color: #ffcdd2 !important;   /* Material red-100 */
    transition: background-color 0.15s;
}

table#sb td.gen-restore {
    background-color: #fff3e0 !important;   /* Material amber-50 */
    transition: background-color 0.2s;
}


/* ─────────────────────────────────────────────────────────
   GENERATOR CONTROLS
───────────────────────────────────────────────────────── */
#genControls {
    border-top: 2px dashed var(--gen-teal-lt);
    padding-top: 0.85rem;
    margin-top: 0.6rem;
}

.solve-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-align: center;
    line-height: 1.5;
}
.solve-status-ready   { background: #f5f5f5; color: #546e7a; }
.solve-status-running { background: #e0f2f1; color: #00695c; }
.solve-status-paused  { background: #fff8e1; color: #bf360c; }
.solve-status-success { background: #e8f5e9; color: #1b5e20; }
.solve-status-error   { background: #fce4ec; color: #880e4f; }


/* ─────────────────────────────────────────────────────────
   COLOR LEGEND
───────────────────────────────────────────────────────── */
.color-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.5rem;
    font-size: 0.73rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #546e7a;
    white-space: nowrap;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.swatch-genfill    { background: #b2dfdb; border: 1px solid #4db6ac; }
.swatch-genback    { background: #ffcdd2; border: 1px solid #ef9a9a; }
.swatch-genrestore { background: #fff3e0; border: 1px solid #ffe082; }
.swatch-gengiven   { background: #f5f5f5; border: 2px solid #424242; }


/* ─────────────────────────────────────────────────────────
   GENERATOR LOG PANEL
───────────────────────────────────────────────────────── */
#genLogPanel {
    max-width: 620px;
    margin: 1.2rem auto 0;
    background: #fff;
    border: 1px solid #b2dfdb;
    border-radius: 8px;
    overflow: hidden;
}

.log-header {
    background: #e0f2f1;
    border-bottom: 1px solid #b2dfdb;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}

#genLog {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.35rem 0.5rem;
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
    font-size: 0.77rem;
    line-height: 1.55;
}

.log-entry          { padding: 0.18rem 0.4rem; border-radius: 3px; margin-bottom: 2px; }
.log-num            { color: #90a4ae; font-size: 0.7rem; margin-right: 0.35rem;
                      min-width: 2.4rem; display: inline-block; text-align: right; }
.log-depth          { font-size: 0.68rem; color: #78909c; font-style: normal; }

.log-fill-place     { background: #e0f2f1; color: #004d40; }
.log-fill-back      { background: #fce4ec; color: #880e4f; }
.log-remove         { background: #f3f4f6; color: #37474f; }
.log-restore        { background: #fff8e1; color: #bf360c; }
.log-info           { background: #f5f5f5; color: #546e7a; font-style: italic; }
.log-complete       { background: #e8f5e9; color: #1b5e20; font-weight: 700; }


/* ─────────────────────────────────────────────────────────
   SAVE SECTION
───────────────────────────────────────────────────────── */
#saveSection {
    max-width: 620px;
    margin: 1.2rem auto 0;
    background: #fff;
    border: 1px solid #b2dfdb;
    border-radius: 8px;
    overflow: hidden;
}

.save-header {
    background: #e0f2f1;
    border-bottom: 1px solid #b2dfdb;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}

#puzzleOutput {
    width: 100%;
    min-height: 180px;
    padding: 0.5rem 0.6rem;
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
    font-size: 0.76rem;
    border: none;
    border-top: 1px solid #b2dfdb;
    outline: none;
    resize: vertical;
    color: #1a1a2e;
    background: #fafffe;
    line-height: 1.5;
}

.save-instructions {
    font-size: 0.82rem;
    color: #546e7a;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e0f2f1;
    background: #f9fefe;
}


/* ─────────────────────────────────────────────────────────
   RECURSION EXPLAINER BOX
───────────────────────────────────────────────────────── */
.recursion-box {
    background: #f8faf8;
    border: 1px solid var(--gen-teal-lt);
    border-left: 5px solid var(--gen-teal);
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #37474f;
}

.recursion-box strong { color: var(--gen-teal); }
.recursion-box code   { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 3px;
                         font-family: 'Noto Sans Mono', monospace; font-size: 0.82em; }
