/* Board Editor - Jeopardy Grid Styles */

/* Standard Jeopardy Grid: 6 categories x 5 clue rows + 1 header row */
.jeopardy-grid {
    display: grid;
    gap: 4px;
    width: 100%;
    max-width: 1200px;
}

.jeopardy-grid.standard {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    grid-template-rows: auto repeat(5, minmax(70px, 100px));
}

/* Final Round: Single category, single clue */
.jeopardy-grid.final {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(100px, 150px);
    max-width: 400px;
    margin: 0 auto;
}

/* Category Header Cell */
.category-header {
    background: var(--mud-palette-primary-darken);
    color: var(--mud-palette-primary-text);
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    border-radius: 4px;
    word-break: break-word;
    hyphens: auto;
}

/* Clickable Category Header */
.category-header.clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.category-header.clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: var(--mud-palette-primary);
    z-index: 1;
}

/* Clue Cell Base */
.clue-cell {
    background: var(--mud-palette-primary);
    color: #ffcc00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.clue-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Empty Cell - no clue placed */
.clue-cell.empty {
    background: var(--mud-palette-surface);
    border: 2px dashed var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
}

.clue-cell.empty:hover {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-action-default-hover);
}

/* Clue exists but has no content (placeholder) */
.clue-cell.no-content {
    opacity: 0.5;
}

/* Clue has content - show check indicator */
.clue-cell.has-content {
    /* Full opacity, normal appearance */
}

/* Content indicator (checkmark) for filled clues */
.clue-content-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.75rem;
    color: #00cc66;
    opacity: 0.9;
}

/* Played/Revealed Cell */
.clue-cell.played {
    background: var(--mud-palette-primary-darken);
    opacity: 0.6;
}

/* Daily Double Marker */
.daily-double-marker {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ffcc00;
    color: var(--mud-palette-primary-darken);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    z-index: 2;
}

/* Point value display */
.clue-value {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

/* Final Round styling */
.jeopardy-grid.final .category-header {
    font-size: 1.25rem;
    padding: 20px;
}

.jeopardy-grid.final .clue-cell {
    font-size: 1rem;
    padding: 20px;
    text-align: center;
}

/* Board container */
.board-grid-container {
    overflow-x: auto;
    padding: 8px 0;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .jeopardy-grid.standard {
        grid-template-columns: repeat(6, minmax(80px, 1fr));
        grid-template-rows: auto repeat(5, minmax(50px, 70px));
    }

    .clue-cell {
        font-size: 1.1rem;
    }

    .category-header {
        font-size: 0.75rem;
        padding: 8px 4px;
        min-height: 50px;
    }
}

@media (max-width: 600px) {
    .jeopardy-grid.standard {
        grid-template-columns: repeat(6, minmax(60px, 1fr));
        grid-template-rows: auto repeat(5, minmax(40px, 60px));
    }

    .clue-cell {
        font-size: 0.9rem;
    }

    .category-header {
        font-size: 0.65rem;
        padding: 6px 2px;
        min-height: 40px;
    }
}

/* Media indicator on clue cells */
.clue-media-indicator {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Category Header Menu - fills grid cell */
.category-header-menu {
    width: 100%;
    height: 100%;
}

.category-header-menu .mud-menu-activator {
    width: 100%;
    height: 100%;
}

/* Category Header with Unplaced Clues Badge */
.category-header {
    position: relative;
    width: 100%;
    height: 100%;
}

.category-header .category-name {
    display: block;
    width: 100%;
}

/* Unplaced clue indicator - full height stripe on right */
.unplaced-indicator {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 24px;
    background: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 4px 4px 0;
}

/* Unplaced clue list items in popover */
.unplaced-clue-item {
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.unplaced-clue-item:hover {
    background-color: var(--mud-palette-action-default-hover);
}
