/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    padding: 20px;
}

.game-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 15px;
    overflow: hidden;
}

h2 {
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
    color: #333;
}

/* Game Setup Panel */
#game-setup {
    grid-column: 1;
    grid-row: 1;
    background-color: #f8f8f8;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.connection-status {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #ccc;
}

.indicator.connected {
    background-color: #4CAF50;
}

.indicator.disconnected {
    background-color: #f44336;
}

.button-group {
    display: flex;
    gap: 10px;
}

.primary-button, .secondary-button, .control-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.primary-button {
    background-color: #4CAF50;
    color: white;
}

.primary-button:hover {
    background-color: #45a049;
}

.secondary-button {
    background-color: #f1f1f1;
    color: #333;
}

.secondary-button:hover {
    background-color: #e0e0e0;
}

.control-button {
    background-color: #2196F3;
    color: white;
    flex: 1;
}

.control-button:hover {
    background-color: #0b7dda;
}

/* Game Board */
#game-board-container {
    grid-column: 2;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 500px;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-gap: 1px;
    background-color: #006400; /* Dark green */
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
    height: 100%;
    min-height: 450px;
}

.board-cell {
    aspect-ratio: 1/1;
    background-color: #8FBC8F; /* Light green */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    font-weight: bold;
    font-size: 10px;
    text-align: center;
    transition: background-color 0.2s;
    width: auto;
    min-width: 30px;
    min-height: 30px;
}

/* Bonus Cells */
.double-letter {
    background-color: #87CEEB; /* Light blue */
}

.triple-letter {
    background-color: #1E90FF; /* Blue */
}

.double-word {
    background-color: #FF69B4; /* Pink */
}

.triple-word {
    background-color: #FF0000; /* Red */
}

.center-star {
    background-color: #FFD700; /* Gold */
}

/* Tile Rack */
#player-rack-container {
    grid-column: 1;
    grid-row: 2;
    background-color: #e0f7fa;
}

.tile-rack {
    display: flex;
    gap: 5px;
    padding: 10px;
    min-height: 80px;
    justify-content: center;
    align-items: center;
    background-color: #0277bd; /* Dark blue */
    border-radius: 5px;
}

/* Game Controls */
#game-controls {
    grid-column: 1;
    grid-row: 3;
    background-color: #e8f5e9;
}

.control-button {
    margin-bottom: 5px;
}

.recommendation-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.recommendation-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
}

#accept-recommendation-btn {
    background-color: #4CAF50;
    color: white;
}

#deny-recommendation-btn {
    background-color: #f44336;
    color: white;
}

.hidden {
    display: none;
}

/* Scoreboard */
#scoreboard-container {
    grid-column: 3;
    grid-row: 1;
    background-color: #ffebee; /* Light red */
}

#player-scores {
    margin-bottom: 15px;
}

.player-score {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.player-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: cover;
}

.human-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23333" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z" /></svg>');
}

.robot-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23333" d="M12,2A2,2 0 0,1 14,4C14,4.74 13.6,5.39 13,5.73V7H14A7,7 0 0,1 21,14H22A1,1 0 0,1 23,15V18A1,1 0 0,1 22,19H21V20A2,2 0 0,1 19,22H5A2,2 0 0,1 3,20V19H2A1,1 0 0,1 1,18V15A1,1 0 0,1 2,14H3A7,7 0 0,1 10,7H11V5.73C10.4,5.39 10,4.74 10,4A2,2 0 0,1 12,2M7.5,13A2.5,2.5 0 0,0 5,15.5A2.5,2.5 0 0,0 7.5,18A2.5,2.5 0 0,0 10,15.5A2.5,2.5 0 0,0 7.5,13M16.5,13A2.5,2.5 0 0,0 14,15.5A2.5,2.5 0 0,0 16.5,18A2.5,2.5 0 0,0 19,15.5A2.5,2.5 0 0,0 16.5,13Z" /></svg>');
}

.player-name {
    flex-grow: 1;
    font-weight: bold;
}

.player-score-value {
    font-weight: bold;
    color: #f44336;
}

#game-stats {
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.stat-label {
    font-weight: bold;
}

/* Game History */
#move-history-container {
    grid-column: 3;
    grid-row: 2;
    background-color: #fffde7; /* Light yellow */
}

.history-list {
    overflow-y: auto;
    max-height: 300px;
    min-height: 250px;
    background-color: #fff;
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.history-item {
    padding: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
    border-bottom: none;
}

/* Chat Interface */
#chat-container {
    grid-column: 3;
    grid-row: 3;
    background-color: #e8f5e9; /* Light green */
}

.chat-box {
    background-color: #fff;
    border-radius: 4px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
}

.chat-message.bot {
    background-color: #e8f5e9;
    align-self: flex-start;
}

.chat-message.user {
    background-color: #e3f2fd;
    align-self: flex-end;
    text-align: right;
}

.chat-content {
    word-break: break-word;
}

.chat-input-container {
    display: flex;
    gap: 5px;
}

#chat-input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Tiles */
.tile {
    position: relative;
    width: 40px;
    height: 40px;
    background-color: #f5deb3; /* Wheat color */
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: grab;
    user-select: none;
    z-index: 1;
}

.tile.dragging {
    opacity: 0.6;
    z-index: 1000;
}

.tile.on-board {
    width: 100%;
    height: 100%;
    box-shadow: none;
    border-radius: 0;
}

.tile-value {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 10px;
    font-weight: normal;
}

/* Player-specific tile colors */
.tile.human {
    background-color: #f5deb3; /* Default wheat */
}

.tile.cpu-1 {
    background-color: #b3e5fc; /* Light blue */
}

.tile.cpu-2 {
    background-color: #ffccbc; /* Light orange */
}

.tile.cpu-3 {
    background-color: #c8e6c9; /* Light green */
}

/* Old tiles (darker shade) */
.tile.old {
    opacity: 0.8;
}

/* Recommendation overlay */
.recommendation-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(76, 175, 80, 0.3);
    z-index: 5;
    pointer-events: none;
}

/* Valid/Invalid drop zones */
.valid-drop {
    background-color: rgba(76, 175, 80, 0.3) !important;
}

.invalid-drop {
    background-color: rgba(244, 67, 54, 0.3) !important;
}

/* Game End Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none;
}

/* Responsive design for smaller screens */
@media (max-width: 1000px) {
    .game-container {
        grid-template-columns: 1fr;
    }

    #game-board-container, #player-rack-container, #game-controls, 
    #scoreboard-container, #move-history-container, #chat-container, #game-setup {
        grid-column: 1;
    }

    #game-setup {
        grid-row: 1;
    }

    #game-board-container {
        grid-row: 2;
    }

    #player-rack-container {
        grid-row: 3;
    }

    #game-controls {
        grid-row: 4;
    }

    #scoreboard-container {
        grid-row: 5;
    }

    #move-history-container {
        grid-row: 6;
    }

    #chat-container {
        grid-row: 7;
    }

    .board-grid {
        grid-gap: 0;
    }

    .tile {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
} 