/* ============================================
   Beer Bottling Maintenance Dashboard Styles
   ============================================ */

/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 12px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
    font-size: 1.4em;
    margin-bottom: 8px;
}

/* Tabs navigation */
#tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tab {
    background-color: #34495e;
    color: #ecf0f1;
    border: none;
    padding: 8px 16px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.tab:hover {
    background-color: #3d566e;
}

.tab.active {
    background-color: #f4f6f9;
    color: #2c3e50;
    font-weight: bold;
}

/* Dashboard layout */
.dashboard {
    display: flex;
    min-height: calc(100vh - 110px); /* Adjust based on header height */
}

#tree-container {
    width: 280px;
    min-width: 280px;
    background: white;
    border-right: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

#tree-container h2 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #2c3e50;
}

/* Tree styles */
#tree ul {
    list-style: none;
    padding-left: 20px;
}

#tree li {
    margin: 3px 0;
    cursor: pointer;
    transition: background-color 0.1s;
}

#tree li:hover {
    background-color: #f0f0f0;
}

.tree-node {
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

.tree-node.selected {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
}

/* Category colors for equipment tree */
.cat-A {
    background-color: #90EE90 !important; /* light green */
}

.cat-B {
    background-color: #FFFF00 !important; /* yellow */
}

.cat-C {
    background-color: #FFD580 !important; /* light orange */
}

/* Main content area */
#content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #fafafa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    margin-bottom: 16px;
    color: #2c3e50;
    border-bottom: 2px solid #ddd;
    padding-bottom: 6px;
}

/* Buttons */
button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: 8px;
    margin-bottom: 12px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.controls input[type="date"] {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: #2c3e50;
    color: white;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f5f9;
}

/* Forms within tables */
td input, td select {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

td input:focus, td select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.5);
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 24px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative;
}

.close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 16px;
}

.modal-content label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.modal-content input, .modal-content select {
    width: 100%;
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal-content button {
    margin-top: 8px;
}

/* Canvas styling */
canvas {
    border: 1px solid #ddd;
    background: white;
    margin: 12px 0;
    width: 100%;
    max-width: 800px;
}

/* Gantt chart container */
#procurement-gantt {
    background: white;
    border: 1px solid #ddd;
    margin: 12px 0;
    padding: 16px;
    overflow-x: auto;
    min-height: 200px;
}

/* Section spacing */
#procurement-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ccc;
}

/* Strategy controls */
#strategy-controls {
    background: white;
    padding: 16px;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    margin-top: 12px;
}

#strategy-controls select {
    padding: 6px 12px;
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    #tree-container {
        width: 100%;
        min-width: auto;
        max-height: 300px;
    }
    #tabs {
        flex-direction: column;
    }
}
