/* General Styles */
:root {
    --primary-color: #E94141;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --border-color: #dee2e6;
    --border-radius: 4px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loader Bar Styles */
.tecalliance-loader-bar {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #ff7a7a, var(--primary-color));
    background-size: 200% 100%;
    border-radius: 6px 6px 0 0;
    margin-top: 4px;
    animation: tecalliance-loader-bar-anim 1.2s linear infinite;
    z-index: 1050;
    position: relative;
}

@keyframes tecalliance-loader-bar-anim {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Spinner color override for loading state */
.select2-container.loading-spinner .select2-selection {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 2a10 10 0 0 1 10 10 10 10 0 0 1-10 10 10 10 0 0 1-10-10 10 10 0 0 1 10-10zm0 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" opacity=".2"/><path d="M20 12a8 8 0 0 1-8 8" stroke="%23E94141" stroke-width="2" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/></path></svg>');
    background-position: 95% center;
    background-repeat: no-repeat;
    background-size: 18px;
    z-index: 1050;
}

.select2-container.loading-spinner {
    z-index: 1050 !important;
}

/* Container Styles */
.tecalliance-search-container,
.tecalliance-results-container {
    max-width: 100%;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}


.tecalliance-form-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.tecalliance-form-group {
    flex: 1;
    min-width: 150px;
    position: relative;
    transition: all 0.3s ease;
}

.vehicle-config-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease, margin 0.5s ease;
    opacity: 0;
    margin-top: 0;
    background-color: #fff5f5;
    border-radius: 8px;
}

.vehicle-config-container.active {
    max-height: 200px;
    opacity: 1;
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tecalliance-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.tecalliance-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 15px;
    background-color: white;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tecalliance-select:focus {
    outline: none;
    border-color: #E94141;
    box-shadow: 0 0 0 3px rgba(233, 65, 65, 0.2);
}

/* Button Styles */
.tecalliance-button,
.tecalliance-search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(to right, var(--primary-color), #b53030);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.tecalliance-button:hover:not(:disabled),
.tecalliance-search-button:hover:not(:disabled) {
    background: linear-gradient(to right, #b53030, #8a2626);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 65, 65, 0.2);
}

.tecalliance-button:disabled,
.tecalliance-search-button:disabled {
    background: linear-gradient(to right, #cbd5e0, #a0aec0);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.search-btn-container {
    display: flex;
    align-items: flex-end;
}

/* Select2 Style Overrides */
.select2-container--default .select2-selection--single {
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    padding-left: 12px !important;
    color: #2d3748 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
}

.select2-dropdown {
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.select2-results__option {
    padding: 8px 12px !important;
    transition: background-color 0.2s !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #E94141 !important;
}

/* Results Styles */
.tecalliance-vehicle-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tecalliance-vehicle-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.tecalliance-detail {
    padding: 0.5rem 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.tecalliance-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tecalliance-part-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tecalliance-part-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tecalliance-part-image {
    position: relative;
    padding-top: 75%;
    background-color: var(--light-gray);
}

.tecalliance-part-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.tecalliance-part-info {
    padding: 1.5rem;
}

.tecalliance-part-name {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--dark-gray);
}

.tecalliance-part-number,
.tecalliance-part-price {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.tecalliance-part-description {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.tecalliance-part-specs {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.tecalliance-part-specs h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.tecalliance-part-specs ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tecalliance-part-specs li {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.tecalliance-back-to-search {
    margin-top: 2rem;
    text-align: center;
}

/* Error Styles */
.tecalliance-error {
    text-align: center;
    padding: 2rem;
}

.tecalliance-error p {
    margin-bottom: 1rem;
    color: var(--danger-color);
}

/* Loading States */
.tecalliance-loading {
    opacity: 0.5;
    pointer-events: none;
}

.tecalliance-select.loading + .select2-container .select2-selection {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 2a10 10 0 0 1 10 10 10 10 0 0 1-10 10 10 10 0 0 1-10-10 10 10 0 0 1 10-10zm0 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" opacity=".5" /><path d="M20 12a8 8 0 0 1-8 8" stroke="currentColor" stroke-width="2" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite" /></path></svg>');
    background-position: 95% center;
    background-repeat: no-repeat;
    background-size: 18px;
}

/* Button Animation */
.tecalliance-button {
    position: relative;
    overflow: hidden;
}

.tecalliance-button:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.tecalliance-button:not(:disabled):hover:after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .tecalliance-form-filters {
        flex-wrap: wrap;
    }
    
    .tecalliance-form-group {
        flex: 1 1 calc(33.333% - 16px);
    }
    
    .search-btn-container {
        flex: 1 1 calc(33.333% - 16px);
    }
    
    .tecalliance-search-container,
    .tecalliance-results-container {
        padding: 1.5rem;
        margin: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tecalliance-form-group {
        flex: 1 1 calc(50% - 16px);
    }
    
    .search-btn-container {
        flex: 1 1 100%;
        margin-top: 16px;
    }
    
    .tecalliance-parts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .tecalliance-vehicle-details {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .tecalliance-form-group {
        flex: 1 1 100%;
    }
    
    .tecalliance-search-form {
        padding: 16px;
    }
    
    .tecalliance-search-container,
    .tecalliance-results-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .tecalliance-parts-grid {
        grid-template-columns: 1fr;
    }
} 