/* Banner Ad Styles */

.banner-ad {
    margin: 20px 0;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ad-picture {
    display: block;
    width: 100%;
    height: auto;
}

.ad-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Position-specific styles */
.top-ad {
    margin-top: 0;
    margin-bottom: 30px;
}

.middle-ad {
    margin: 30px 0;
}

.bottom-ad {
    margin-top: 30px;
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .banner-ad {
        margin: 15px 0;
        border-radius: 6px;
    }

    .top-ad {
        margin-bottom: 20px;
    }

    .middle-ad {
        margin: 20px 0;
    }

    .bottom-ad {
        margin-top: 20px;
    }
}

/* Job list specific ad styling */
.job-list-ad {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.job-list-ad .banner-ad {
    margin: 0;
    box-shadow: none;
}

.job-list-ad .banner-ad:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Ad label for transparency */
.ad-label {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading state */
.ad-loading {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.ad-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Ad container for job lists */
.ad-container {
    position: relative;
    margin: 20px 0;
}

/* Responsive image optimization */
@media (min-width: 1200px) {
    .ad-image {
        max-height: 300px;
        object-fit: cover;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .ad-image {
        max-height: 250px;
        object-fit: cover;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .ad-image {
        max-height: 200px;
        object-fit: cover;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .ad-image {
        max-height: 150px;
        object-fit: cover;
    }
}

@media (max-width: 575px) {
    .ad-image {
        max-height: 150px;
        object-fit: cover;
    }
}

/* Accessibility improvements */
.ad-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .banner-ad {
        display: none;
    }
}