@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --accent: #c41e3a;
    --accent-light: #f5f0ed;
}

* {
    font-family: 'Inter', sans-serif;
}

.page-title {
    font-family: 'Playfair Display', serif;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

.hidden-card {
    display: none;
}

.trim-hidden {
    display: none;
}

.trim-visible {
    animation: trimFadeIn 0.3s ease-out;
}

@keyframes trimFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.gradient-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b35 100%);
}

.shadow-lg-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Model Navigation Row */
.model-nav-row {
    display: block;
    padding: 0.75rem 0;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.model-nav-row a {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.model-nav-row a:hover {
    background-color: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

/* Feature check/cross indicators */
.feature-check {
    @apply inline-flex items-center justify-center w-7 h-7 rounded-full bg-emerald-500 text-white font-bold text-sm;
}

.feature-cross {
    @apply inline-flex items-center justify-center w-7 h-7 rounded-full bg-gray-300 text-gray-500 font-bold text-sm;
}

.feature-optional {
    @apply inline-flex items-center justify-center px-2 h-7 rounded-full bg-amber-400 text-amber-900 font-bold text-xs;
}

/* Tag styles */
.tag-base { @apply bg-blue-500 text-white; }
.tag-awd { @apply bg-blue-600 text-white; }
.tag-sunroof { @apply bg-amber-500 text-white; }
.tag-hybrid { @apply bg-emerald-600 text-white; }
.tag-electric { @apply bg-purple-600 text-white; }
.tag-turbo { @apply bg-red-600 text-white; }
.tag-luxury { @apply bg-pink-600 text-white; }
.tag-offroad { @apply bg-orange-600 text-white; }
.tag-eyesight { @apply bg-cyan-600 text-white; }
.tag-7seat { @apply bg-indigo-600 text-white; }

/* Filter button styles */
.filter-btn {
    @apply px-4 py-2 rounded-full border-2 font-semibold text-sm uppercase tracking-wide transition-all cursor-pointer;
}

.filter-btn-inactive {
    @apply border-gray-300 text-gray-700 hover:border-gray-400;
}

.filter-btn.filter-btn-active {
    @apply text-white border-0;
}

/* ========================================
   ENHANCED TRIM SELECTOR STYLES
   ======================================== */

.trim-selector {
    background: #f8fafc;
    border-radius: 12px;
    padding: 6px;
}

.trim-tabs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}

.trim-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px;
    border: 2px solid transparent;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.trim-tab:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.trim-tab-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.trim-tab-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    text-align: center;
    line-height: 1.2;
    transition: color 0.2s ease;
}

/* Active state for trim tabs */
.trim-tab.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.trim-tab.active .trim-tab-indicator {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.trim-tab.active .trim-tab-name {
    font-weight: 700;
}

/* Trim-specific colors */
.trim-tab.base.active .trim-tab-indicator { background: #6b7280; }
.trim-tab.base.active .trim-tab-name { color: #6b7280; }
.trim-tab.base.active { border-color: #6b7280; }

.trim-tab.premium.active .trim-tab-indicator { background: #2563eb; }
.trim-tab.premium.active .trim-tab-name { color: #2563eb; }
.trim-tab.premium.active { border-color: #2563eb; }

.trim-tab.sport.active .trim-tab-indicator { background: #dc2626; }
.trim-tab.sport.active .trim-tab-name { color: #dc2626; }
.trim-tab.sport.active { border-color: #dc2626; }

.trim-tab.limited.active .trim-tab-indicator { background: #d97706; }
.trim-tab.limited.active .trim-tab-name { color: #d97706; }
.trim-tab.limited.active { border-color: #d97706; }

.trim-tab.touring.active .trim-tab-indicator { background: #db2777; }
.trim-tab.touring.active .trim-tab-name { color: #db2777; }
.trim-tab.touring.active { border-color: #db2777; }

.trim-tab.wilderness.active .trim-tab-indicator { background: #ea580c; }
.trim-tab.wilderness.active .trim-tab-name { color: #ea580c; }
.trim-tab.wilderness.active { border-color: #ea580c; }

/* ========================================
   TRIM TAB FILTER MATCH STATES
   ======================================== */

/* Highlighted state - trim matches active filters */
.trim-tab.trim-tab-match {
    box-shadow: 0 0 0 2px #10b981, 0 2px 8px rgba(16, 185, 129, 0.3);
    background: #ecfdf5;
}

.trim-tab.trim-tab-match .trim-tab-indicator {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.trim-tab.trim-tab-match:not(.active) .trim-tab-name {
    color: #059669;
    font-weight: 700;
}

/* Dimmed state - trim does NOT match active filters */
.trim-tab.trim-tab-dimmed {
    opacity: 0.4;
    background: #f1f5f9;
    cursor: pointer;
    pointer-events: auto;
}

.trim-tab.trim-tab-dimmed:hover {
    opacity: 0.6;
    cursor: pointer;
}

.trim-tab.trim-tab-dimmed .trim-tab-indicator {
    background: #d1d5db;
}

.trim-tab.trim-tab-dimmed .trim-tab-name {
    color: #9ca3af;
}

/* When dimmed tab is active, still show it but with muted styling */
.trim-tab.trim-tab-dimmed.active {
    opacity: 0.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ========================================
   TRIM CONTENT STYLES
   ======================================== */

.trim-header {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.trim-header-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trim-header-engine {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.trim-inherits {
    font-size: 10px;
    font-weight: 500;
    text-transform: none;
    opacity: 0.7;
}

.trim-header-adds {
    font-size: 11px;
    color: #374151;
    margin-top: 4px;
    line-height: 1.4;
}

.adds-label {
    font-weight: 600;
    color: #059669;
}

.includes-label {
    font-weight: 600;
    color: #6b7280;
}

/* Trim Added Features Section */
.trim-added-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.trim-added-content {
    overflow-y: auto;
}

.trim-added-content.section-collapsed {
    max-height: 160px;
}

.trim-added-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.trim-added-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trim-added-list li {
    font-size: 12px;
    color: #374151;
    padding: 4px 0;
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
}

.trim-added-list li::before {
    content: '+';
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: 700;
}

/* Expand/collapse toggle button */
.section-toggle-btn {
    display: block;
    width: 100%;
    padding: 6px 0;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6366f1;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease;
}

.section-toggle-btn:hover {
    color: #4338ca;
}

/* Collapsed state — constrain height with scroll */
.trim-added-content.section-collapsed,
.features-content.section-collapsed {
    max-height: 160px;
    overflow-y: auto;
}

/* Scrollbar for trim added section */
.trim-added-content::-webkit-scrollbar {
    width: 4px;
}

.trim-added-content::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 2px;
}

.trim-added-content::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 2px;
}

/* Spec boxes */
.spec-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 6px;
}

.spec-value {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.spec-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ========================================
   FEATURES SECTION
   ======================================== */

.features-section {
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
}

.features-header {
    background: #e2e8f0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.features-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.features-content {
    padding: 12px 14px;
}

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

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #e2e8f0;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    margin-top: 1px;
}

.feature-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

/* Scrollbar styling for features */
.features-content::-webkit-scrollbar {
    width: 4px;
}

.features-content::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 2px;
}

.features-content::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 2px;
}

.features-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ========================================
   OPTIONAL PACKAGES SECTION
   ======================================== */

.optional-packages-section {
    background: #fefce8;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #fde047;
}

.optional-packages-section .features-header {
    background: #fef08a;
}

.optional-packages-section .features-title {
    color: #854d0e;
}

.optional-packages-content {
    padding: 12px 14px;
    max-height: 240px;
    overflow-y: auto;
}

.optional-package {
    margin-bottom: 12px;
}

.optional-package:last-child {
    margin-bottom: 0;
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #fde047;
}

.package-name {
    font-size: 11px;
    font-weight: 700;
    color: #854d0e;
}

.package-code {
    font-size: 10px;
    font-weight: 600;
    color: #a16207;
    background: #fef08a;
    padding: 2px 6px;
    border-radius: 4px;
}

.package-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.package-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
}

.package-feature-item .feature-icon {
    background: #eab308;
    font-size: 9px;
}

.package-feature-item .feature-text {
    font-size: 12px;
    color: #713f12;
}

/* Scrollbar styling for optional packages */
.optional-packages-content::-webkit-scrollbar {
    width: 4px;
}

.optional-packages-content::-webkit-scrollbar-track {
    background: #fef08a;
    border-radius: 2px;
}

.optional-packages-content::-webkit-scrollbar-thumb {
    background: #facc15;
    border-radius: 2px;
}

.optional-packages-content::-webkit-scrollbar-thumb:hover {
    background: #eab308;
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   FAVORITE BUTTON STYLES
   ======================================== */

.favorite-btn {
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.favorite-btn.is-favorite {
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.favorite-btn.is-favorite:hover {
    color: #dc2626;
}

.comparison-card[data-vehicle-id] {
    transition: box-shadow 0.2s ease;
}

.comparison-card:has(.favorite-btn.is-favorite) {
    box-shadow: 0 0 0 2px #ef4444, 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Compare button selected state */
.compare-btn.compare-selected {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
}

.compare-btn.compare-selected:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .trim-tab-name {
        font-size: 9px;
    }

    .spec-value {
        font-size: 12px;
    }

    .feature-text {
        font-size: 11px;
    }
}

/* ========================================
   DETAILS PANEL (Dimensions & What's New)
   ======================================== */

.details-panel {
    animation: detailsSlideDown 0.3s ease-out;
}

.details-panel.hidden {
    display: none;
}

@keyframes detailsSlideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 2000px; }
}

.details-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.details-section {
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.details-section-header {
    background: #e2e8f0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.details-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.details-section-body {
    padding: 12px 14px;
}

/* Dimensions Grid */
.dimensions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.dimension-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid #e2e8f0;
}

.dimension-row:nth-child(odd) {
    background: #f1f5f9;
}

.dimension-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.dimension-value {
    font-size: 12px;
    color: #1e293b;
    font-weight: 700;
}

/* What's New Section */
.details-whats-new-section {
    border-color: #bfdbfe;
}

.whats-new-header {
    background: #dbeafe;
}

.whats-new-header .details-section-title {
    color: #1e40af;
}

.whats-new-summary {
    font-size: 12px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.whats-new-category {
    margin-bottom: 10px;
}

.whats-new-category:last-child {
    margin-bottom: 0;
}

.whats-new-category-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #2563eb;
    margin-bottom: 4px;
}

.whats-new-updates {
    list-style: none;
    padding: 0;
    margin: 0;
}

.whats-new-update-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
    color: #374151;
    line-height: 1.5;
}

.whats-new-bullet {
    color: #2563eb;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Details button active state */
.details-btn.active {
    opacity: 0.9;
}
