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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    overflow: hidden;
}

.dm-console {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.console-header {
    background: #2d2d2d;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #444;
}

.console-header h1 {
    color: #ff6b35;
    font-size: 1.5em;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-controls select, .header-controls button {
    padding: 5px 10px;
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 4px;
}

/* Main Layout */
.console-layout {
    display: flex;
    height: calc(100vh - 60px);
}

.left-panel, .right-panel {
    width: 300px;
    background: #2a2a2a;
    border-right: 1px solid #444;
    overflow-y: auto;
}

.right-panel {
    border-right: none;
    border-left: 1px solid #444;
}

.center-panel {
    flex: 1;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
}

/* Combat Tracker */
.combat-section {
    padding: 15px;
    border-bottom: 1px solid #444;
}

.combat-section h3 {
    color: #ff6b35;
    margin-bottom: 10px;
}

.combat-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.combat-controls button {
    padding: 5px 10px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.combat-controls button:disabled {
    background: #666;
    cursor: not-allowed;
}

.combat-controls button:hover:not(:disabled) {
    background: #b71c1c;
}

#roundCounter {
    color: #ffa726;
    font-weight: bold;
    padding: 5px;
}

.initiative-list {
    max-height: 300px;
    overflow-y: auto;
}

.initiative-item {
    background: #333;
    margin: 5px 0;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #666;
}

.initiative-item.active {
    border-left-color: #4caf50;
    background: #2e4a2e;
}

.initiative-item.player {
    border-left-color: #2196f3;
}

.initiative-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.initiative-name {
    font-weight: bold;
    color: #e0e0e0;
}

.initiative-value {
    background: #555;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.hp-bar {
    background: #444;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.hp-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.3s;
}

.hp-fill.low {
    background: #ff9800;
}

.hp-fill.critical {
    background: #f44336;
}

.conditions {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.condition-tag {
    background: #9c27b0;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

/* Players Section */
.players-section {
    padding: 15px;
}

.players-section h3 {
    color: #2196f3;
    margin-bottom: 10px;
}

.players-list {
    max-height: 400px;
    overflow-y: auto;
}

.player-item {
    background: #333;
    margin: 5px 0;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #2196f3;
}

/* Chat Interface */
.mode-controls {
    padding: 10px;
    background: #2d2d2d;
    border-bottom: 1px solid #444;
    display: flex;
    gap: 20px;
}

.mode-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 10px;
    background: #333;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
}

#sendBtn {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Quick Actions */
.quick-actions {
    padding: 10px;
    background: #2d2d2d;
    border-top: 1px solid #444;
}

.dice-roller h4 {
    color: #ff9800;
    margin-bottom: 10px;
    font-size: 14px;
}

.dice-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dice-builder {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.dice-builder select, .dice-builder input {
    padding: 4px;
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 4px;
}

.dice-builder button {
    padding: 4px 12px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.dice-input {
    display: flex;
    gap: 5px;
    align-items: center;
}

#diceInput {
    width: 80px;
    padding: 5px;
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 4px;
}

#rollBtn {
    padding: 5px 15px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.quick-rolls {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.quick-rolls button {
    padding: 3px 8px;
    background: #666;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.quick-rolls button:hover {
    background: #777;
}

.roll-result {
    margin-top: 10px;
    padding: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    text-align: center;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roll-result.critical {
    background: #2e7d32;
    color: #fff;
}

.roll-result.success {
    background: #1976d2;
    color: #fff;
}

.roll-result strong {
    font-size: 16px;
}

.roll-result small {
    margin-left: 5px;
    opacity: 0.8;
}

/* Map Section */
.map-section, .scene-section, .notes-section {
    padding: 15px;
    border-bottom: 1px solid #444;
}

.map-section h3, .scene-section h3, .notes-section h3 {
    color: #ff9800;
    margin-bottom: 10px;
}

.map-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.map-controls button {
    padding: 5px 10px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.map-preview {
    background: #1a1a1a;
    border: 2px dashed #666;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
}

#sceneText, #campaignNotes {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    background: #333;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 10px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    background: #2d2d2d;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    color: #e0e0e0;
}

.modal-content h3 {
    color: #ff6b35;
    margin-bottom: 15px;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 4px;
}

.modal-content button {
    padding: 8px 16px;
    margin: 5px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.close-modal {
    background: #666 !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .left-panel, .right-panel {
        width: 250px;
    }
}

@media (max-width: 900px) {
    .console-layout {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
        height: 200px;
    }
}