﻿.listing-detail {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Gallery styling */
.gallery-container {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease-out;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.2s ease;
}

.gallery-nav:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-nav-prev {
    left: 1rem;
}

.gallery-nav-next {
    right: 1rem;
}

.gallery-thumbnails {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.gallery-thumbnail {
    flex: 0 0 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.gallery-thumbnails::-webkit-scrollbar {
    display: none;
}

.gallery-thumbnail.active {
    border-color: #3b82f6;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-status.expired {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #ff4d4f;
    color: white;
    font-size: 14px; 
    font-weight: bold;
    padding: 6px 12px; 
    border-radius: 5px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

/* Modal Gallery */
.modal-gallery {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overscroll-behavior: none;
}

.modal-gallery.active {
    display: block;
}

.modal-gallery-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.modal-gallery-track {
    display: flex;
    transition: transform 0.3s ease-out;
}

.modal-gallery-slide {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    box-sizing: border-box;
}

.modal-gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    -webkit-user-select: none;
    user-select: none;
}

.modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1001;
    color: #000;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: white;
    transform: scale(1.1);
}

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.2s ease;
    color: #000;
}

.modal-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-prev {
    left: 16px;
}

.modal-nav-next {
    right: 16px;
}

.modal-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #000;
    z-index: 1001;
}

/* Listing info styles */
.listing-info {
    padding: 20px 0px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.listing-info h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.listing-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.meta-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.listing-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

.category {
    font-size: 1rem;
    color: #4b5563;
}

.date, .location {
    color: #6b7280;
    font-size: 0.875rem;
    align-self: center;
}

.description {
    margin-bottom: 2rem;
}

.description h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.description p {
    color: #4b5563;
    line-height: 1.6;
    white-space: pre-wrap;
}
.phone-number-section {
    margin-top: 20px;
}

.phone-number-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.hidden {
    display: none !important;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 20px;
}

.tag {
    background: #e5e7eb;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    font-size: 1.25rem;
}

/* Listing actions styles */
.listing-details-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.listing-details-edit-button {
    background: linear-gradient(to right, #2c2c2c, #4a4a4a);
    color: white;
    margin-right: 1rem;
}

.listing-details-edit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.listing-details-delete-button {
    background-color: #dc2626;
    color: white;
}

.listing-details-delete-button:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.listing-details-cancel-button {
    background-color: #6b7280;
    color: white;
}

.listing-details-cancel-button:hover {
    background-color: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Delete modal */
#deleteModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#deleteModal.active {
    display: flex;
}

#deleteModal .modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#deleteModal .modal-content h2 {
    margin: 0 0 1rem 0;
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
}

#deleteModal .modal-content p {
    margin-bottom: 1.5rem;
    color: #4b5563;
    line-height: 1.5;
}

#deleteModal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

#deleteModal .modal-actions form {
    display: flex;
    gap: 1rem;
}

.listing-details-renew-form {
    display: inline;
}

.listing-details-renew-button {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    margin-left: 1rem;
}

.listing-details-renew-button:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.expiration {
    color: #6b7280;
    font-size: 0.875rem;
    align-self: center;
}

.expiration.expired {
    color: #ef4444;
    font-weight: 500;
}

.expiration.expiring {
    color: #f59e0b;
    font-weight: 500;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6b7280;
    font-size: 0.875rem;
}

.view-count svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

/* Responsive styles */
@media (max-width: 640px) {
    .listing-detail {
        padding: 1rem;
    }

    .listing-details-delete-button {
        margin-top: 1rem;
    }

    .listing-details-renew-button {
        margin-top: 1rem;
        margin-left: 0;
    }

    .gallery-main {
        height: 300px;
    }

    .gallery-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }

    .modal-gallery-slide {
        padding: 60px 10px;
    }

    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .modal-nav-prev {
        left: 10px;
    }

    .modal-nav-next {
        right: 10px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
    }

    .listing-info h1 {
        font-size: 1.5rem;
    }

    .price {
        margin-bottom: 0.5rem;
    }

    .listing-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
    }

    .listing-meta-item {
        width: 100%;
    }

    .listing-details-action-button {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .listing-details-action-button[href] {
        width: 100%;
        display: inline-flex;
        box-sizing: border-box;
    }

    #deleteModal .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }

    #deleteModal .modal-actions {
        flex-direction: column;
    }

    #deleteModal .modal-actions form {
        flex-direction: column;
    }

    .chat-button {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
}

.chat-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(to right, #2c2c2c, #4a4a4a);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 20px;
}

.chat-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.chat-button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.message-icon {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z'/%3E%3C/svg%3E");
}

