/* Minimal CSS - Every rule has a purpose */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: white;
    color: #333;
    line-height: 1.6;
}

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

/* Header - Simple and clear */
header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

/* Mode selector - Clear binary choice */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.mode-selector label {
    cursor: pointer;
    padding: 5px 10px;
}

.mode-selector input[type="radio"]:checked + {
    font-weight: bold;
}

/* Controls - Functional, no decoration */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn:hover {
    background: #f5f5f5;
}

.btn:active {
    background: #e8e8e8;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
}

input[type="range"] {
    width: 100px;
}

select {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
}

/* Main visualization area */
.visualization-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.main-view {
    position: relative;
}

canvas {
    border: 1px solid #ddd;
    background: white;
    display: block;
    cursor: pointer;
}

/* Waiter queue - Clear text representation */
.waiter-queue {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #333;
    padding: 10px;
    min-width: 150px;
}

.waiter-queue h3 {
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}

#queueList {
    margin-bottom: 10px;
}

.queue-item {
    padding: 3px 5px;
    margin: 2px 0;
    background: #ffffcc;
    border-left: 3px solid #ffa500;
}

#currentlyEating {
    font-size: 12px;
    padding-top: 8px;
    border-top: 1px solid #ccc;
}

/* Info panel - Information hierarchy */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-panel > div {
    background: #fafafa;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 3px;
}

.info-panel h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

/* Event log - Chronological clarity */
.event-log {
    max-height: 200px;
    overflow-y: auto;
}

#eventLogContent {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.log-entry {
    padding: 2px 0;
    border-bottom: 1px solid #eee;
}

.log-entry.warning {
    background: #fff3cd;
    padding: 2px 4px;
}

.log-entry.error {
    background: #f8d7da;
    padding: 2px 4px;
}

/* State info */
#stateDetails {
    font-size: 14px;
}

#stateDetails > div {
    margin: 5px 0;
}

.warning {
    color: #d9534f;
    font-weight: bold;
}

/* Help text */
.help-text {
    font-size: 13px;
}

.help-text ul {
    list-style: none;
    padding-left: 0;
}

.help-text li {
    padding: 3px 0;
    padding-left: 15px;
    position: relative;
}

.help-text li:before {
    content: "•";
    position: absolute;
    left: 0;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Mobile responsiveness - Function over form */
@media (max-width: 768px) {
    .visualization-container {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    canvas {
        width: 100%;
        height: auto;
    }
}