/**
 * Frontend CSS
 * File: assets/css/frontend.css
 */

.ssai-inventory-checker {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ssai-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ssai-filter-section {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.ssai-filter-section label {
    font-weight: 500;
    color: #495057;
}

.ssai-filter-section select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

.ssai-product-section {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ssai-product-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.ssai-product-section select {
    flex: 1;
    min-width: 250px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

#ssai-check-inventory {
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

#ssai-check-inventory:hover {
    background: #005a87;
}

#ssai-check-inventory:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ssai-warehouse-info {
    margin-top: 15px;
    padding: 10px;
    background: #e7f3ff;
    border-left: 4px solid #007cba;
    border-radius: 4px;
}

.ssai-warehouse-info p {
    margin: 0;
    color: #495057;
}

.ssai-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.ssai-loading .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ssai-results {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ssai-results h3 {
    margin-top: 0;
    color: #212529;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.ssai-inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ssai-inventory-table thead {
    background: #f8f9fa;
}

.ssai-inventory-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.ssai-inventory-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.ssai-inventory-table tbody tr:hover {
    background: #f8f9fa;
}

.color-cell {
    font-weight: 500;
}

.color-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

.qty-cell {
    font-weight: 600;
}

.qty-cell.in-stock {
    color: #28a745;
}

.qty-cell.out-of-stock {
    color: #dc3545;
}

.ssai-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.ssai-summary p {
    margin: 5px 0;
    color: #495057;
}

.ssai-summary strong {
    color: #212529;
}

.ssai-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.ssai-error p {
    margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .ssai-filter-section {
        grid-template-columns: 1fr;
    }
    
    .ssai-product-section {
        flex-direction: column;
    }
    
    .ssai-product-section select {
        width: 100%;
    }
    
    #ssai-check-inventory {
        width: 100%;
    }
    
    .ssai-inventory-table {
        font-size: 14px;
    }
    
    .ssai-inventory-table th,
    .ssai-inventory-table td {
        padding: 8px;
    }
}