/* Main Styles for ScrabbleBot */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.game-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
}

/* Game Start Section */
.game-start-section {
    grid-column: 1;
    grid-row: 1;
    background-color: #b3e0e2;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-start-section h2 {
    color: white;
    margin-bottom: 15px;
    text-align: center;
}

.setup-controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-bottom: 15px;
}

.setup-controls input,
.setup-controls select,
.setup-controls button {
    padding: 10px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    background-color: #777;
    color: white;
}

.setup-controls button {
    background-color: #006400;
    cursor: pointer;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.connection-icon {
    width: 30px;
    height: 30px;
    background-color: #006400;
    border-radius: 50%;
    position: relative;
}

.connection-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background-color: white;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Game Area (Board and Controls) */
.game-area {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
}

/* Scrabble Board */
.board-container {
    margin-bottom: 20px;
}

.scrabble-board {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #006400;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px;
    border: 1px solid black;
}

.board-cell {
    background-color: #006400;
    border: 1px solid #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.board-cell.triple-word {
    background-color: #ff6666;
}

.board-cell.double-word {
    background-color: #ff9999;
}

.board-cell.triple-letter {
    background-color: #6666ff;
}

.board-cell.double-letter {
    background-color: #99ccff;
}

.board-cell.center {
    background-color: #ffcc99;
}

/* Tile Rack */
.tile-rack-container {
    margin-bottom: 20px;
}

.tile-rack {
    width: 100%;
    height: 60px;
    background-color: #006f7f;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    padding: 5px;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.control-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background-color: #006400;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.control-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Recommendation Controls */
.recommendation-controls {
    display: flex;
    justify-content: space-between;
}

.recommendation-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    margin: 0 5px;
    background-color: #006400;
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

.recommendation-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Info Container */
.info-container {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

/* Score and Stats Container */
.score-stats-container {
    display: flex;
    flex-direction: column;
    background-color: #ff99cc;
    border-radius: 20px;
    overflow: hidden;
}

.score-stats-container h2 {
    padding: 10px;
    text-align: center;
    color: white;
    font-weight: bold;
    border-bottom: 1px solid white;
}

.score-section, .stats-section {
    flex: 1;
}

.score-board {
    padding: 15px;
    min-height: 80px;
}

.player-score {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.player-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.human-icon {
    content: "👤";
    font-size: 20px;
}

.cpu-icon {
    content: "🤖";
    font-size: 20px;
}

.game-stats {
    padding: 15px;
    min-height: 80px;
}

/* Game History */
.game-history-container {
    background-color: #ffcc66;
    border-radius: 20px;
    overflow: hidden;
    flex: 1;
}

.game-history-content {
    padding: 15px;
    height: 250px;
    overflow-y: auto;
}

/* Chat Section */
.scrabble-bot-container {
    background-color: #006400;
    border-radius: 20px;
    overflow: hidden;
    flex: 1;
}

.chat-history {
    padding: 15px;
    height: 250px;
    overflow-y: auto;
    background-color: white;
    margin: 10px;
    border-radius: 10px;
}

.chat-input-area {
    display: flex;
    padding: 10px;
}

#chatInput {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    margin-right: 10px;
}

#sendMessageBtn {
    width: 40px;
    height: 40px;
    background-color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.send-icon {
    color: #006400;
    font-size: 18px;
}

/* Tiles */
.tile {
    width: 35px;
    height: 35px;
    background-color: #ffcc99;
    border: 1px solid #ccc;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    position: relative;
    cursor: move;
}

.tile-on-board {
    width: 100%;
    height: 100%;
    cursor: default;
}

.tile-letter {
    font-size: 18px;
}

.tile-value {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
}

/* Message Styling */
.bot-message {
    margin-bottom: 10px;
    color: #006400;
}

.user-message {
    margin-bottom: 10px;
    text-align: right;
    color: #000;
}

/* Game History Entry */
.history-entry {
    margin-bottom: 5px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .info-container {
        grid-column: 1;
        grid-row: 3;
    }
}

/* Board Coordinates */
.board-coordinate {
    position: absolute;
    font-size: 10px;
    color: white;
}

.board-coordinate.top-left {
    top: 2px;
    left: 2px;
} 