/**
 * Car Part Finder - Premium Styles
 */

/* ========================================
   Results Page Styles
   ======================================== */

.carpartfinder-results-page {
    margin: 30px 0;
}

.carpartfinder-vehicle-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

.carpartfinder-vehicle-info i.material-icons {
    font-size: 24px;
}

/* Category Sidebar */
.carpartfinder-categories-sidebar {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
}

.sidebar-title i.material-icons {
    font-size: 24px;
    color: #667eea;
}

.category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-tree.level-0 {
    margin-left: 0;
}

.category-tree.level-1,
.category-tree.level-2 {
    margin-left: 20px;
}

.category-item {
    margin: 5px 0;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-link:hover {
    background: #f8f9fa;
    color: #667eea;
    transform: translateX(5px);
}

.category-item.active > .category-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.category-item.active > .category-link .product-count {
    color: rgba(255, 255, 255, 0.9);
}

.category-link i.material-icons {
    font-size: 18px;
}

.category-name {
    flex: 1;
}

.product-count {
    font-size: 12px;
    color: #999;
    font-weight: 600;
}

/* Products Grid */
.carpartfinder-products-grid {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 25px;
}

.products-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
}

.results-count {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.products .product-miniature {
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.products .product-miniature:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-5px);
}

.product-miniature .thumbnail-container {
    position: relative;
}

.product-miniature .thumbnail {
    display: block;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.product-miniature .thumbnail img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.product-miniature:hover .thumbnail img {
    transform: scale(1.05);
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0;
    line-height: 1.4;
}

.product-title a {
    color: #2c3e50;
    text-decoration: none;
}

.product-title a:hover {
    color: #667eea;
}

.product-desc {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    line-height: 1.6;
}

.product-price-and-shipping {
    margin: 15px 0;
}

.product-price-and-shipping .price {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
}

.product-actions {
    margin-top: 15px;
}

.product-actions .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.carpartfinder-seo-footer {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}

.carpartfinder-seo-footer p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 991px) {
    .carpartfinder-categories-sidebar {
        position: static;
        margin-bottom: 20px;
    }
}

/* ========================================
   Widget Styles - Horizontal Layout
   ======================================== */

.carpartfinder-widget {
    background: #ffffff;
    border-bottom: 3px solid #f0f0f0;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.carpartfinder-form {
    position: relative;
}

.carpartfinder-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.carpartfinder-label-col {
    flex-shrink: 0;
}

.carpartfinder-label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.carpartfinder-label i.material-icons {
    font-size: 24px;
    color: #667eea;
}

.carpartfinder-selects-col {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.carpartfinder-select {
    flex: 1;
    min-width: 150px;
    height: 42px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 0 12px;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.carpartfinder-select:hover {
    border-color: #667eea;
}

.carpartfinder-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.carpartfinder-buttons-col {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.carpartfinder-submit,
.carpartfinder-clear {
    height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.carpartfinder-submit {
    background: #667eea;
    color: #ffffff;
}

.carpartfinder-submit:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.carpartfinder-submit:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.carpartfinder-submit i.material-icons,
.carpartfinder-clear i.material-icons {
    font-size: 18px;
}

.carpartfinder-clear {
    background: #ffffff;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.carpartfinder-clear:hover {
    background: #e74c3c;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* ========================================
   Selected Vehicle Badge - Green
   ======================================== */

.carpartfinder-selected-badge {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.2);
    animation: slideDown 0.4s ease;
}

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

.carpartfinder-selected-badge .badge-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.carpartfinder-selected-badge i.material-icons {
    color: #ffffff;
    font-size: 32px;
    animation: pulse 2s ease infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.carpartfinder-selected-badge .badge-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carpartfinder-selected-badge .badge-title {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carpartfinder-selected-badge .badge-vehicle {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.carpartfinder-selected-badge .btn-change-vehicle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.carpartfinder-selected-badge .btn-change-vehicle:hover {
    background: #ffffff;
    color: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.carpartfinder-selected-badge .btn-change-vehicle i.material-icons {
    font-size: 18px;
    animation: none;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .carpartfinder-row {
        flex-wrap: wrap;
    }
    
    .carpartfinder-selects-col {
        flex: 1 1 100%;
        order: 2;
    }
    
    .carpartfinder-label-col {
        order: 1;
    }
    
    .carpartfinder-buttons-col {
        order: 3;
        width: 100%;
    }
    
    .carpartfinder-submit,
    .carpartfinder-clear {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .carpartfinder-widget {
        padding: 12px 0;
    }
    
    .carpartfinder-row {
        gap: 10px;
    }
    
    .carpartfinder-selects-col {
        flex-direction: column;
        gap: 8px;
    }
    
    .carpartfinder-select {
        width: 100%;
        min-width: auto;
    }
    
    .carpartfinder-label {
        font-size: 14px;
    }
    
    .carpartfinder-selected-badge {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .carpartfinder-selected-badge .badge-content {
        justify-content: center;
    }
    
    .carpartfinder-selected-badge .btn-change-vehicle {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .carpartfinder-label span {
        display: none;
    }
    
    .carpartfinder-select,
    .carpartfinder-submit,
    .carpartfinder-clear {
        height: 38px;
        font-size: 13px;
    }
}

/* ========================================
   Product Page Vehicle Badge
   ======================================== */

.carpartfinder-vehicle-badge-product {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    margin: 15px 0;
    animation: fadeIn 0.5s ease;
}

.carpartfinder-vehicle-badge-product i.material-icons {
    font-size: 20px;
}

.carpartfinder-vehicle-badge-product strong {
    font-weight: 700;
}

/* ========================================
   Loading State
   ======================================== */

.carpartfinder-select.loading {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="none" stroke="%23667eea" stroke-width="2" stroke-dasharray="40" stroke-dashoffset="0"><animateTransform attributeName="transform" type="rotate" from="0 10 10" to="360 10 10" dur="1s" repeatCount="indefinite"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ========================================
   Admin Panel Styles
   ======================================== */

#carpartfinder-product-vehicles .panel-heading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
}

#carpartfinder-product-vehicles .panel-heading i {
    margin-right: 8px;
}

.carpartfinder-vehicle-selector {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.carpartfinder-assigned-vehicles {
    border-radius: 8px;
    overflow: hidden;
}

#cpf-vehicles-table {
    margin-bottom: 0;
}

#cpf-vehicles-table thead {
    background: #667eea;
    color: #ffffff;
}

#cpf-vehicles-table tbody tr:hover {
    background: #f8f9fa;
}

.cpf-remove-vehicle {
    color: #e74c3c;
}

.cpf-remove-vehicle:hover {
    background: #e74c3c;
    color: #ffffff;
}

/* ========================================
   Animations
   ======================================== */

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

.carpartfinder-selected {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.carpartfinder-submit:not(:disabled):active {
    animation: pulse 0.3s ease;
}

/* ========================================
   Product Page Compatibility Section
   ======================================== */

.carpartfinder-product-compatibility {
    margin: 30px 0;
    padding: 0;
}

.carpartfinder-match-badge {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    animation: fadeIn 0.4s ease-out;
}

.carpartfinder-match-badge i.material-icons {
    font-size: 48px;
    animation: pulse 2s ease-in-out infinite;
}

.match-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.match-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.match-subtitle {
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.4;
}

.carpartfinder-nomatch-badge {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.carpartfinder-nomatch-badge i.material-icons {
    font-size: 40px;
}

.nomatch-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nomatch-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.nomatch-subtitle {
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.4;
}

.carpartfinder-compatible-vehicles {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 25px;
}

.compatibility-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.compatibility-title i.material-icons {
    font-size: 28px;
    color: #3498db;
}

.vehicles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 12px;
}

.vehicle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.vehicle-item:hover {
    background: #e8f5e9;
    border-color: #27ae60;
    transform: translateX(5px);
}

.vehicle-item i.material-icons {
    font-size: 20px;
    color: #27ae60;
}

.vehicle-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
}

/* ========================================
   Product Tabs - Compatibility & OE Codes
   ======================================== */

.carpartfinder-compatibility-content,
.carpartfinder-oe-codes-content {
    padding: 20px 0;
}

.compatibility-header,
.oe-codes-header {
    margin-bottom: 20px;
}

.compatibility-header h3,
.oe-codes-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.compatibility-table {
    width: 100%;
    margin-top: 20px;
}

.compatibility-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
}

.compatibility-table tbody td {
    padding: 12px;
    vertical-align: middle;
}

.compatibility-table tbody tr:hover {
    background: #f8f9fa;
}

.oe-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.oe-manufacturer-block {
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.oe-manufacturer-block h4 {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oe-codes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.oe-code-badge {
    display: inline-block;
    padding: 6px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.nav-tabs .nav-link i.material-icons {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 5px;
}

@media (max-width: 768px) {
    .vehicles-list {
        grid-template-columns: 1fr;
    }
    
    .carpartfinder-match-badge,
    .carpartfinder-nomatch-badge {
        flex-direction: column;
        text-align: center;
    }
    
    .match-title,
    .nomatch-title {
        font-size: 18px;
    }
    
    .compatibility-table {
        font-size: 12px;
    }
    
    .oe-codes-grid {
        grid-template-columns: 1fr;
    }
}
