/* Enhanced HS Code Search Styles */

/* Search Tabs */
.hs-search-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.hs-search-tab {
    flex: 1;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    border-right: 1px solid #ddd;
}

.hs-search-tab:last-child {
    border-right: none;
}

.hs-search-tab:hover {
    background-color: #e9ecef;
    color: #333;
}

.hs-search-tab.active {
    background-color: #2271b1;
    color: white;
}

/* Search Content Areas */
.hs-search-content {
    padding: 20px 0;
}

/* Quick Search */
.hs-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.hs-search-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.hs-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.hs-search-input.invalid {
    border-color: #d63384;
    background-color: #fdf2f2;
}

.hs-search-btn {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.hs-search-btn:hover {
    background-color: #135e96;
}

.hs-search-btn.secondary {
    background-color: #6c757d;
}

.hs-search-btn.secondary:hover {
    background-color: #565e64;
}

.hs-search-examples {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

/* Advanced Search Grid */
.hs-search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.hs-search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.hs-search-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
}

.hs-search-actions {
    display: flex;
    gap: 10px;
}

/* Browse by Chapter */
.hs-chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.hs-chapter-item {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f8f9fa;
}

.hs-chapter-item:hover {
    border-color: #2271b1;
    background-color: #f0f6fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hs-chapter-item.selected {
    border-color: #2271b1;
    background-color: #e7f3ff;
}

.hs-chapter-item h4 {
    margin: 0 0 8px 0;
    color: #2271b1;
    font-size: 16px;
    font-weight: 600;
}

.hs-chapter-item p {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.hs-chapter-item small {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

/* Search Results */
.hs-search-results {
    margin-top: 25px;
}

#hs-search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#hs-search-results-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.hs-results-count {
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

/* Result Items */
.hs-search-result-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background-color: white;
    transition: all 0.2s;
}

.hs-search-result-item:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hs-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hs-result-code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #2271b1;
    background-color: #f0f6fc;
    padding: 6px 12px;
    border-radius: 4px;
}

.hs-result-full-code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #666;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.hs-result-chapter {
    background-color: #e7f3ff;
    color: #2271b1;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #b8d4f0;
}

.hs-result-description {
    color: #333;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 12px;
    font-weight: 500;
}

.hs-result-chapter-desc,
.hs-result-keywords,
.hs-result-unit {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.hs-result-keywords strong,
.hs-result-chapter-desc strong,
.hs-result-unit strong {
    color: #333;
}

.hs-result-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* Smart Suggestions */
.hs-suggestions-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.hs-suggestions-section h4 {
    margin: 0 0 15px 0;
    color: #2271b1;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-suggestions-section h4:before {
    content: "🎯";
    font-size: 18px;
}

.hs-smart-suggestion-item {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.hs-smart-suggestion-item:hover {
    border-color: #00a32a;
    box-shadow: 0 2px 8px rgba(0, 163, 42, 0.1);
}

.hs-suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hs-suggestion-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #00a32a;
    background-color: #f0f9f0;
    padding: 4px 10px;
    border-radius: 4px;
}

.hs-suggestion-score {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.hs-suggestion-description {
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.hs-suggestion-reason {
    color: #666;
    font-size: 12px;
    margin-bottom: 12px;
}

.hs-suggestion-select {
    background-color: #00a32a !important;
    border-color: #00a32a !important;
}

.hs-suggestion-select:hover {
    background-color: #008a00 !important;
    border-color: #008a00 !important;
}

/* Loading States */
.hs-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.hs-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 15px auto;
}

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

/* No Results */
.hs-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.hs-no-results p {
    margin: 0;
    font-size: 15px;
}

/* Enhanced Notices */
.hs-code-notice {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 1000000;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    min-width: 280px;
    text-align: center;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hs-code-notice-success {
    background-color: #00a32a;
}

.hs-code-notice-error {
    background-color: #d63384;
}

.hs-code-notice-warning {
    background-color: #ffc107;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hs-search-grid {
        grid-template-columns: 1fr;
    }

    .hs-chapters-grid {
        grid-template-columns: 1fr;
    }

    .hs-search-row {
        flex-direction: column;
    }

    .hs-search-actions {
        flex-direction: column;
    }

    .hs-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #hs-search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hs-suggestion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hs-search-tabs {
        flex-direction: column;
    }

    .hs-search-tab {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .hs-search-tab:last-child {
        border-bottom: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hs-search-result-item,
    .hs-smart-suggestion-item {
        border-width: 2px;
    }

    .hs-chapter-item {
        border-width: 3px;
    }
}