/* Global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.game-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 15px;
    max-width: 1200px;
    width: 100%;
}

/* Game Start Section */
.game-start-section {
    grid-column: 1;
    grid-row: 1;
    background-color: #b3e0e5;
    border-radius: 20px;
    padding: 15px;
    text-align: center;
}

.game-start-section h2 {
    color: white;
    margin-bottom: 15px;
}

.game-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.setup-input {
    width: 80%;
    padding: 8px;
    border-radius: 20px;
    border: none;
    background-color: #a0a0a0;
    color: white;
    text-align: center;
}

.setup-input::placeholder {
    color: white;
}

.setup-btn {
    width: 80%;
    padding: 8px;
    border-radius: 20px;
    border: none;
    background-color: #a0a0a0;
    color: white;
    cursor: pointer;
}

.retry-connection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.link-icon {
    width: 25px;
    height: 25px;
    border: 2px solid #008000;
    border-radius: 50%;
    background-color: transparent;
    position: relative;
}

.connection-text {
    color: #008000;
    font-size: 14px;
}

/* Score and Stats Section */
.score-stats-section {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    background-color: #ff85c0;
    border-radius: 20px;
    overflow: hidden;
}

.score-container, .stats-container {
    flex: 1;
    padding: 15px;
    border: 2px solid black;
}

.score-container h2, .stats-container h2 {
    text-align: center;
    color: white;
    margin-bottom: 15px;
}

.scores {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-score, .cpu-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-icon, .cpu-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.player-icon {
    background-color: white;
    color: black;
}

.cpu-icon {
    background-color: #1e90ff;
    color: white;
}

.score-text {
    color: white;
}

.game-stats {
    color: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Game Board Section */
.board-container {
    grid-column: 1;
    grid-row: 2;
    aspect-ratio: 1/1;
}

.scrabble-board {
    width: 100%;
    height: 100%;
    background-color: #008000;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px;
    border: 2px solid black;
}

.board-cell {
    background-color: #008000;
    border: 1px solid #006600;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 10px;
    color: white;
}

.double-word {
    background-color: #ff6b6b;
}

.triple-word {
    background-color: #ff0000;
}

.double-letter {
    background-color: #6bb5ff;
}

.triple-letter {
    background-color: #0066cc;
}

.center-star {
    background-color: #ff6b6b;
}

.board-cell-label {
    position: absolute;
    font-size: 8px;
    color: white;
    text-align: center;
}

/* Tile Rack Section */
.tile-rack-container {
    grid-column: 1;
    grid-row: 3;
    background-color: #1e90ff;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tile-rack {
    display: flex;
    gap: 5px;
    height: 50px;
}

.tile {
    width: 40px;
    height: 40px;
    background-color: #f5deb3;
    border: 1px solid #8b4513;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
}

.tile-letter {
    font-size: 18px;
    font-weight: bold;
}

.tile-value {
    font-size: 10px;
    align-self: flex-end;
    padding-right: 3px;
}

/* Controls Section */
.controls-container {
    grid-column: 1;
    grid-row: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.control-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    background-color: #34a853;
}

.control-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

.recommendation-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.rec-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
}

.rec-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

#accept-rec-btn {
    background-color: #34a853;
}

#deny-rec-btn {
    background-color: #a0a0a0;
}

/* Game History Section */
.history-section {
    grid-column: 2;
    grid-row: 2;
    background-color: #ffc107;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.history-section h2 {
    text-align: center;
    color: white;
    margin-bottom: 15px;
}

.game-history-content {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    padding: 10px;
    overflow-y: auto;
    max-height: 300px;
}

/* ScrabbleBot Section */
.scrabblebot-section {
    grid-column: 2;
    grid-row: 3 / span 2;
    background-color: #34a853;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.scrabblebot-section h2 {
    text-align: center;
    color: white;
    margin-bottom: 15px;
}

.chat-messages {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    padding: 10px;
    overflow-y: auto;
    margin-bottom: 15px;
    max-height: 300px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #34a853;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Messages in chat */
.bot-message, .user-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
}

.bot-message {
    background-color: #e9e9eb;
    align-self: flex-start;
}

.user-message {
    background-color: #34a853;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

/* Drag and drop */
.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

.tile-placeholder {
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px dashed #fff;
}

/* Responsive design */
@media (max-width: 900px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .game-start-section,
    .score-stats-section,
    .board-container,
    .tile-rack-container,
    .controls-container,
    .history-section,
    .scrabblebot-section {
        grid-column: 1;
    }
    
    .score-stats-section {
        grid-row: 2;
    }
    
    .board-container {
        grid-row: 3;
    }
    
    .tile-rack-container {
        grid-row: 4;
    }
    
    .controls-container {
        grid-row: 5;
    }
    
    .history-section {
        grid-row: 6;
    }
    
    .scrabblebot-section {
        grid-row: 7;
    }
} 