/* ===========================
 * STILURI SPECIFICE SUDOKU IREGULAR
 * =========================== */



/* 1. Definirea bordurii exterioare */
.irregular-board {
    border: 3px solid var(--primary-color) !important;
}

/* 2. Resetarea celulelor */
.irregular-board .cell {
    border: 1px solid #d0d0d0; 
    box-sizing: border-box; 
    
    border-right-width: 0px !important;
    border-bottom-width: 0px !important;
    
    /* Stiluri de bază pentru celule */
    position: relative;
    display: flex; 
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    font-size: 36px;
}

/* 3. Definirea stilurilor pentru bordurile neregulate (Regiuni/Zone) */
.irregular-board .cell.border-top {
    border-top-width: 2px !important;
    border-top-color: var(--primary-color) !important;
}

.irregular-board .cell.border-bottom {
    border-bottom-width: 2px !important;
    border-bottom-color: var(--primary-color) !important;
}

.irregular-board .cell.border-left {
    border-left-width: 2px !important;
    border-left-color: var(--primary-color) !important;
}

.irregular-board .cell.border-right {
    border-right-width: 2px !important;
    border-right-color: var(--primary-color) !important;
}

/* Stiluri pentru interacțiune */
.irregular-board .cell.fixed {
   
            color:#0b63b8;
            font-weight:700;
            cursor:default;
}

.irregular-board .cell.selected {
    background-color: var(--selected-color);
}

.irregular-board .cell.error {
    color: var(--error-color);
}

/* ===========================
 * STILURI PENTRU BUTOANELE DE CONTROL (NUMĂRĂTOARE & HOVER)
 * =========================== */
.number-controls {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
    margin: 0;
}

.digit-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60px;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1.2rem;
    font-size: 30px;
    padding: 2px;
}

.digit-btn:hover {
        background-color: #1e88e5; 
        }

.digit-btn .digit-span {
    font-weight: bold;
    line-height: 1;
    font-size: 30px;
}

.digit-btn .count-span {
    font-size: 0.7rem;
    color: #888;
    line-height: 1;
    margin-top: 2px;
}

.digit-btn.completed {
    background-color: #e0f7fa;
    opacity: 0.5; 
    cursor: default;
}

.digit-btn.completed .count-span {
    color: var(--success-color);
}

/* Stil pentru butonul Note când este activ */
#note-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* ===========================
 * STILURI PENTRU MODUL NOTE/PENCIL MARKS (CORECTAT PENTRU 3x3)
 * =========================== */


.notes-container {
    position:absolute;
    inset:0; 
    display:grid;
    grid-template-columns: repeat(3,1fr); 
    grid-template-rows: repeat(3,1fr);
    font-size:0.38em; 
    color:#555;
    padding:3px;
    box-sizing:border-box;
    pointer-events:none;
}


.notes-container .note-mark {
    display:flex;
    justify-content:center;
    align-items:center;
    line-height:1;
    font-weight: 500;
}


/* ------------------------------ */
/* STILURI HIGHLIGHT  */
/* ------------------------------ */

/* Evidențiere Rând / Coloană / Regiune (fost highlight-rowcolregion) */
.cell.highlight-rowcolregion {
    background-color: #BBDEFB !important;
    
}

/* Evidențiere valori identice (fost match-value) */
.cell.match-value {
    background-color: #FFF9C4 !important; 
}

/* Celulă selectată */
.cell.selected { 
    
    background-color: #BBDEFB !important;
    z-index: 2;
}

/* Dacă e selectată + match */
.cell.selected.match-value {
    background-color: #FFEE98 !important; 
}

/* Dacă e selectată + evidențiată */
.cell.selected.highlight-rowcolregion {
    background-color: #42A5F5 !important;  
    
}

/* Stiluri pentru a asigura ca modalul este vizibil peste tot */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; 
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Stiluri de bază pentru fereastra modală */
.custom-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 400px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}


.custom-modal-overlay.active {
    opacity: 1;
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1);
}

/* Stiluri pentru butoanele de închidere */
.modal-close-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
}


@media (max-width: 769px) {
    .irregular-board .cell {
        
        font-size: 30px !important; 
    }
}

/* --- Stiluri de Finalizare a Unității (Succes) Animatie --- */

.sudoku-game-area .cell.unit-complete {
    background-color: #E0F3FF !important; 
    box-shadow: inset 0 0 0 2px #00BFFF;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    
   
    animation: unitFlashCompleteNeonShake 1.0s ease-out 1 forwards; /* Durată ușor crescută */
}

@keyframes unitFlashCompleteNeonShake {
    0% {
      
        box-shadow: inset 0 0 0 5px #1E90FF;
        background-color: #FFFFFF !important;
        transform: scale(0.98) translateX(0); 
        opacity: 0.8;
    }

    40% {
       
        transform: scale(1.0) translateX(-1.5px);
    }
    
    50% {
       
        box-shadow: 
            inset 0 0 0 1px #00BFFF, 
            0 0 14px rgba(0, 191, 255, 0.9); 
        opacity: 1;
        
       
        transform: scale(1.0) translateX(2px); 
    }

    60% {
        
        transform: scale(1.0) translateX(-1px);
    }

    70% {
        
        transform: scale(1.0) translateX(1px);
    }
    
    100% {
        
        box-shadow: inset 0 0 0 2px #00BFFF;
        background-color: #E0F3FF !important; 
        transform: scale(1) translateX(0);
        opacity: 1;
    }
}
