/**
 * TecDoc Catalog Frontend Styles
 */

/* Form Styles */
.tecdoc-search-form-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tecdoc-search-form {
    max-width: 100%;
}

.tecdoc-form-row {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tecdoc-form-row-2 .tecdoc-form-group {
    flex: 1;
    min-width: 200px;
}

.tecdoc-form-group {
    flex: 1;
    min-width: 100%;
}

.tecdoc-form-group-inline {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.tecdoc-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.tecdoc-input,
.tecdoc-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.tecdoc-input:focus,
.tecdoc-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.tecdoc-input-large {
    flex: 1;
    min-width: 250px;
}

.tecdoc-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.tecdoc-form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Button Styles */
.tecdoc-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    text-decoration: none;
    display: inline-block;
}

.tecdoc-button:hover {
    transform: translateY(-1px);
}

.tecdoc-button:active {
    transform: translateY(0);
}

.tecdoc-button-primary {
    background-color: #0073aa;
    color: #fff;
}

.tecdoc-button-primary:hover {
    background-color: #005a87;
}

.tecdoc-button-secondary {
    background-color: #666;
    color: #fff;
}

.tecdoc-button-secondary:hover {
    background-color: #555;
}

.tecdoc-button-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Simple Form Styles */
.tecdoc-search-form-simple {
    max-width: 600px;
}

/* Loading & Error States */
.tecdoc-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.tecdoc-error {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 15px 0;
}

.tecdoc-error-message {
    margin: 0;
}

.tecdoc-error-message strong {
    font-weight: 600;
    color: #333;
}

.tecdoc-error-message .tecdoc-button {
    margin-top: 10px;
}

/* Info Notice */
.tecdoc-info-notice {
    font-size: 14px;
    line-height: 1.6;
}

.tecdoc-info-notice strong {
    color: #0073aa;
}

/* Results Styles */
.tecdoc-results-wrapper {
    margin: 30px 0;
}

.tecdoc-results-summary {
    margin-bottom: 20px;
    padding: 10px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
}

.tecdoc-results-summary p {
    margin: 0;
    font-weight: 600;
    color: #0073aa;
}

.tecdoc-results-list {
    display: grid;
    gap: 20px;
}

.tecdoc-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Result Item Styles */
.tecdoc-result-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.tecdoc-result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tecdoc-result-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tecdoc-result-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tecdoc-article-number {
    color: #0073aa;
    font-weight: 700;
}

.tecdoc-result-manufacturer {
    color: #666;
    font-size: 14px;
}

.tecdoc-result-id {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.tecdoc-result-body {
    margin-bottom: 15px;
}

.tecdoc-result-section {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.tecdoc-result-section strong {
    color: #333;
    margin-right: 5px;
}

.tecdoc-oe-numbers {
    color: #666;
}

.tecdoc-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.tecdoc-status-active {
    background: #d4edda;
    color: #155724;
}

.tecdoc-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.tecdoc-result-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Pagination Styles */
.tecdoc-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
    padding: 20px 0;
}

.tecdoc-page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    background: #fff;
    transition: all 0.3s;
}

.tecdoc-page-link:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.tecdoc-page-link.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    font-weight: 600;
}

/* Category Search Styles */
.tecdoc-category-search-wrapper {
    position: relative;
}

.tecdoc-search-step {
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    margin-bottom: 20px;
}

.tecdoc-search-step h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.tecdoc-step-description {
    margin-bottom: 20px;
    padding: 10px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.tecdoc-selected-category-name {
    color: #0073aa;
    font-weight: 600;
}

.tecdoc-form-divider {
    margin: 25px 0;
    text-align: center;
    position: relative;
    border-top: 1px solid #ddd;
}

.tecdoc-form-divider span {
    position: relative;
    top: -12px;
    background: #fff;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
}

.tecdoc-input.tecdoc-auto-filled {
    background-color: #e8f5e9;
    border-color: #4caf50;
    cursor: not-allowed;
}

.tecdoc-input.tecdoc-auto-filled:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.tecdoc-success-message {
    color: #155724 !important;
    background: #d4edda;
    padding: 10px;
    border-radius: 4px;
    margin: 0;
}

/* Category Results */
.tecdoc-category-results {
    margin-top: 20px;
}

.tecdoc-category-list {
    display: grid;
    gap: 15px;
}

.tecdoc-category-item {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.tecdoc-category-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.tecdoc-category-header {
    margin-bottom: 10px;
}

.tecdoc-category-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.tecdoc-category-path {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.tecdoc-category-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Parts Results */
.tecdoc-parts-results {
    margin-top: 20px;
}

.tecdoc-parts-list {
    display: grid;
    gap: 15px;
}

.tecdoc-result-part {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
}

.tecdoc-result-number {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Required Field Indicator */
.required {
    color: #d32f2f;
    font-weight: 600;
}

.description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tecdoc-form-row-2 .tecdoc-form-group {
        min-width: 100%;
    }
    
    .tecdoc-form-group-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tecdoc-input-large {
        min-width: 100%;
    }
    
    .tecdoc-form-actions {
        flex-direction: column;
    }
    
    .tecdoc-button {
        width: 100%;
    }
    
    .tecdoc-result-footer {
        flex-direction: column;
    }
    
    .tecdoc-result-footer .tecdoc-button {
        width: 100%;
    }
    
    .tecdoc-category-item {
        padding: 12px;
    }
    
    .tecdoc-search-step {
        padding: 15px;
    }
}

/* Unified Search Form Styles */
.tecdoc-unified-search-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Tab Navigation */
.tecdoc-search-tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    overflow-x: auto;
}

.tecdoc-tab-button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.tecdoc-tab-button:hover {
    background: #e8e8e8;
    color: #333;
}

.tecdoc-tab-button.active {
    background: #fff;
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.tecdoc-tab-icon {
    font-size: 18px;
}

.tecdoc-tab-label {
    display: none;
}

@media (min-width: 768px) {
    .tecdoc-tab-label {
        display: inline;
    }
}

/* Tab Content */
.tecdoc-search-tab-content {
    display: none;
    padding: 30px;
}

.tecdoc-search-tab-content.active {
    display: block;
}

.tecdoc-search-header {
    margin-bottom: 25px;
    text-align: center;
}

.tecdoc-search-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.tecdoc-search-description {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Search Input with Button */
.tecdoc-form-group-search {
    position: relative;
}

.tecdoc-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.tecdoc-input-search {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
}

.tecdoc-search-button {
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tecdoc-search-button:hover {
    background: #005a87;
}

.tecdoc-search-icon {
    font-size: 18px;
}

@media (max-width: 768px) {
    .tecdoc-search-text {
        display: none;
    }
    
    .tecdoc-search-button {
        padding: 12px 15px;
    }
}

/* Auto-suggestions */
.tecdoc-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.tecdoc-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tecdoc-suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.tecdoc-suggestion-item:hover {
    background: #f5f5f5;
}

.tecdoc-suggestion-item:last-child {
    border-bottom: none;
}

.tecdoc-suggestion-item strong {
    color: #0073aa;
    font-weight: 600;
}

/* Advanced Options */
.tecdoc-form-row-collapsible {
    margin-top: 20px;
}

.tecdoc-toggle-advanced {
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.tecdoc-toggle-advanced:hover {
    background: #e8e8e8;
}

.tecdoc-toggle-icon {
    transition: transform 0.3s;
}

.tecdoc-toggle-icon.rotated {
    transform: rotate(180deg);
}

.tecdoc-advanced-options {
    margin-top: 15px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* Vehicle Info Display */
.tecdoc-vehicle-info {
    margin-top: 20px;
    padding: 20px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.tecdoc-vehicle-info h4 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 18px;
}

.tecdoc-vehicle-details {
    display: grid;
    gap: 10px;
}

.tecdoc-vehicle-detail-item {
    display: flex;
    gap: 10px;
}

.tecdoc-detail-label {
    font-weight: 600;
    color: #333;
    min-width: 100px;
}

.tecdoc-detail-value {
    color: #666;
}

/* Modal Styles */
.tecdoc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tecdoc-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tecdoc-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tecdoc-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.tecdoc-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tecdoc-modal-close:hover {
    color: #333;
}

.tecdoc-modal-body {
    padding: 20px;
}

.tecdoc-modal-description {
    margin-bottom: 20px;
    padding: 10px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.tecdoc-modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Loading Spinner */
.tecdoc-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tecdoc-loading {
    text-align: center;
    padding: 40px 20px;
}

.tecdoc-loading-text {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Help Text */
.tecdoc-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* VIN Input Specific */
.tecdoc-input-vin {
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Responsive for Unified Search */
@media (max-width: 768px) {
    .tecdoc-search-tab-content {
        padding: 20px 15px;
    }
    
    .tecdoc-input-wrapper {
        flex-direction: column;
    }
    
    .tecdoc-search-button {
        width: 100%;
        justify-content: center;
    }
    
    .tecdoc-modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .tecdoc-modal-footer {
        flex-direction: column;
    }
    
    .tecdoc-modal-footer .tecdoc-button {
        width: 100%;
    }
}
