/**
 * TECTUM Car Configurator Styles
 * Modern, clean design following best UI/UX practices
 * Updated: Gray hover colors and theme-compatible buttons
 */

/* Variables */
:root {
    --tectum-primary: #000000;
    --tectum-secondary: #666666;
    --tectum-hover: #4a4a4a; /* Changed from red to gray */
    --tectum-light: #f5f5f5;
    --tectum-white: #ffffff;
    --tectum-border: #e0e0e0;
    --tectum-shadow: rgba(0, 0, 0, 0.1);
    --tectum-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.tectum-configurator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.tectum-configurator-header {
    text-align: left;
    margin-bottom: 40px;
}

.tectum-configurator-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 500;
    line-height: 1.2;
    color: var(--tectum-primary);
    margin: 0;
}

/* Stepper Container */
.stepper {
    background: var(--tectum-white);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* Step Header */
.tectum-step-header {
    display: flex;
    justify-content: space-between;
    padding: 0px;
    position: relative;
    user-select: none;
    background: #f8f8f8;
}

.tectum-step-header-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: var(--tectum-transition);
}

/* Active step background */
.tectum-step-header-item.active {
    background: #e8e8e8;
 
    padding: 40px 20px;
}

.tectum-step-header-item:first-child.active {
    margin-left: -40px;
    padding-left: 40px;
}

.tectum-step-header-item:last-child.active {
    margin-right: -40px;
    padding-right: 40px;
}

/* Step numbers container */
.tectum-step-number {
    text-align: center;
    transition: var(--tectum-transition);
    z-index: 2;
    padding: 10px 20px;
    border-radius: 8px;
}

.tectum-step-number span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 5px;
    font-weight: 400;
}

.tectum-step-header-item.active .tectum-step-number span {
    color: #666;
}

.tectum-step-number h2 {
    font-size: 42px;
    font-weight: 700;
    margin: 0;
    color: #333;
    transition: var(--tectum-transition);
    line-height: 1;
}

/* Step Lines - Fixed positioning */
.tectum-step-line {
    position: absolute;
    height: 1px;
    background: #333;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--tectum-transition);
    z-index: 1;
    width: calc(100% - 60px);
}

/* Line between step 1 and 2 */
.tectum-step-header-item:nth-child(1) .tectum-step-line {
    left: calc(50% + 30px);
    right: calc(-50% + 30px);
}

/* Line between step 2 and 3 */
.tectum-step-header-item:nth-child(2) .tectum-step-line {
    left: calc(50% + 30px);
    right: calc(-50% + 30px);
}

/* Hide line on last step */
.tectum-step-header-item:last-child .tectum-step-line {
    display: none;
}

/* Single Arrow - Only show right arrow after active steps */
.tectum-step-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    transition: var(--tectum-transition);
    display: none;
    border-width: 12px 0 12px 16px;
    border-color: transparent transparent transparent #333333;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

/* Show arrow only after steps 1 and 2 */
.tectum-step-header-item:nth-child(1) .tectum-step-arrow,
.tectum-step-header-item:nth-child(2) .tectum-step-arrow {
    display: block;
}

/* Step Body */
.tectum-step-body {
    min-height: 500px;
    position: relative;
    overflow: hidden;
     padding: 40px 40px 0px 40px;
}

.tectum-step-content {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.tectum-step-content.active {
    display: block;
}

.tectum-step-content h3 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--tectum-primary);
    line-height: 1.3;
}

/* Brand Selection - Updated layout */
.tectum-brand-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* Brand item wrapper to contain both box and name */
.tectum-brand-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tectum-brand-item {
    background: var(--tectum-white);
    border: 1px solid #000;
    
    padding: 30px 20px;
    cursor: pointer;
    transition: var(--tectum-transition);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tectum-brand-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

button.tectum-btn-primary.mt-3 {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase !important;
}


.tectum-brand-item.selected {
  
    border-width: 3px;
    padding: 28px 18px;
}

.tectum-brand-logo {
    position: absolute;
    top: 15px;
    right: 15px;
    width: auto;
    height: 25px;
    opacity: 1;
    transition: var(--tectum-transition);
    z-index: 10;
}

.tectum-car-image {
    max-width: 85%;
    max-height: 140px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    z-index: 1;
    position: relative;
}

.tectum-brand-item:hover .tectum-car-image {
    transform: scale(1.05);
}

/* Specific brand logo sizes - adjusted for better visibility */
.tectum-brand-logo.porsche { height: 20px; }
.tectum-brand-logo.audi { height: 25px; }
.tectum-brand-logo.volkswagen { height: 25px; }
.tectum-brand-logo.seat { height: 20px; }
.tectum-brand-logo.skoda { height: 25px; }
.tectum-brand-logo.cupra { height: 20px; }

/* Brand name outside the box */
.tectum-brand-name {
    text-align: left;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Step Grid Layout */
.tectum-step-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.tectum-step-info p {
    font-size: 14px;
    line-height: 1.4;
    color: var(--tectum-secondary);
    margin-bottom: 0px;
}

.tectum-step-image {
    text-align: center;
}

.tectum-step-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#tectum-configuration-img {
    border: 1px solid var(--tectum-border);
}

/* Buttons - Updated to inherit theme styles */
.tectum-btn-primary,
.tectum-btn-secondary {
    /* Remove fixed styles to inherit from theme */
    font-family: inherit;
    cursor: pointer;
    transition: var(--tectum-transition);
    text-decoration: none;
    border-radius: 6px;
    display: inline-block;
    padding: 14px 32px;
}

/* Primary button - minimal overrides */
.tectum-btn-primary {
    /* Let theme handle most styling */
    background-color: var(--tectum-primary);
    color: var(--tectum-white);
    border: 2px solid var(--tectum-primary);
}

.tectum-btn-primary:hover {
    background-color: var(--tectum-hover);
    border-color: var(--tectum-hover);
    transform: translateY(-2px);
}

/* Secondary button - minimal overrides */
.tectum-btn-secondary {
    background-color: transparent;
    color: var(--tectum-primary);
    border: 2px solid var(--tectum-primary);
}

.tectum-btn-secondary:hover {
    background-color: var(--tectum-primary);
    color: var(--tectum-white);
}

/* Allow theme to override button styles */
.tectum-step-navigation .button,
.tectum-step-navigation .btn,
.tectum-step-navigation .nectar-button {
    /* Theme buttons will take precedence */
    margin: 0 10px;
}

/* Text Triangle Link Style - Updated hover color */
.text-triangle {
    color: var(--tectum-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    position: relative;
    transition: var(--tectum-transition);
}

.text-triangle::after {
    content: '→';
    margin-left: 10px;
    transition: margin-left 0.3s ease;
}

.text-triangle:hover {
    color: var(--tectum-hover); /* Changed from red to gray */
}

.text-triangle:hover::after {
    margin-left: 15px;
}

/* When text-triangle is used as a button */
button.text-triangle {
    background: none;
    border: none;
    padding: 14px 0;
    font-family: inherit;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
}

/* Form Styles */
.tectum-form {
    margin-top: 30px;
}

.tectum-form-group {
    margin-bottom: 24px;
}

.tectum-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.tectum-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--tectum-primary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.tectum-form-group input,
.tectum-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--tectum-border);
    border-radius: 6px;
    background: var(--tectum-white);
    transition: var(--tectum-transition);
    font-family: inherit;
}

.tectum-form-group input:focus,
.tectum-form-group textarea:focus {
    outline: none;
    border-color: var(--tectum-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.tectum-form-group input.error,
.tectum-form-group textarea.error {
    border-color: #dc3545;
}

.tectum-form-group input.error:focus,
.tectum-form-group textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.tectum-form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--tectum-secondary);
}

/* Audi Warning Styles */
.audi-code-warning {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 14px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInWarning 0.4s ease-out;
}

/* Navigation */
.tectum-step-navigation {
    display: flex;
    justify-content: space-between;
   
    padding: 0 40px;
}

/* Loading State */
.tectum-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--tectum-white);
    animation: spin 1s ease-in-out infinite;
}

/* Success Message */
.tectum-success-message {
    background: #4caf50;
    color: white;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    margin-top: 20px;
    animation: fadeInUp 0.5s ease-out;
}

/* Utilities */
.d-none {
    display: none !important;
}

.text-uppercase {
    text-transform: uppercase;
}

.mt-5 {
    margin-top: 3rem;
}

.py-5 {
    padding-bottom: 3rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .tectum-brand-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tectum-configurator-wrapper {
        padding: 40px 15px;
    }
    
    .tectum-step-header {
        padding: 30px 20px;
        flex-direction: column;
        gap: 2rem;
        overflow: visible; /* Ensure arrows aren't clipped */
    }
    
    .tectum-step-header-item {
        width: 100%;
        justify-content: flex-start;
        position: relative;
        padding-right: 40px; /* Make room for arrow */
    }
    
    /* Hide lines on mobile */
    .tectum-step-line {
        display: none;
    }
    
    /* Reposition arrows for mobile */
    .tectum-step-arrow {
        right: 10px; /* Move arrow inside the container */
        border-width: 8px 0 8px 12px; /* Smaller arrow for mobile */
    }
    
    /* Hide arrow on last item in mobile */
    .tectum-step-header-item:last-child .tectum-step-arrow {
        display: none;
    }
    
    /* Adjust active state for mobile */
    .tectum-step-header-item.active {
        margin: 0;
        padding: 20px;
        padding-right: 40px;
        background: #e8e8e8;
        border-radius: 8px;
    }
    
    .tectum-step-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .tectum-form-row {
        grid-template-columns: 1fr;
    }
    
    .tectum-step-content h3 {
        font-size: 24px;
    }
    
    /* Better spacing for step numbers on mobile */
    .tectum-step-number {
        padding: 10px 0;
        text-align: left;
    }
    
    .tectum-step-number h2 {
        font-size: 36px;
    }
}

@media (max-width: 575.98px) {
    .tectum-brand-container {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .tectum-step-image {
        justify-content: center;
        padding-top: 3rem;
    }
    
    .tectum-step-image img {
        width: 100%;
    }
}

/* Salient Theme Compatibility */
.nectar-button.tectum-btn-primary,
.nectar-button.tectum-btn-secondary {
    /* Let Salient handle most button styling */
    margin: 0 5px;
}

/* Override only specific properties if needed */
body .tectum-configurator-wrapper .nectar-button {
    /* Minimal overrides for Salient buttons */
    transition: var(--tectum-transition);
}