/* Battery Parameter Selector with Visual Positioning */
.battery-param-visual-container {
    max-width: 100%;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.battery-param-visual-container h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
}

.battery-visual-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.battery-diagram {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.battery-diagram img {
    width: 100%;
    height: auto;
    display: block;
}

/* Terminal indicators */
.terminal-indicator {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #ccc;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    z-index: 5;
}

.terminal-left {
    top: 20%;
    left: 33%;
}

.terminal-right {
    top: 23%;
    right: 25%;
}

.terminal-positive {
    background: #ff4444;
    border-color: #cc0000;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
}

.terminal-negative {
    background: #4444ff;
    border-color: #0000cc;
    box-shadow: 0 0 15px rgba(68, 68, 255, 0.6);
}

/* Input field positioning on the diagram */
.param-input-overlay {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #0073aa;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
    min-width: 80px;
}

/* Smaller width for dimension fields */
.param-dimension {
    min-width: 60px;
    max-width: 80px;
    padding: 4px 6px;
}

/* Compact width for capacity and CCA fields */
.param-compact {
    min-width: 60px;
    max-width: 80px;
    padding: 4px 6px;
}

.param-input-overlay label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.param-input-overlay input,
.param-input-overlay select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.param-input-overlay input:focus,
.param-input-overlay select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Hide labels for dimension fields only */
.param-dimension label {
    display: none;
}

/* Specific positioning for each parameter */
.param-length {
    bottom: -1%;
    left: 610px;
    transform: translateX(-50%);
}

.param-width {
    bottom: -3%;
    left: 3%;
}

.param-height {
    top: 60%;
    right: 2%;
    transform: translateY(-50%);
}

.param-polarity-left {
    top: 1%;
    left: 45%;
}

.param-polarity-right {
    top: 8%;
    right: 15%;
}

.param-capacity {
    top: 46%;
    left: 480px;
    transform: translateX(-50%);
}

.param-cca {
    top: 62%;
    left: 520px;
    transform: translateX(-50%);
}

/* Additional filters below diagram */
.additional-filters {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.additional-filters h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-field label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.filter-field select,
.filter-field input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background: white;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.search-button,
.reset-button {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.search-button {
    background-color: #0073aa;
    color: white;
}

.search-button:hover {
    background-color: #005a87;
}

.search-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.reset-button {
    background-color: #6c757d;
    color: white;
}

.reset-button:hover {
    background-color: #5a6268;
}

/* Results section */
.param-results {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.param-results h4 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
}

.loading {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
}
/* Buy button styling */
.buy-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0073aa;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.3s;
}

.buy-button:hover {
    background-color: #005a87;
    text-decoration: none;
}

/* Results table styling - matching motx-results-table */
.filter-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-results-table th,
.filter-results-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

.filter-results-table th {
    background-color: #2e7d32;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-results-table tbody tr:hover {
    background-color: #f8f9fa;
}

.filter-results-table tbody tr:last-child td {
    border-bottom: none;
}

.filter-results-table .motx-article {
    font-weight: 600;
    color: #2e7d32;
}

.filter-results-table .motx-type,
.filter-results-table .motx-series {
    color: #666;
    font-size: 12px;
}

.filter-results-table .motx-capacity {
    font-weight: 500;
    color: #333;
}

.filter-results-table .motx-dimensions {
    font-family: monospace;
    font-size: 12px;
    color: #666;
}

.filter-results-table .motx-cca,
.filter-results-table .motx-weight,
.filter-results-table .motx-season {
    color: #666;
    font-size: 12px;
}

.filter-results-table .motx-price {
    font-weight: 600;
    color: #2e7d32;
}

.filter-results-table .motx-buy-column {
    text-align: center;
    width: 100px;
}

.results-summary {
    margin-top: 15px;
    padding: 15px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.results-summary p {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* Mobile responsive for results table */
@media (max-width: 768px) {
    .filter-results-table {
        font-size: 11px;
    }
    
    .filter-results-table th,
    .filter-results-table td {
        padding: 8px 4px;
    }
    
    .filter-results-table th {
        font-size: 10px;
    }
    
    .filter-results-table .motx-dimensions {
        font-size: 10px;
    }
}

/* Very small screens - stack table */
@media (max-width: 600px) {
    .filter-results-table,
    .filter-results-table thead,
    .filter-results-table tbody,
    .filter-results-table th,
    .filter-results-table td,
    .filter-results-table tr {
        display: block;
    }
    
    .filter-results-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .filter-results-table tr {
        border: 1px solid #e0e0e0;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 4px;
        background: white;
    }
    
    .filter-results-table td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    
    .filter-results-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #2e7d32;
        font-size: 11px;
    }
    
    /* Buy button mobile styles */
    .buy-button {
        padding: 8px 12px;
        font-size: 12px;
        width: 100%;
        display: block;
    }
}


/* Mobile responsive */
@media (max-width: 1024px) {
    .param-input-overlay {
        min-width: 100px;
        padding: 6px 8px;
    }
    
    .param-input-overlay label {
        font-size: 10px;
    }
    
    .param-input-overlay input,
    .param-input-overlay select {
        font-size: 12px;
        padding: 4px 6px;
    }
}

@media (max-width: 768px) {
    .battery-param-visual-container {
        padding: 15px;
    }
    
    .battery-visual-wrapper {
        padding: 10px;
    }
    
    /* Stack inputs below diagram on mobile */
    .param-input-overlay {
        position: static !important;
        transform: none !important;
        margin-bottom: 10px;
        min-width: auto;
    }
    
    .battery-diagram {
        margin-bottom: 20px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .search-button,
    .reset-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .battery-param-visual-container h3 {
        font-size: 20px;
    }
    
    .additional-filters h4 {
        font-size: 16px;
    }
}