/* SSP Crosswords Frontend Styles */

/* Crossword Container */
.ssp-crossword-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Crossword Header */
.ssp-crossword-header {
    text-align: center;
    margin-bottom: 30px;
}

.ssp-crossword-title {
    font-size: 28px;
    margin-bottom: 10px;
}

.ssp-crossword-meta {
    color: #666;
    font-size: 14px;
}

/* Crossword Layout */
.ssp-crossword-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Crossword Grid */
.ssp-crossword-grid-container {
    display: flex;
    justify-content: center;
}

.ssp-crossword-grid {
    display: inline-block;
    border: 2px solid #333;
    background: #fff;
    user-select: none;
}

.ssp-crossword-row {
    display: flex;
}

.ssp-crossword-cell {
    width: 35px;
    height: 35px;
    border: 1px solid #333;
    position: relative;
    background: white;
    cursor: pointer;
}

.ssp-crossword-cell.black {
    background: #333;
    cursor: default;
}

.ssp-crossword-cell.active {
    background: #ffeb3b;
}

.ssp-crossword-cell.selected-word {
    background: #e3f2fd;
}

.ssp-crossword-cell.correct {
    background: #c8e6c9;
}

.ssp-crossword-cell.incorrect {
    background: #ffcdd2;
}

.ssp-cell-number {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    line-height: 1;
    font-weight: bold;
}

.ssp-cell-input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    background: transparent;
    outline: none;
}

/* Clues */
.ssp-crossword-clues {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ssp-clues-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.ssp-clues-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.ssp-clue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ssp-clue-item {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.ssp-clue-item:hover {
    background: #e0e0e0;
}

.ssp-clue-item.active {
    background: #2196f3;
    color: white;
}

.ssp-clue-number {
    font-weight: bold;
    display: inline-block;
    min-width: 30px;
}

/* Controls */
.ssp-crossword-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ssp-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ssp-btn-primary {
    background: #2196f3;
    color: white;
}

.ssp-btn-primary:hover {
    background: #1976d2;
}

.ssp-btn-secondary {
    background: #757575;
    color: white;
}

.ssp-btn-secondary:hover {
    background: #616161;
}

/* Timer */
.ssp-timer {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Completion Message */
.ssp-completion-message {
    text-align: center;
    padding: 30px;
    background: #4caf50;
    color: white;
    border-radius: 8px;
    margin: 20px 0;
}

.ssp-completion-message h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ssp-crossword-wrapper {
        grid-template-columns: 1fr;
    }
    
    .ssp-crossword-cell {
        width: 28px;
        height: 28px;
    }
    
    .ssp-cell-input {
        font-size: 16px;
    }
    
    .ssp-crossword-grid-container {
        overflow-x: auto;
        max-width: 100%;
    }
    
    .ssp-crossword-controls {
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    .ssp-crossword-controls,
    .ssp-timer,
    .ssp-completion-message {
        display: none;
    }
    
    .ssp-crossword-wrapper {
        grid-template-columns: 1fr;
    }
    
    .ssp-crossword-cell {
        background: white !important;
    }
    
    .ssp-crossword-cell.black {
        background: #333 !important;
    }
    
    .ssp-cell-input {
        display: none;
    }
}

/* Loading State */
.ssp-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.ssp-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: ssp-spin 1s linear infinite;
}

@keyframes ssp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}