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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header and Navigation */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.8;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.intro {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.intro h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.intro p {
    color: #666;
}

/* Table Container */
.price-table-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

/* Updated Table Controls */
.table-controls {
    display: flex;
    flex-direction: column; /* stack children vertically */
    gap: 1rem; /* spacing between sort dropdown and slider */
    margin-bottom: 1.5rem;
}

.sort-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* space between label and select */
}

.table-controls label {
    font-weight: 500;
}

.table-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.price-range-filter {
    display: flex;
    flex-direction: column; /* label, slider, labels stack vertically */
    gap: 0.5rem; /* spacing between slider and min/max labels */
    flex: 1;
    min-width: 250px;
}

.price-labels {
    font-weight: 500;
    color: #2c3e50;
}

/* Loading and Error States */
.loading, .error {
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
}

.loading {
    color: #666;
}

.error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-radius: 4px;
}

/* Price Table */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.price-table thead {
    background-color: #34495e;
    color: white;
}

.price-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.price-table th:hover {
    background-color: #2c3e50;
}

.price-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.price-table tbody tr:hover {
    background-color: #f9f9f9;
}

.price-table td {
    padding: 1rem;
}

.price-table .vendor {
    font-weight: 500;
    color: #2c3e50;
}

.price-table .price {
    font-weight: 600;
    color: #27ae60;
}

.price-table .price-per-watt {
    font-weight: 500;
    color: #3498db;
}

.price-table a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.price-table a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Slider Track */
.noUi-target {
    background-color: #ecf0f1;
    border-radius: 4px;
    height: 8px;
}

.noUi-connect {
    background-color: #3498db;
}

.noUi-handle {
    border: 2px solid #3498db;
    background-color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    top: -6px;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.noUi-handle:active {
    cursor: grabbing;
}

.noUi-tooltip {
    background-color: #3498db;
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    padding: 2px 6px;
}

/* Info Section */
.info {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.info p {
    color: #666;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
    }

    .price-table {
        font-size: 0.9rem;
    }

    .price-table th,
    .price-table td {
        padding: 0.5rem;
    }
}
