/* Import variables from main style.css if not already defined globally */
/* This is a fallback, ideally :root variables are in a single main CSS file */
:root {
    --primary-color: #4A90E2; /* Modern Blue */
    --secondary-color: #50E3C2; /* Teal/Mint accent */
    --accent-color: #E24A68; /* Soft Red for highlights/errors */
    --text-dark: #2C3E50; /* Darker text for headings */
    --text-light: #5A6A7D; /* Lighter text for body */
    --bg-light: #F8F9FA; /* Light background */
    --bg-card: #FFFFFF; /* Card background */
    --border-color: #E0E6EB; /* Light border */
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --border-radius-card: 12px;
    --border-radius-button: 8px;
    --transition-speed: 0.3s ease;
}

/* --- Ad View Header --- */
.ad-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px; /* Adjust padding for header card */
    margin-bottom: 30px;
    background-color: var(--bg-card); /* Inherit from card-modern */
    border-radius: var(--border-radius-card); /* Inherit from card-modern */
    box-shadow: 0 6px 20px var(--shadow-light); /* Inherit from card-modern */
}

.ad-view-header .page-title {
    margin: 0;
    font-size: 2.2em;
    color: var(--text-dark);
    flex-grow: 1; /* Allow title to take space */
    text-align: center;
}

.back-ads-btn {
    /* Inherits btn-secondary-modern styles */
    padding: 10px 20px; /* Slightly smaller button for header */
    font-size: 0.9em;
    white-space: nowrap; /* Prevent text wrap */
}

/* --- Ad Detail Card --- */
.ad-detail-card {
    display: flex;
    flex-direction: row; /* Default: image and info side-by-side */
    gap: 30px; /* Space between image and info */
    padding: 40px; /* More padding for detail page */
    background-color: var(--bg-card);
    border-radius: var(--border-radius-card);
    box-shadow: 0 8px 30px var(--shadow-medium);
    margin-bottom: 30px;
}

.ad-image-full-container {
    flex: 2; /* Image takes more space */
    max-width: 60%; /* Limit image width on large screens */
    border-radius: var(--border-radius-card);
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-light);
    display: flex; /* For centering smaller images */
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0; /* Placeholder background */
}

.ad-image-full-container img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    display: block;
    object-fit: contain; /* Ensure entire image is visible, might leave empty space */
}

.ad-info-section {
    flex: 1.5; /* Info takes less space */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.ad-detail-title {
    font-size: 2.5em;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.ad-meta-info p {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.ad-meta-info p i {
    margin-right: 10px;
    color: var(--secondary-color);
    font-size: 1.2em;
}

.ad-meta-info strong {
    color: var(--text-dark);
}

.ad-description-full {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color); /* Separator */
}

.ad-description-full h3 {
    font-size: 1.5em;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.ad-description-full p {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-light);
    white-space: pre-wrap; /* Preserve line breaks from nl2br */
}

/* Optional: Contact Info Section (if you uncomment it in PHP) */
/*
.ad-contact-info {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}
.ad-contact-info h3 {
    font-size: 1.5em;
    color: var(--text-dark);
    margin-bottom: 15px;
}
.ad-contact-info p {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}
.ad-contact-info p i {
    margin-right: 10px;
    color: var(--secondary-color);
    font-size: 1.2em;
}
*/

/* --- Messages (re-using existing styles from style.css) --- */
.info-message, .error-message, .success-message {
    padding: 15px;
    border-radius: var(--border-radius-button);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}
.info-message {
    background-color: #e0f7fa;
    color: #00796b;
    border: 1px solid #b2ebf2;
}
.error-message {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ef9a9a;
}
.success-message {
    background-color: #e8f5e9;
    color: #388e3c;
    border: 1px solid #a5d6a7;
}


/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .ad-detail-card {
        flex-direction: column; /* Stack image and info vertically */
        padding: 30px;
    }
    .ad-image-full-container {
        max-width: 100%; /* Image takes full width */
        height: 300px; /* Fixed height for image on medium screens */
    }
    .ad-detail-title {
        font-size: 2em;
        margin-top: 20px; /* Space after image when stacked */
    }
    .ad-info-section {
        width: 100%;
    }
    .ad-view-header .page-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .ad-detail-card {
        padding: 25px;
    }
    .ad-image-full-container {
        height: 250px; /* Smaller fixed height for image */
    }
    .ad-detail-title {
        font-size: 1.8em;
    }
    .ad-meta-info p, .ad-description-full p {
        font-size: 1em;
    }
    .ad-description-full h3 {
        font-size: 1.3em;
    }
    .ad-view-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .ad-view-header .page-title {
        margin-top: 15px;
        margin-bottom: 0;
        font-size: 1.8em;
    }
    .back-ads-btn {
        margin-right: 0;
    }
}

@media (max-width: 576px) {
    .ad-detail-card {
        padding: 20px;
        gap: 20px;
    }
    .ad-image-full-container {
        height: 200px; /* Even smaller fixed height for image on small phones */
    }
    .ad-detail-title {
        font-size: 1.6em;
    }
    .ad-meta-info p, .ad-description-full p {
        font-size: 0.9em;
    }
    .ad-description-full h3 {
        font-size: 1.2em;
    }
    .ad-view-header .page-title {
        font-size: 1.6em;
    }
    .back-ads-btn {
        width: 100%; /* Full width button on very small screens */
    }
}