/* KTE Connector Frontend Styles - Compact Header Layout */

.kte-vehicle-lookup {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    max-width: 100%;
}

/* Compact Container */
.kte-compact-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Method Selection Tabs - Horizontal, Compact */
.kte-method-tabs {
    display: flex;
    gap: 0;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #f5f5f5;
}

.kte-tab-label {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    transition: all 0.2s ease;
    margin: 0;
    min-width: 0;
    flex: 1;
    justify-content: center;
}

.kte-tab-label:last-child {
    border-right: none;
}

.kte-tab-label:hover {
    background: #e9e9e9;
    color: #333;
}

.kte-tab-active {
    background: #fff !important;
    color: #0073aa !important;
    box-shadow: inset 0 -2px 0 #0073aa;
}

.kte-lookup-type-radio {
    display: none;
}

/* Input Container - Inline Layout */
.kte-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kte-input-section {
    display: none;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.kte-input-active {
    display: flex;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .kte-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kte-input-section {
        flex-direction: column;
    }
    
    .kte-method-tabs {
        flex-direction: column;
    }
    
    .kte-tab-label {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .kte-tab-label:last-child {
        border-bottom: none;
    }
}

/* Compact Form Controls */
.kte-lookup-form {
    max-width: 100%;
    margin: 0;
}

.kte-input-section input,
.kte-input-section select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
    min-width: 100px;
    flex: 1;
    height: 32px;
}

.kte-input-section input:focus,
.kte-input-section select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.kte-input-section input:disabled,
.kte-input-section select:disabled {
    background: #f5f5f5;
    color: #999;
}

/* Compact Search Button */
.kte-lookup-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    height: 32px;
    white-space: nowrap;
    flex-shrink: 0;
}

.kte-lookup-button:hover:not(:disabled) {
    background: #005a87;
}

.kte-lookup-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Manual selection specific - ensure equal width selects */
.kte-input-section[data-section="manual"] {
    min-width: 400px;
}

.kte-input-section[data-section="manual"] select {
    min-width: 80px;
}

/* Single input sections */
.kte-input-section[data-section="registration"],
.kte-input-section[data-section="vin"] {
    min-width: 200px;
}

@media (max-width: 768px) {
    .kte-input-section[data-section="manual"] {
        min-width: auto;
    }
    
    .kte-input-section[data-section="manual"] select {
        min-width: auto;
    }
}

/* Compact Results */
.kte-lookup-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    padding: 8px 12px;
    margin-top: 8px;
}

.kte-compact-result {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.kte-vehicle-info {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Vehicle details display */
.kte-vehicle-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.kte-vehicle-name {
    color: #0073aa;
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: bold;
}

.kte-vehicle-specs {
    margin-bottom: 10px;
    line-height: 1.6;
}

.kte-spec {
    display: inline-block;
    margin-right: 15px;
    color: #555;
}

.kte-spec strong {
    color: #333;
}

.kte-ktype-info {
    color: #777;
    font-size: 0.9em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* Vehicle info loading overlay */
.kte-vehicle-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    z-index: 10;
}

.kte-selected-vehicle {
    position: relative;
}

.kte-vehicle-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: kte-vehicle-spin 1s linear infinite;
}

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

/* Vehicle actions container */
.kte-vehicle-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.kte-clear-vehicle {
    border: none;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    background: #dc3545;
    color: white;
    height: 28px;
    flex-shrink: 0;
    white-space: nowrap;
}

.kte-clear-vehicle:hover {
    background: #c82333;
}

/* Compact Loading */
.kte-lookup-loading {
    text-align: center;
    padding: 12px;
}

.kte-lookup-loading p {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #666;
}

.kte-vehicle-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.kte-vehicle-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: kte-spin 0.8s linear infinite;
}

.kte-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: kte-spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

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



/* Additional Responsive Adjustments */
@media (max-width: 480px) {
    .kte-vehicle-lookup {
        padding: 6px 8px;
    }
    
    .kte-compact-container {
        gap: 6px;
    }
    
    .kte-input-container {
        gap: 6px;
    }
    
    .kte-tab-label {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .kte-input-section input,
    .kte-input-section select {
        font-size: 13px;
        height: 30px;
        padding: 5px 6px;
    }
    
    .kte-lookup-button {
        padding: 5px 12px;
        font-size: 13px;
        height: 30px;
    }
    
    .kte-clear-vehicle {
        padding: 3px 8px;
        font-size: 12px;
        height: 26px;
    }
}