/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    color: white;
}

/* Main Layout */
.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
}

/* Left Panel */
.left-panel {
    background-color: #000;
    /* padding: 8px; */
    border-radius: 8px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.left-panel h2 {
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 0;
    color: white;
    /* height: 10px; */
    display: flex;
    align-items: center;
}

#queen-positions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.queen-position {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    color: white;
    padding: 0;
    height: 60px;
    display: flex;
    align-items: center;
    margin: 0;
    box-sizing: border-box;
}

.queen-position.highlighted {
    color: #cc6a00;
    font-weight: bold;
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Row containing board and controls to the right */
.board-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

/* Chess Board */
#chess-board {
    width: 480px;
    height: 480px;
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    border: 2px solid #333;
    position: relative;
}

.chess-cell {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chess-cell.light {
    background-color: #fff;
}

.chess-cell.dark {
    background-color: #2f6f62;
}

/* Queen Styling */
.queen {
    font-size: 42px;
    color: #8B4513;
    background-color: white;
    border: 2px solid #8B4513;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

/* Row Highlight */
.row-highlight {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 2px;
    bottom: 2px;
    border: 4px solid red;
    pointer-events: none;
    z-index: 1;
}

/* Orange Alpha Highlight */
.orange-highlight {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    background-color: rgba(255, 8, 0, 0.388);
    pointer-events: none;
    z-index: 1;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 200px; /* sidebar width next to board */
}

/* Mode selector */
.mode-label {
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    align-self: flex-start;
}

.mode-select {
    padding: 6px 8px;
    font-size: 11px;
    background-color: #ffffff;
    color: #000;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

.btn {
    padding: 8px 16px;
    font-size: 10px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    background-color: white;
    color: black;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.btn:hover:not(:disabled) {
    background-color: #333333;
    color: white;
}

.btn:disabled {
    background-color: white;
    color: #666;
    cursor: not-allowed;
}

/* Status Message */
.status-message {
    background-color: #a24e21;
    color: white;
    padding: 10px 15px;
    font-family: Georgia, serif;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
    width: 480px;
}

/* Heuristic Display */
.heuristic-display {
    background-color: #f0f0f0;
    color: black;
    padding: 8px 15px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
    width: 480px;
}

/* Step Counter Display */
.step-counter {
    background-color: #e8f4f8;
    color: #2c5aa0;
    padding: 8px 15px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
    width: 480px;
    border: 1px solid #2c5aa0;
}

/* Status box and overrides to align widths with controls column */
.status-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.controls .status-message,
.controls .heuristic-display,
.controls .step-counter {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    
    .left-panel {
        width: 100%;
        max-width: 480px;
    }
    
    #chess-board {
        width: 320px;
        height: 320px;
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
    }
    
    .chess-cell {
        width: 40px;
        height: 40px;
    }
    
    .queen {
        font-size: 28px;
        width: 24px;
        height: 24px;
    }
    
    .board-row {
        flex-direction: column;
        gap: 12px;
    }

    .controls,
    .status-message,
    .heuristic-display,
    .step-counter {
        width: 320px;
    }
}
