/* ==============================================
   Fahrzeugmodell-Details Shortcode Styles
============================================== */

.fm-vehicle-details {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.fm-vehicle-details-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 8px;
}

.fm-vehicle-details-error,
.fm-vehicle-details-empty {
    padding: 10px;
    border-radius: 4px;
    font-style: italic;
    color: #666;
}

.fm-vehicle-details-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.fm-vehicle-details-empty {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ==============================================
   Gruppierte Ansicht
============================================== */

.fm-manufacturer-group {
    margin-bottom: 25px;
}

.fm-manufacturer-group:last-child {
    margin-bottom: 0;
}

.fm-manufacturer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2271b1;
    border-left: 4px solid #2271b1;
    padding-left: 12px;
}

.fm-manufacturer-logo {
    max-width: 40px;
    max-height: 20px;
    object-fit: contain;
}

.fm-manufacturer-logo-inline {
    max-width: 30px;
    max-height: 15px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 5px;
}

.fm-vehicle-archive-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.fm-vehicle-archive-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* ==============================================
   Listen-Layout (Standard)
============================================== */

.fm-layout-list .fm-vehicles-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fm-layout-list .fm-vehicle-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    line-height: 1.5;
}

.fm-layout-list .fm-vehicle-item:last-child {
    border-bottom: none;
}

.fm-layout-list .fm-manufacturer {
    color: #2271b1;
}

.fm-layout-list .fm-model {
    font-weight: 500;
}

.fm-layout-list .fm-type,
.fm-layout-list .fm-execution,
.fm-layout-list .fm-wheelbase {
    color: #666;
}

.fm-layout-list .fm-years {
    color: #888;
    font-size: 0.9em;
}

/* ==============================================
   Tabellen-Layout
============================================== */

.fm-layout-table .fm-vehicles-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fm-layout-table .fm-vehicles-table th {
    background: #2271b1;
    color: #fff;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.fm-layout-table .fm-vehicles-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.fm-layout-table .fm-vehicle-row:nth-child(even) {
    background-color: #f8f9fa;
}

.fm-layout-table .fm-vehicle-row:hover {
    background-color: #e3f2fd;
}

.fm-layout-table .fm-manufacturer {
    color: #2271b1;
    font-weight: 500;
}

.fm-layout-table .fm-model {
    font-weight: 500;
}

.fm-layout-table .fm-years {
    white-space: nowrap;
    color: #666;
}

/* ==============================================
   Karten-Layout
============================================== */

.fm-layout-cards .fm-vehicles-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin: 0;
}

.fm-layout-cards .fm-vehicle-card {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.fm-layout-cards .fm-vehicle-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.fm-layout-cards .fm-vehicle-primary {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.fm-layout-cards .fm-manufacturer {
    color: #2271b1;
}

.fm-layout-cards .fm-vehicle-details {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

/* ==============================================
   Kompaktes Layout
============================================== */

.fm-layout-compact .fm-vehicles-compact {
    line-height: 1.6;
}

.fm-layout-compact .fm-vehicle-compact-item {
    display: inline;
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    margin-right: 2px;
}

.fm-layout-compact .fm-separator {
    margin: 0 4px;
    color: #666;
}

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

@media (max-width: 768px) {
    .fm-vehicle-details {
        margin: 15px 0;
        padding: 12px;
    }
    
    .fm-vehicle-details-title {
        font-size: 16px;
    }
    
    /* Tabelle auf mobilen Geräten scrollbar machen */
    .fm-layout-table .fm-vehicles-table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .fm-layout-table .fm-vehicles-table thead,
    .fm-layout-table .fm-vehicles-table tbody,
    .fm-layout-table .fm-vehicles-table th,
    .fm-layout-table .fm-vehicles-table td,
    .fm-layout-table .fm-vehicles-table tr {
        display: block;
    }
    
    .fm-layout-table .fm-vehicles-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .fm-layout-table .fm-vehicles-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 4px;
        background: #fff;
    }
    
    .fm-layout-table .fm-vehicles-table td {
        border: none;
        position: relative;
        padding: 6px 8px 6px 35%;
        white-space: normal;
        text-align: left;
    }
    
    .fm-layout-table .fm-vehicles-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 30%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #333;
    }
    
    /* Karten auf mobilen Geräten einspaltig */
    .fm-layout-cards .fm-vehicles-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .fm-manufacturer-title {
        font-size: 14px;
    }
}

/* ==============================================
   Print Styles
============================================== */

@media print {
    .fm-vehicle-details {
        background: #fff;
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .fm-vehicle-archive-link {
        text-decoration: none;
        color: #000;
    }
    
    .fm-layout-cards .fm-vehicle-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ==============================================
   Accessibility Improvements
============================================== */

.fm-vehicle-archive-link:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.fm-manufacturer-logo,
.fm-manufacturer-logo-inline {
    alt: attr(alt);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fm-vehicle-details {
        border: 2px solid #000;
        background: #fff;
    }
    
    .fm-layout-cards .fm-vehicle-card {
        border: 2px solid #000;
        background: #fff;
    }
    
    .fm-layout-table .fm-vehicles-table th {
        background: #000;
        color: #fff;
    }
}
