/* Sudoku Widget Styles */

/* Section Styles */
.sudoku-demo {
    background-color: #f8f9fa;
}

/* CTA Panel */
.sudoku-cta {
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sudoku-cta h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.sudoku-cta .cta-features {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
}

.sudoku-cta .cta-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.sudoku-cta .cta-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* Widget Container */
.sudoku-widget {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header */
.sudoku-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.difficulty-easy {
    background-color: #d4edda;
    color: #155724;
}

.difficulty-medium {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty-hard {
    background-color: #f8d7da;
    color: #721c24;
}

.timer {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Difficulty Selector */
.sudoku-difficulty-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.difficulty-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    background-color: white;
    color: #6c757d;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.difficulty-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.difficulty-btn.active {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

/* Grid Layout */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
    background-color: #2c3e50;
    padding: 3px;
    border-radius: 8px;
    max-width: 450px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.sudoku-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    background-color: #2c3e50;
}

/* Cell Styles */
.sudoku-cell {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    text-align: center;
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: 600;
    background-color: #fff;
    color: #2c3e50;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.sudoku-cell:focus {
    outline: 3px solid #3498db;
    outline-offset: -3px;
    z-index: 10;
    position: relative;
}

/* Cell States */
.sudoku-cell.given {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 700;
    cursor: not-allowed;
}

.sudoku-cell.user-input {
    color: #3498db;
}

.sudoku-cell.conflict {
    background-color: #ffebee;
    color: #c0392b;
}

.sudoku-cell.hint {
    color: #27ae60;
    background-color: #e8f5e9;
}

.sudoku-cell.completed {
    background-color: #e8f5e9;
}

.sudoku-cell.highlight-same {
    background-color: #e3f2fd;
}

/* Controls */
.sudoku-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.sudoku-controls button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #3498db;
    color: white;
}

.sudoku-controls button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.sudoku-controls button:active {
    transform: translateY(0);
}

.sudoku-controls .btn-secondary {
    background-color: #95a5a6;
}

.sudoku-controls .btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Completion Modal */
.sudoku-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sudoku-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.sudoku-modal.show .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.modal-content .completion-time {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

.modal-content .cta-text {
    margin: 1.5rem 0 1rem;
    font-size: 1.1rem;
    color: #2c3e50;
}

.modal-content .btn {
    margin: 0.5rem;
}

/* Screen Reader Only */
.visually-hidden-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .sudoku-widget {
        padding: 1rem;
    }

    .sudoku-cell {
        font-size: 1rem;
    }

    .sudoku-controls {
        flex-direction: column;
    }

    .sudoku-controls button {
        width: 100%;
    }

    .sudoku-cta {
        padding: 1.5rem;
        margin-top: 2rem;
    }
}

@media (max-width: 992px) {
    .sudoku-demo .row {
        flex-direction: column;
    }
}
