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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #546e7a;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 10px;
}

.top-grid {
    display: grid;
    grid-template-columns: 220px 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1400px) {
    .container {
        max-width: 100%;
    }
    
    .top-grid {
        grid-template-columns: 200px 1fr 1fr;
        gap: 15px;
    }
    
    .items-list {
        height: 550px;
    }
    
    #powerChart,
    #gisMap {
        height: 400px;
    }
}

@media (max-width: 1200px) {
    .top-grid {
        grid-template-columns: 180px 1fr 1fr;
        gap: 12px;
    }
    
    .items-list {
        height: 500px;
    }
    
    #powerChart,
    #gisMap {
        height: 350px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.1em;
    }
}

@media (max-width: 1024px) {
    .top-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .items-list {
        width: 100%;
        height: 400px;
    }
    
    #powerChart,
    #gisMap {
        height: 450px;
    }
    
    .box {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 1em;
    }
    
    .top-grid {
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .items-list {
        height: 300px;
    }
    
    #powerChart,
    #gisMap {
        height: 350px;
    }
    
    .box {
        padding: 12px;
    }
    
    .map-controls {
        gap: 10px;
        font-size: 13px;
    }
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4CAF50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-buttons {
    display: flex;
    gap: 4px;
}

#homeButton,
#backButton,
#forwardButton {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.2s;
    min-width: 40px;
}

#homeButton:hover,
#backButton:hover:not(:disabled),
#forwardButton:hover:not(:disabled) {
    background-color: #e0e0e0;
    border-color: #999;
}

#backButton:disabled,
#forwardButton:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#powerChart {
    height: 450px;
    width: 100%;
    position: relative;
}

#gisMap {
    height: 450px;
    border-radius: 4px;
}

.items-list {
    width: 100%;
    height: 600px;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.items-list-header {
    font-weight: bold;
    padding: 10px;
    border-bottom: 2px solid #4CAF50;
    background: white;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    color: #2c3e50;
}

.items-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 4px 8px 8px;
}

.items-list-content::-webkit-scrollbar {
    width: 8px;
}

.items-list-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.items-list-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.items-list-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.items-list-item {
    padding: 8px;
    margin-bottom: 4px;
    margin-right: 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
    line-height: 1.3;
}

.items-list-item:hover {
    background-color: #e3f2fd;
}

.items-list-item.selected {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
}

.items-list-item.hovered {
    background-color: #fff9c4;
}

.power-node {
    cursor: pointer;
    transition: all 0.2s;
}

.power-node.selected circle {
    stroke-width: 2px;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.3));
}

.power-connection {
    stroke: #666;
    stroke-width: 1.5;
    opacity: 0.6;
    fill: none;
}

.grid line {
    stroke: #e0e0e0;
    stroke-width: 1;
}

.quadrant {
    opacity: 0.15;
}

.quadrant-label {
    font-size: 16px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
    fill: #333;
}

.map-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.map-controls label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.map-controls input[type="checkbox"] {
    cursor: pointer;
}

.map-controls select {
    cursor: pointer;
}

#infoBox {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    min-height: 200px;
}

#infoBox h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    text-align: left;
}

#infoBox h2 {
    margin-top: 20px;
}

#infoBox h3 {
    margin-top: 20px;
}

#infoBox p {
    margin-bottom: 15px;
}

#infoBox .tagline {
    font-style: italic;
    font-weight: bold;
    color: #78909c;
    margin-bottom: 15px;
}

#infoBox .notes {
    margin-bottom: 20px;
}

#infoBox dl {
    margin: 15px 0;
}

#infoBox dt {
    font-weight: bold;
    color: #2c3e50;
    margin-top: 8px;
}

#infoBox dd {
    margin-left: 0;
    margin-bottom: 8px;
}

#infoBox a {
    color: #2196F3;
    text-decoration: none;
    cursor: pointer;
}

#infoBox a:hover {
    color: #1565C0;
    text-decoration: underline;
}

#infoBox ul {
    margin: 10px 0;
    padding-left: 20px;
}

#infoBox li {
    margin-bottom: 5px;
}

#infoBox table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

#infoBox th {
    background-color: #e0e0e0;
    padding: 8px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ccc;
}

#infoBox td {
    padding: 8px;
    border: 1px solid #ccc;
}

.district-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.district-label div {
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #333;
    font-weight: bold;
    font-size: 12px;
    color: #333;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
