/* Word Search Specific Styles */

.wordsearch-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.wordsearch-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wordsearch-header {
    text-align: center;
    margin-bottom: 1rem;
}

.wordsearch-header h2 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.wordsearch-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.info-badge .label {
    color: #666;
}

.info-badge .value {
    color: #2c3e50;
    font-weight: 600;
}

/* Grid container */
.wordsearch-game {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Grid */
.wordsearch-grid {
    display: grid;
    gap: 2px;
    background: #ddd;
    padding: 2px;
    border-radius: 8px;
    user-select: none;
    touch-action: none;
}

.wordsearch-cell {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
}

.wordsearch-cell:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.wordsearch-cell.selecting {
    background: #b3d9ff;
}

.wordsearch-cell.found {
    background: #52c41a;
    color: white;
    cursor: default;
}

.wordsearch-cell.found:hover {
    transform: none;
}

/* Word list */
.wordsearch-words {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.wordsearch-words h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.words-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.word-item {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    color: #2c3e50;
    transition: all 0.2s ease;
}

.word-item.found {
    background: #52c41a;
    color: white;
    text-decoration: line-through;
    opacity: 0.8;
}

/* Game completion */
.completion-message {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border-radius: 12px;
    margin-top: 2rem;
}

.completion-message h3 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
}

.completion-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.completion-stat {
    text-align: center;
}

.completion-stat .value {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.completion-stat .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Timer */
.timer-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #52c41a;
}

.timer-display.warning {
    color: #faad14;
}

.timer-display.danger {
    color: #f5222d;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Buttons */
.wordsearch-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #52c41a 0%, #73d13d 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Dark mode styles */
body.dark-mode .wordsearch-card {
    background: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .wordsearch-header h2 {
    color: #e0e0e0;
}

body.dark-mode .info-badge {
    background: #2a2a2a;
}

body.dark-mode .info-badge .label {
    color: #999;
}

body.dark-mode .info-badge .value {
    color: #e0e0e0;
}

body.dark-mode .wordsearch-cell {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .wordsearch-cell:hover {
    background: #3a3a3a;
}

body.dark-mode .wordsearch-cell.selecting {
    background: #4a5f7f;
}

body.dark-mode .word-item {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .wordsearch-words h3 {
    color: #e0e0e0;
}

body.dark-mode .progress-bar {
    background: #2a2a2a;
}

/* Responsive design */
@media (max-width: 768px) {
    .wordsearch-container {
        padding: 1rem 0.5rem;
    }

    .wordsearch-card {
        padding: 1rem;
    }

    .wordsearch-game {
        flex-direction: column;
        align-items: center;
    }

    .wordsearch-cell {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }

    .wordsearch-header h2 {
        font-size: 1.5rem;
    }

    .wordsearch-info {
        gap: 1rem;
    }

    .info-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .wordsearch-words {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wordsearch-cell {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .completion-message h3 {
        font-size: 1.5rem;
    }

    .completion-stats {
        gap: 1rem;
    }
}
