/* Car Damage Diagram Styles - Unified Top-Down View */
.damage-diagram-container {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
}

.damage-legend {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
    font-family: sans-serif;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #555;
    font-weight: bold;
}

.color-box {
    width: 20px;
    height: 12px;
    border-radius: 2px;
}

.color-original {
    background-color: #e0e0e0;
}

.color-painted {
    background-color: #3498db;
}

.color-changed {
    background-color: #e74c3c;
}

/* The Schematic Container */
.car-schematic {
    position: relative;
    width: 240px;
    /* Reduced width for unified view */
    height: 500px;
    margin: 30px auto;
}

/* Common Part Styles */
.car-part {
    position: absolute;
    background-color: #e0e0e0;
    border: 1px solid #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    /* Text visible */
    color: #444;
    /* Dark Text */
    font-weight: bold;
    text-align: center;
    line-height: 1;
    transition: all 0.2s;
    user-select: none;
    z-index: 2;
    box-sizing: border-box;
    padding: 2px;
}

/* Hover Effect */
.car-part:hover {
    filter: brightness(0.95);
    z-index: 10;
    border-color: #666;
}

/* Tooltip - Removed as text is now visible, or keep as full title hover? 
   Let's keep it but maybe only if text is truncated? 
   Actually user just wants names ON parts. I will disable the tooltip to avoid clutter 
   or keep it for full detail if the visible text is short. 
   For now, I'll comment it out or leave it separate. */

.car-part::after {
    content: attr(title);
    /* Show full title on hover */
    display: none;
}

.car-part:hover::after {
    display: block;
    /* Optional: Keep formatting if needed */
    position: absolute;
    top: -20px;
    background: #333;
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 20;
}

/* Colors */
.part-original {
    background-color: #e0e0e0;
    color: #444;
}

.part-painted {
    background-color: #3498db;
    color: #fff;
    border-color: #217dbb;
}

.part-changed {
    background-color: #e74c3c;
    color: #fff;
    border-color: #c0392b;
}


/* --- GEOMETRY: Compact Connected Car --- */

/* 1. FRONT BUMPER */
.part-bumper-front {
    top: 20px;
    left: 45px;
    width: 150px;
    height: 35px;
    border-radius: 20px 20px 5px 5px;
}

/* 2. HOOD (Kaput) */
.part-hood {
    top: 54px;
    /* Touching bumper */
    left: 45px;
    width: 150px;
    height: 90px;
    border-radius: 5px 5px 15px 15px;
}

/* 3. ROOF (Tavan) */
.part-roof {
    top: 143px;
    left: 50px;
    width: 140px;
    height: 110px;
    border-radius: 10px;
    border-bottom: none;
}

/* 4. TRUNK (Bagaj) */
.part-trunk {
    top: 252px;
    left: 45px;
    width: 150px;
    height: 70px;
    border-radius: 5px 5px 0 0;
}

/* 5. REAR BUMPER */
.part-bumper-rear {
    top: 321px;
    left: 45px;
    width: 150px;
    height: 35px;
    border-radius: 0 0 20px 20px;
}


/* --- SIDES --- */
/* Left Side */

.part-fender-fl {
    top: 54px;
    left: 10px;
    width: 36px;
    height: 90px;
    border-radius: 10px 0 0 0;
}

.part-door-fl {
    top: 143px;
    left: 10px;
    width: 36px;
    height: 80px;
}

.part-door-rl {
    top: 222px;
    left: 10px;
    width: 36px;
    height: 80px;
}

.part-fender-rl {
    top: 301px;
    left: 10px;
    width: 36px;
    height: 55px;
    border-radius: 0 0 0 10px;
}


/* Right Side */

.part-fender-fr {
    top: 54px;
    right: 10px;
    width: 36px;
    height: 90px;
    border-radius: 0 10px 0 0;
}

.part-door-fr {
    top: 143px;
    right: 10px;
    width: 36px;
    height: 80px;
}

.part-door-rr {
    top: 222px;
    right: 10px;
    width: 36px;
    height: 80px;
}

.part-fender-rr {
    top: 301px;
    right: 10px;
    width: 36px;
    height: 55px;
    border-radius: 0 0 10px 0;
}


/* --- Wheels (Subtle, Tucked in) --- */
.car-wheel {
    position: absolute;
    width: 15px;
    height: 40px;
    background: #333;
    border-radius: 3px;
    z-index: 1;
}

.wheel-fl {
    top: 75px;
    left: 0;
}

.wheel-fr {
    top: 75px;
    right: 0;
}

.wheel-rl {
    top: 310px;
    left: 0;
}

.wheel-rr {
    top: 310px;
    right: 0;
}

/* Responsive */
@media (max-width: 500px) {
    .car-schematic {
        transform: scale(0.9);
        transform-origin: top center;
    }
}