/* ilan.css */

/* Global Styles */
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

/* Main Content Area */
main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Ad Details Container */
.ad-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Ad Title */
.ad-title {
    font-size: 2.4em;
    margin-bottom: 30px;
    color: #333;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-title.expanded {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
}

/* Gallery Styles */
.gallery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.main-media {
    width: 400px;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.main-media img,
.main-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 5px;
}

.thumbnail {
    width: 80px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex: 0 0 auto;
}

.thumbnail img,
.thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.active {
    border: 2px solid #007bff;
}

.thumbnail .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: rgba(255,255,255,0.8);
    pointer-events: none;
}

/* Ad Top Section */
.ad-top-section {
    display: flex;
    flex-direction: row;
    justify-content: center; 
    align-items: flex-start;
    width: 100%;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: nowrap;
}

/* Ad Info Section */
.ad-info {
    flex: 0 0 auto;
    text-align: left;
    max-width: 400px;
}

.ad-info h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: left;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-info h2.expanded {
    white-space: normal;
    overflow: visible;
}

.ad-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.ad-info-table th, .ad-info-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
    font-size: 1em;
    word-wrap: break-word;
}

.ad-info-table th {
    background-color: #f0f0f0;
    width: 35%;
    font-weight: 600;
    text-align: left;
    color: #333;
}

.ad-info-table tr:last-child td {
    border-bottom: none;
}

/* Description Section */
.description-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 30px;
    text-align: left;
}

.description-container h3 {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.description-scroll {
    max-height: 300px; 
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
}

.description {
    font-size: 1.1em;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Contact Button */
.contact-owner {
    text-align: center;
    margin-bottom: 20px;
}

.message-owner-btn {
    display: inline-block;
    padding: 12px 20px;
    background-color: #007bff;
    color: #fff;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

.message-owner-btn:hover {
    background-color: #0056b3;
    text-decoration: none;
    color: #fff;
}

/* Responsive Breakpoints for tablets and small desktops */
@media (max-width: 768px) {
    .ad-top-section {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .gallery-container {
        width: 90%;
    }

    .main-media {
        width: 100%;
        height: auto;
    }

    .ad-info {
        max-width: 90%;
        margin-top: 20px;
    }

    .ad-info h2 {
        text-align: center;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .ad-title {
        font-size: 2em;
        margin: 20px 0;
        white-space: normal;
        text-overflow: unset;
    }
}

/* Additional adjustments for mobile devices */
@media (max-width: 480px) {
    main {
        padding: 10px;
        margin: 20px auto;
    }

    .ad-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .main-media {
        width: 100%;
        height: auto;
    }

    .thumbnail {
        width: 60px;
        height: 45px;
    }

    .ad-info-table th, .ad-info-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .description-scroll {
        max-height: 200px;
        padding: 8px;
    }

    .message-owner-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
}
