/* Daily Crossword Styles */

.crossword-container {
    max-width: 1200px;  /* Increased for the side-by-side layout */
    margin: 0 auto;
    padding: 1rem;
}

.crossword-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.crossword-title {
    margin: 0;
}

.crossword-date {
    font-size: 1rem;
    color: #666;
}

.crossword-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timer {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color, #3498db);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color, #3498db);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Modify grid container to be responsive - column on mobile, row on desktop */
.crossword-grid-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.crossword-puzzle {
    display: grid;
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 600px;
    margin: 0 auto;
    gap: 1px;
    background-color: black;
    border: 2px solid black;
}

.crossword-cell {
    background-color: white;
    position: relative;
    user-select: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

/* Enhanced cell number styling */
.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: clamp(0.5rem, 1.5vw, 0.7rem);
    line-height: 1;
    font-weight: normal;
    color: #333;
    z-index: 2;
}

/* Style for the letter in the cell */
.cell-letter {
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: bold;
    z-index: 1;
}

/* Apply incorrect styling to letter span */
.cell-letter.incorrect {
    color: #e74c3c;
}

.crossword-cell.black {
    background-color: black;
    cursor: default;
}

.crossword-cell.selected {
    background-color: #ffffa0;
}

.crossword-cell.highlighted {
    background-color: #e0f0ff;
}

.clue-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.clue-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.clue-heading {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.clue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1.5rem;
}

.clue-item {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.clue-item:hover {
    background-color: #f5f5f5;
}

.clue-item.active {
    background-color: #e0f0ff;
    font-weight: bold;
}

.completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.completion-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.completion-modal {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.completion-modal h2 {
    color: var(--primary-color, #3498db);
    margin-bottom: 1rem;
}

.completion-modal p {
    margin-bottom: 1.5rem;
}

.completion-time {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color, #3498db);
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.completion-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-block;
    background-color: #f5f5f5;
    color: #333;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    border-radius: 50%;
    pointer-events: none;
}

/* Desktop Layout - Grid on left, clues on right */
@media (min-width: 768px) {
    .crossword-grid-container {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .crossword-puzzle {
        flex: 0 0 60%;
        max-width: 550px;
        margin: 0;
    }
    
    .clue-container {
        flex: 1;
        margin: 0;
        padding-left: 2rem;
        max-height: 550px;
        overflow-y: auto;
    }
}

/* For narrower mobile screens */
@media (max-width: 767px) {
    .crossword-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .crossword-grid-container {
        gap: 1rem;
    }
    
    .clue-container {
        padding: 0 0.5rem;
    }
    
    .cell-number {
        font-size: 0.5rem;
        top: 1px;
        left: 1px;
    }
    
    .cell-letter {
        font-size: 0.9rem;
    }
} 