/**
 * BHS Quick Order Styles
 */

.bhs-quick-order-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.bhs-quick-order-container h2 {
    margin-bottom: 10px;
    color: #1d2327;
}

.bhs-quick-order-container > p {
    color: #666;
    margin-bottom: 30px;
}


/* Upload Area */
.bhs-upload-area {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.bhs-upload-area:hover,
.bhs-upload-area.bhs-drag-over {
    border-color: #378C3A;
    background: #f0f9f0;
}

.bhs-upload-icon {
    color: #999;
    margin-bottom: 20px;
}

.bhs-upload-area:hover .bhs-upload-icon,
.bhs-upload-area.bhs-drag-over .bhs-upload-icon {
    color: #378C3A;
}

.bhs-upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.bhs-upload-subtext {
    font-size: 14px;
    color: #888;
}

.bhs-upload-formats {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Processing Indicator */
.bhs-processing {
    text-align: center;
    padding: 60px;
}

.bhs-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #378C3A;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: bhs-spin 1s linear infinite;
}

@keyframes bhs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Extracted Data Section */
.bhs-extracted-data {
    margin-top: 30px;
}

/* Format Detection Banner */
.bhs-format-detected {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: #0056b3;
    font-size: 14px;
}

.bhs-format-detected strong {
    color: #004085;
}

.bhs-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.bhs-section h4 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

/* Items Table */
.bhs-items-table {
    width: 100%;
    border-collapse: collapse;
}

.bhs-items-table th,
.bhs-items-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.bhs-items-table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.bhs-items-table td {
    vertical-align: middle;
}

.bhs-sku-input {
    width: 100%;
    max-width: 220px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.bhs-qty-input {
    width: 60px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.bhs-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.bhs-status-found {
    background: #d4edda;
    color: #155724;
}

.bhs-status-not-found {
    background: #f8d7da;
    color: #721c24;
}

.bhs-remove-item {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
}

.bhs-remove-item:hover {
    color: #a71d2a;
}

.bhs-no-items {
    text-align: center;
    color: #666;
    padding: 30px !important;
}

/* Address Form */
.bhs-address-form {
    max-width: 500px;
}

.bhs-form-row {
    margin-bottom: 15px;
}

.bhs-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
    color: #555;
}

.bhs-form-row input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bhs-form-row input:focus {
    border-color: #378C3A;
    outline: none;
    box-shadow: 0 0 0 2px rgba(55, 140, 58, 0.1);
}

.bhs-form-row-inline {
    display: flex;
    gap: 15px;
}

.bhs-form-row-inline > div {
    flex: 1;
}

.bhs-form-row-inline > div:last-child {
    flex: 0.7;
}

/* Order Notes */
#bhs-order-notes {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
}

/* Action Buttons */
.bhs-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.bhs-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bhs-btn-primary {
    background: #378C3A;
    color: #fff;
}

.bhs-btn-primary:hover {
    background: #2d7531;
}

.bhs-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bhs-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.bhs-btn-secondary:hover {
    background: #5a6268;
}

/* Debug Section */
.bhs-debug {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.bhs-debug h4 {
    margin: 0 0 10px 0;
    color: #666;
}

.bhs-debug pre {
    background: #1d2327;
    color: #f0f0f0;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
}

/* Error State */
.bhs-quick-order-error {
    background: #f8d7da;
    color: #721c24;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.bhs-quick-order-error a {
    color: #721c24;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .bhs-quick-order-container {
        padding: 15px;
    }

    .bhs-upload-area {
        padding: 40px 20px;
    }

    .bhs-form-row-inline {
        flex-direction: column;
        gap: 10px;
    }

    .bhs-actions {
        flex-direction: column;
    }

    .bhs-btn {
        width: 100%;
    }

    .bhs-items-table {
        font-size: 13px;
    }

    .bhs-items-table th,
    .bhs-items-table td {
        padding: 8px 5px;
    }
}

/* Product Search */
.bhs-product-search {
    position: relative;
    max-width: 500px;
    margin: 15px auto 0;
}

#bhs-product-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
}

#bhs-product-search-input:focus {
    border-color: #378C3A;
    outline: none;
}

#bhs-product-search-input::placeholder {
    color: #999;
}

.bhs-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bhs-search-results:empty {
    display: none;
}

.bhs-search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.bhs-search-result-item:last-child {
    border-bottom: none;
}

.bhs-search-result-item:hover {
    background: #f0f9f0;
}

.bhs-result-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.bhs-result-sku {
    display: block;
    font-size: 12px;
    color: #666;
}

.bhs-search-loading,
.bhs-search-no-results,
.bhs-search-error {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.bhs-search-error {
    color: #dc3545;
}

.bhs-no-items p {
    margin: 0 0 10px 0;
    color: #666;
}

.bhs-add-more-row td {
    padding-top: 15px !important;
    border-top: 1px dashed #ddd;
}

.bhs-add-more-row .bhs-product-search {
    margin-top: 0;
}

/* Shipping Label Upload (smaller version) */
.bhs-section-desc {
    color: #666;
    font-size: 14px;
    margin: 0 0 15px 0;
}

.bhs-upload-area-small {
    padding: 25px 20px;
    border-width: 2px;
}

.bhs-upload-icon-small {
    color: #999;
    margin-bottom: 10px;
}

.bhs-upload-area-small:hover .bhs-upload-icon-small,
.bhs-upload-area-small.bhs-drag-over .bhs-upload-icon-small {
    color: #378C3A;
}

.bhs-upload-text-small {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin: 0;
}

/* Label Status (after upload) */
.bhs-label-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-top: 10px;
}

.bhs-label-filename {
    color: #155724;
    font-weight: 500;
    font-size: 14px;
}

.bhs-label-filename::before {
    content: "\2713 ";
    font-weight: bold;
}

.bhs-label-remove {
    background: none;
    border: none;
    color: #721c24;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.bhs-label-remove:hover {
    color: #a71d2a;
}
