.car-swiper-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    height: 800px;
}

.car-swiper-cards {
    width: 100%;
    height: 100%;
    position: relative;
}

.car-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.car-images-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    /* min-height: 250px; */
}

.car-images-container {
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    font-size: 0; /* Убираем возможные текстовые пробелы */
    line-height: 0; /* Убираем лишние пробелы */
}

.car-image {
    width: 100%;
    position: relative;
    scroll-snap-align: start;
    height: 390px;
    line-height: 0; /* Убираем лишние пробелы */
    font-size: 0; /* Убираем возможные текстовые пробелы */
    margin: 0; /* Убираем внешние отступы */
}

.car-image img {
    width: 100%;
    height: 100%;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    object-fit: cover;
    margin: 0; /* Убираем внешние отступы */
    padding: 0; /* Убираем внутренние отступы */
}

.car-info {
    position: relative;
    width: 100%;
    background: white;
    padding: 15px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    overflow-y: visible;
    max-height: none;
}

.car-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 5px 0;
    display: flex;
    align-items: baseline;
}

.car-age {
    font-size: 20px;
    font-weight: normal;
    margin-left: 8px;
    color: #333;
}

.car-location {
    font-size: 16px;
    color: #666;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
}

.car-location-icon {
    margin-right: 5px;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.car-bio {
    margin: 0 0 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    color: #333;
    line-height: 1.4;
}

.car-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #666;
    margin: 15px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.car-essentials {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.car-essential-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 10px;
    color: #333;
}

.car-essential-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.car-essential-icon.transmission {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/></svg>');
}

.car-essential-icon.year {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"/></svg>');
}

.car-essential-icon.fuel {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M19.77 7.23l.01-.01-3.72-3.72L15 4.56l2.11 2.11c-.94.36-1.61 1.26-1.61 2.33 0 1.38 1.12 2.5 2.5 2.5.36 0 .69-.08 1-.21v7.21c0 .55-.45 1-1 1s-1-.45-1-1V14c0-1.1-.9-2-2-2h-1V5c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v16h10v-7.5h1.5v5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V9c0-.69-.28-1.32-.73-1.77zM12 13.5V19H6v-7h6v1.5zm0-3.5H6V5h6v5zm6 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/></svg>');
}

.car-essential-icon.mileage {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/></svg>');
}

.car-essential-icon.body {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.85 7h10.29l1.08 3.11H5.77L6.85 7zM19 17H5v-5h14v5z"/><circle cx="7.5" cy="14.5" r="1.5"/><circle cx="16.5" cy="14.5" r="1.5"/></svg>');
}

.car-looking-for {
    margin-bottom: 15px;
}

.car-looking-item {
    background-color: #f0f2f5;
    border-radius: 20px;
    padding: 8px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    display: inline-block;
    color: #333;
}

.car-details {
    margin: 0;
}

.car-details p {
    margin: 5px 0;
    font-size: 16px;
    display: none; /* Hide the original details */
}

.car-swiper-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
}

.like-button,
.dislike-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.like-button {
    background: #4CAF50;
    color: white;
}

.dislike-button {
    background: #f44336;
    color: white;
}

.like-button:hover,
.dislike-button:hover {
    transform: scale(1.1);
}

.car-card.swiped-left {
    transform: translateX(-150%) rotate(-30deg);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.car-card.swiped-right {
    transform: translateX(150%) rotate(30deg);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Swipe indicator visualization */
@keyframes swipe-hint-right {
    0%, 100% { opacity: 0; }
    50% { transform: translateX(20px); opacity: 1; }
}

@keyframes swipe-hint-left {
    0%, 100% { opacity: 0; }
    50% { transform: translateX(-20px); opacity: 1; }
}

/* Hide swipe area */
.swipe-area {
    display: none;
}

/* Match overlay */
.match-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #ff3366, #ff6633);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.match-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.match-content {
    text-align: center;
    padding: 20px;
    color: white;
    max-width: 90%;
}

.match-title {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.match-images {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.match-car-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    object-fit: cover;
    margin: 0 10px;
    background-position: center; /* Center the image */
    background-size: cover; /* Cover the circle */
}

.match-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.match-button {
    padding: 15px 20px;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.match-button:hover {
    transform: scale(1.05);
}

.match-button.continue {
    background-color: white;
    color: #ff3366;
}

.match-button.chat {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

/* Chat interface */
.chat-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Desktop chat styles */
@media (min-width: 768px) {
    .chat-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 600px;
        margin: 0 auto;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
}

.chat-container.visible {
    opacity: 1;
    pointer-events: auto;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #ff3366;
    color: white;
}

@media (min-width: 768px) {
    .chat-header {
        border-radius: 10px 10px 0 0;
    }
}

.chat-back {
    margin-right: 15px;
    cursor: pointer;
    font-size: 20px;
}

.chat-car-info {
    display: flex;
    align-items: center;
}

.chat-car-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    margin-right: 10px;
    background-position: center;
    background-size: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chat-car-name {
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 18px;
    word-break: break-word;
    animation: messageAppear 0.3s ease forwards;
}

@keyframes messageAppear {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.car {
    align-self: flex-start;
    background: #eee;
    color: #333;
    border-bottom-left-radius: 5px;
}

.chat-message.user {
    align-self: flex-end;
    background: #ff3366;
    color: white;
    border-bottom-right-radius: 5px;
}

.chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
}

@media (min-width: 768px) {
    .chat-input-container {
        border-radius: 0 0 10px 10px;
    }
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 24px;
    outline: none;
}

.chat-send {
    margin-left: 10px;
    width: 45px;
    height: 45px;
    background: #ff3366;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-send:hover {
    background: #e62958;
}

.chat-message-typing {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    max-width: 80px;
    background: #eee;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
    margin-bottom: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    margin: 0 2px;
    animation: typingAnimation 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% { 
        transform: translateY(0);
    }
    30% { 
        transform: translateY(-5px);
    }
}

/* Mobile specific styles */
@media (hover: none) and (pointer: coarse) {
    /* Hide buttons on mobile devices */
    .car-swiper-buttons {
        display: none;
    }
    
    /* Add swipe instructions for mobile */
    .car-swiper-container::before {
        content: "Swipe left to dislike ✕, right to like ♥";
        position: absolute;
        top: 10px;
        left: 0;
        right: 0;
        text-align: center;
        z-index: 100;
        color: white;
        background: rgba(0,0,0,0.5);
        padding: 5px 0;
        font-size: 14px;
        pointer-events: none;
        border-radius: 20px;
        margin: 0 10px;
        opacity: 0.8;
    }
    
    .car-images-container {
        display: flex;
        flex-direction: column;
    }
    
    .car-image {
        display: block;
        font-size: 0;
        line-height: 0;
    }
    
    /* Убираем возможные зазоры между изображениями */
    .car-image + .car-image {
        margin-top: 0;
    }
}

/* Loader styles */
.car-swiper-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.car-swiper-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.car-swiper-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 51, 102, 0.2);
    border-radius: 50%;
    border-top-color: #ff3366;
    animation: loader-spin 1s linear infinite;
}

@keyframes loader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 