/* 
   Optimizat pentru a NU interfera cu style.css existent
   Toate stilurile sunt izolate în containerul .reguli-page */

:root {
            --primary-color: #003D73;  
            --background-body: #f4f7f6; 
            --background-app: #FAFAFA; 
            --text-color: #333;
            --border-radius: 12px;
            --padding-sides: 20px;
            --max-width-content: 1000px;
        }

        /* Stiluri de bază pentru a folosi fundalul paginii */
        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--background-body); 
            margin: 0;
            padding: 0;
            color: var(--text-color);
            display: flex;
            justify-content: center;
            align-items: flex-start;
            min-height: 100vh;
        }

        /* --- Stiluri Container Principal (Chenarul Unic) --- */
        .app-container {
           
            max-width: var(--max-width-content);
            width: 100%; 
            margin: 20px auto; 
            
            border: 1px solid #ddd;
            border-radius: var(--border-radius);
            background-color: var(--background-app);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); 
            overflow: hidden; 
        }

        /* --- Stiluri Header (Fără chenar, doar fundalul albastru) --- */
        .header {
            background-color: var(--primary-color);
            color: white;
            
            background: linear-gradient(90deg, var(--primary-color) 0%, #0170b4 100%);
            display: flex;
            justify-content: flex-start;
            align-items: center;
            padding: 15px var(--padding-sides); 
            position: relative;
            
            border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
            font-weight: bold;

            
        }

        
        .logo-link {
            
            text-decoration: none;
            
            color: inherit; 
        }

        .logo {
            font-size: 1.8em;
            font-weight: bold;
            margin-right: 30px; 
        }

        .menu-toggle {
            background: none;
            border: none;
            color: white;
            font-size: 1.5em;
            cursor: pointer;
            display: none; 
            z-index: 1001;
            order: -1; 
            margin-right: 15px;
        }

        .nav-menu {
            display: flex;
            gap: 20px;
            list-style: none; 
            padding: 0;
            margin: 0;
        }

        .nav-item {
            color: white;
            text-decoration: none;
            padding: 3px 8px; 
            font-size: 0.95em; 
            border-radius: 5px;
            transition: background-color 0.3s;
        }

        .nav-item:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

/* === Container Principal === */
.reguli-page {
    max-width: 900px;
    margin: 40px auto;
   
    font-family: 'Inter', sans-serif;
}

/* Titluri */
.reguli-page h1 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #003D73;
    text-align: center;
}

.reguli-page h2 {
    margin-top: 30px;
    color: #004a8f;
}

.reguli-page h3 {
    margin-top: 20px;
    color: #005696;
}

/* Paragrafe și listă */
.reguli-page p {
    line-height: 1.7;
    margin-bottom: 15px;
}

.reguli-page ul {
    margin-left: 20px;
    padding-left: 15px;
}

.reguli-page ul li {
    margin-bottom: 8px;
}

/* Cutii de exemplu */
.reguli-page .example-box {
    background: #eef5ff;
    border-left: 4px solid #1e88e5;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
}

/* Mini-grid Sudoku */
.reguli-page .sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 30px);
    gap: 2px;
    margin: 20px 0;
}

.reguli-page .sudoku-cell {
    background: #fafafa;
    border: 1px solid #cccccc;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 4px;
}

/* Stil pentru a centra textul în subsol - site-footer */
.center-text {
    text-align: center;
    margin: 5px auto;
}

/* Stil optional pentru a fixa subsolul, asigurand ca e sub tot continutul */
.site-footer {
    width: 100%;
    padding: 20px 0;
    margin-top: 30px; 
    border-top: 1px solid #eee; 
    background-color: #f9f9f9;
}

/* --- Stiluri Adăugate pentru Exemple Vizuale (NOU) --- */


.reguli-page .sudoku-example-container {
    display: flex;
    flex-direction: column;
    align-items: center; 
    margin: 20px 0 30px;
}

/* Stil pentru celula care provoacă eroarea */
.reguli-page .error-cell,
.reguli-page .error-cell-col {
    background-color: #ffdddd !important; 
    color: #cc0000; 
    border: 1px solid #cc0000 !important; 
    position: relative;
    animation: errorPulse 1s infinite alternate; 
}

/* Legenda de eroare */
.reguli-page .error-caption {
    font-size: 1em;
    color: #cc0000; /* Roșu */
    font-weight: 500;
    margin-top: 10px;
    text-align: center;
}


.reguli-page .grid-row-example {
    
    grid-template-columns: repeat(9, 30px);
}

.reguli-page .grid-col-example,
.reguli-page .grid-block-example {
    
    grid-template-columns: repeat(3, 30px);
    width: 96px; 
}


/* Animație subtilă de puls pentru a evidenția eroarea */
@keyframes errorPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 0 5px rgba(204, 0, 0, 0);
    }
}


/* Responsivitate (Existentă + Nouă) */
@media (max-width: 600px) {
    .reguli-page {
        padding: 15px;
    }

    .reguli-page h1 {
        font-size: 1.6em;
    }

    .reguli-page .sudoku-grid {
        grid-template-columns: repeat(9, 22px);
    }

    .reguli-page .sudoku-cell {
        height: 22px;
        font-size: 0.8em;
    }
    
    /* Ajustări pentru grilele de exemplu pe mobil */
    .reguli-page .grid-col-example,
    .reguli-page .grid-block-example {
        grid-template-columns: repeat(3, 22px);
        width: 70px; 
    }

     .menu-toggle {
                display: block; 
            }
            
            .logo {
                margin-right: auto;
            }

            .nav-menu {
                display: none; 
                flex-direction: column;
                position: absolute;
                top: 100%; 
                left: 0;
                width: 100%;
                background: linear-gradient(90deg, var(--primary-color) 0%, #005696 100%); 
                padding: 10px 0;
                box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
                z-index: 1000;
            }

            .nav-menu.active {
                display: flex;
            }

            .nav-item {
                padding: 10px var(--padding-sides);
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            }
            
            
            .nav-menu.active .nav-item:last-child {
                border-bottom: none;
            }

        }

        /* --- Stiluri Adăugate pentru Strategii (Exemple Avansate) --- */

/* Celule care conțin notițe (pencil marks) */
.reguli-page .sudoku-cell.has-notes {
    font-size: 0.65em; 
    line-height: 1;
    padding: 2px;
    align-items: flex-start; 
    justify-content: flex-start;
    flex-wrap: wrap;
    color: #999; 
}

/* Stil pentru celula care este Soluția (e.g., Hidden Single) */
.reguli-page .sudoku-cell.highlight-cell {
    background-color: #fce4ec; 
    border: 2px solid #e91e63 !important; 
    color: #e91e63 !important;
    font-size: 1em !important; 
    font-weight: bold;
    display: flex; 
    align-items: center;
    justify-content: center;
}

/* Stil pentru celulele care formează un Naked Pair */
.reguli-page .sudoku-cell.highlight-pair {
    background-color: #fffde7; 
    border: 2px solid #ffeb3b !important; 
    color: #333 !important;
    font-weight: bold;
    font-size: 0.8em; 
}

/* Stil pentru celulele Pointing Pair/Triple */
.reguli-page .sudoku-cell.highlight-pointing {
    background-color: #e3f2fd; 
    border: 2px solid #2196f3 !important; 
    color: #2196f3 !important;
    font-weight: bold;
    font-size: 0.8em; 
}

/* Legenda strategiei */
.reguli-page .strategy-caption,
.reguli-page .result-caption {
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
}

.reguli-page .result-caption {
    color: #4CAF50; 
}


.reguli-page .grid-pointing-example {
    grid-template-columns: repeat(3, 30px);
    width: 96px; 
}

@media (max-width: 600px) {
    .reguli-page .sudoku-cell.has-notes {
        font-size: 0.5em; /* Micșorăm și mai mult notițele pe mobil */
    }
}