/* Enhanced Image Styles for Vehicles Page */

/* Brand Logo Enhancements */
.brand-logo {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    background: white;
    padding: 10px;
    border-radius: 8px;
}

/* Model Image Enhancements */
.model-image {
    border: 1px solid #e9ecef;
}

.model-card:hover .model-image {
    border-color: #28a745;
}

/* Variant Image Enhancements */
.variant-image {
    border: 1px solid #e9ecef;
}

.variant-card:hover .variant-image {
    border-color: #007bff;
}

/* High Quality Image Display */
.brand-logo,
.model-image,
.variant-image,
.featured-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
}

/* Loading Placeholder Improvements */
.brand-placeholder,
.model-placeholder,
.variant-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

.brand-placeholder::before,
.model-placeholder::before,
.variant-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Focus and Accessibility Improvements */
.brand-card a:focus,
.model-card a:focus,
.variant-card a:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.brand-card a:focus .brand-logo,
.model-card a:focus .model-image,
.variant-card a:focus .variant-image {
    transform: scale(1.05);
}

/* Print Styles */
@media print {
    .brand-logo,
    .model-image,
    .variant-image {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        filter: none;
        box-shadow: none;
    }
    
    .brand-card,
    .model-card,
    .variant-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .brand-logo {
        background: #2c3e50;
        filter: brightness(1.1) contrast(1.1);
    }
    
    .brand-placeholder,
    .model-placeholder,
    .variant-placeholder {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 50%, #34495e 100%);
        color: #ecf0f1;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .brand-logo,
    .model-image,
    .variant-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Brand Cards - Vertical Layout */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.brand-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #FF0000;
}

.brand-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.brand-logo-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 2rem;
}

.brand-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

.brand-placeholder {
    height: 200px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #999;
    font-weight: bold;
}

.brand-card h3 {
    margin: 0;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.brand-card p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: #666;
    line-height: 1.5;
    text-align: center;
    margin: 0;
    flex-grow: 1;
}

/* Model Cards - Enhanced Vertical Layout */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    padding: 0.5rem;
}

.model-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.model-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #FF0000;
}

.model-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.model-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 0;
    background: #f8f9fa;
    transition: transform 0.4s ease;
}

.model-card:hover .model-image {
    transform: scale(1.05);
}

.model-placeholder {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #dee2e6;
    border-radius: 0;
}

.model-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #ffffff;
    transition: padding 0.3s ease;
}

.model-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.model-card:hover .model-info h3 {
    color: #FF0000;
}

.model-year {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #FF0000 0%, #cc0000 100%);
    color: white;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    align-self: flex-start;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

.price-range {
    font-size: 1.25rem;
    font-weight: 700;
    color: #28a745;
    margin: 0;
    padding: 0.5rem 0;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.model-description {
    color: #666666;
    line-height: 1.7;
    margin: 0;
    flex-grow: 1;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Variant Cards - Vertical Layout */
.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.variant-card {
    /* Remove background and rounded corners */
    background: none;
    border: 2px solid #ddd;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.variant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.variant-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.variant-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    /* Remove rounded corners */
    border-radius: 0;
    /* Remove background */
    background: none;
}

.variant-placeholder {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ccc;
    /* Remove rounded corners */
    border-radius: 0;
}

.variant-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.variant-info h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.variant-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #FF0000;
    margin-bottom: 1rem;
}

.variant-description {
    color: #666;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
}

/* Page Header - Enhanced */
.page-header {
    text-align: center;
    margin-bottom: 3.5rem;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.page-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 1.25rem 0;
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.page-header p {
    font-size: 1.125rem;
    color: #666666;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
    letter-spacing: 0.01em;
    font-weight: 400;
}

.model-meta {
    margin: 1.5rem 0 0 0;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.brand-name {
    color: #FF0000;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 0, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 0, 0.1);
}

/* Vehicle Content Layout - Modern */
.vehicle-content-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Vehicle Header Section */
.vehicle-header-section {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 2rem;
}

.vehicle-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.vehicle-meta-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    min-width: 120px;
}

.meta-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.meta-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #495057;
}

/* Gallery Section */
.gallery-section {
    margin: 3rem 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Variants Section */
.variants-section {
    margin: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 2px;
}

.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.variant-card {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.variant-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.variant-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 0;
    background: none;
}

.variant-info {
    padding: 1.5rem;
}

.variant-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.variant-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #FF0000;
    margin-bottom: 1rem;
}

.variant-description {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Specifications Section */
.specifications-section {
    margin: 4rem 0;
    background: #f8f9fa;
    padding: 3rem;
    border-radius: 12px;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.spec-category {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.spec-category h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.spec-list {
    margin: 0;
}

.spec-list dt {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.spec-list dd {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .brands-grid,
    .models-grid,
    .variants-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0;
    }
    
    .page-header {
        padding: 2rem 1rem;
        margin-bottom: 2.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
        letter-spacing: -0.02em;
    }
    
    .page-header p {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .model-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .model-card {
        border-radius: 8px;
    }
    
    .model-image,
    .model-placeholder {
        height: 220px;
    }
    
    .model-info {
        padding: 1.5rem;
    }
    
    .model-info h3 {
        font-size: 1.35rem;
    }
    
    .price-range {
        font-size: 1.15rem;
    }
    
    .vehicle-content-layout {
        padding: 1rem;
        gap: 2rem;
    }
    
    .vehicle-title {
        font-size: 2rem;
    }
    
    .vehicle-meta-info {
        gap: 1rem;
    }
    
    .meta-item {
        min-width: 100px;
        padding: 0.75rem;
    }
    
    .variants-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .specifications-section {
        padding: 2rem 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .brand-logo-container,
    .brand-placeholder {
        height: 150px;
        padding: 1rem;
    }
    
    .model-image,
    .model-placeholder {
        height: 200px;
    }
    
    .variant-image,
    .variant-placeholder {
        height: 180px;
    }
    
    .brand-card h3,
    .model-info h3,
    .variant-info h3 {
        font-size: 1.25rem;
    }
    
    .page-header {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
        border-radius: 8px;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .page-header p {
        font-size: 0.95rem;
    }
    
    .model-info {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .model-year {
        padding: 0.35rem 0.85rem;
        font-size: 0.8rem;
    }
    
    .price-range {
        font-size: 1.1rem;
    }
    
    .model-description {
        font-size: 0.9rem;
    }
    
    .vehicle-meta-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .meta-item {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .variant-info {
        padding: 1rem;
    }
    
    .spec-category {
        padding: 1.5rem;
    }
}

/* Fade In Effect - Enhanced */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger Animation for Cards */
.model-card {
    animation: slideUpFade 0.5s ease-out backwards;
}

.model-card:nth-child(1) { animation-delay: 0.1s; }
.model-card:nth-child(2) { animation-delay: 0.2s; }
.model-card:nth-child(3) { animation-delay: 0.3s; }
.model-card:nth-child(4) { animation-delay: 0.4s; }
.model-card:nth-child(5) { animation-delay: 0.5s; }
.model-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects */
.model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FF0000, #cc0000);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.model-card:hover::before {
    transform: scaleX(1);
}

/* View Details Button */
.model-card::after {
    content: 'ดูรายละเอียด →';
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    opacity: 0;
    color: #FF0000;
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.model-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.model-card:hover .model-info {
    padding-bottom: 3.5rem;
}

/* CTA Button for Variants */
.variant-cta {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #FF0000, #FF0000);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.variant-cta:hover {
    background: linear-gradient(135deg, #FF0000, #FF0000);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 2rem 0;
}

.empty-state-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #495057;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.empty-state p {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.empty-state a {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #FF0000;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.empty-state a:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.model-card.skeleton .model-image {
    height: 240px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.model-card.skeleton .model-info h3 {
    height: 1.5rem;
    width: 70%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.model-card.skeleton .model-description {
    height: 4rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}