/**
 * Crossword Styles
 *
 * Game-specific styles for crossword puzzles using Exolve library.
 * Common styles (modals, buttons, forms, leaderboards, save score forms,
 * game over dialogs, game area, score display) are provided by the
 * AIML Games Framework's common.css.
 *
 * @package AIML_Games_Crossword
 * @since 1.0.0
 */

/* =============================================================================
 * CROSSWORD PUZZLE CONTAINER
 * ============================================================================= */

.aiml-crossword-puzzle-container {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* No puzzle message */
.aiml-crossword-no-puzzle {
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    color: #6c757d;
}

.aiml-crossword-no-puzzle p {
    margin: 0;
    font-size: 16px;
}

/* Hide eXolve default controls */
#xlv1-controls-etc, .aiml-games-content-area .aiml-games-score-display {
    display: none !important;
}
#xlv1-grid-parent-centerer {
    background-color: #000;
}

/* =============================================================================
 * GAME STATS
 * ============================================================================= */

.aiml-crossword-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.aiml-crossword-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aiml-crossword-stat-label {
    font-weight: 500;
    color: #495057;
}

.aiml-crossword-stat-value {
    font-weight: 700;
    font-size: 18px;
    color: #212529;
}

.aiml-crossword-stat-divider {
    color: #6c757d;
    margin: 0 2px;
}

.aiml-crossword-stat-total {
    font-weight: 700;
    font-size: 18px;
    color: #212529;
}

/* =============================================================================
 * PROGRESS BAR
 * ============================================================================= */

.aiml-crossword-progress {
    flex: 1;
    min-width: 150px;
}

.aiml-crossword-progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.aiml-crossword-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* =============================================================================
 * EXOLVE INTEGRATION STYLES
 * ============================================================================= */

/* Override Exolve container for responsive sizing */
.aiml-crossword-puzzle-container #exolve {
    max-width: 100%;
    overflow-x: auto;
}

/* Input text color - always black */
.aiml-crossword-puzzle-container input.xlv-correct,
.aiml-crossword-puzzle-container input.xlv-wrong,
.aiml-crossword-puzzle-container .exolve-square input {
    color: #000 !important;
}

/* Ensure Exolve grid is centered */
.aiml-crossword-puzzle-container .exolve-grid {
    margin: 0 auto;
}

/* Style clue panels */
.aiml-crossword-puzzle-container .exolve-clues {
    font-size: 14px;
    line-height: 1.6;
}

/* =============================================================================
 * RESPONSIVE STYLES
 * ============================================================================= */

@media (max-width: 768px) {
    .aiml-crossword-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .aiml-crossword-progress {
        width: 100%;
    }

    .aiml-crossword-puzzle-container {
        padding: 10px;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .aiml-crossword-stat-value,
    .aiml-crossword-stat-total {
        font-size: 16px;
    }

    .aiml-crossword-stat-label {
        font-size: 14px;
    }
}

/* =============================================================================
 * GAME STATE STYLES
 * ============================================================================= */

/* Puzzle completed state */
.aiml-crossword-puzzle-container.completed {
    opacity: 0.8;
}

.aiml-crossword-puzzle-container.completed input {
    pointer-events: none;
}

/* Loading state */
.aiml-crossword-puzzle-container.loading {
    position: relative;
    min-height: 200px;
}

.aiml-crossword-puzzle-container.loading::after {
    content: 'Loading puzzle...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #6c757d;
}
