/* Native Advertisement Styles */

/* Base Ad Unit Styles */
.ad-unit {
    position: relative;
    margin: 2rem 0;
    max-width: 100%;
}

.ad-label {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Native Card Ad */
.ad-native-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.ad-native-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.ad-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 52.5%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: var(--color-gray-light);
}

.ad-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ad-advertiser {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.ad-advertiser-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.ad-advertiser-name {
    font-weight: 600;
}

.ad-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.ad-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.9;
}

.ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    align-self: flex-start;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.ad-cta:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white !important;
}

.ad-cta-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.ad-cta:hover .ad-cta-icon {
    transform: translateX(4px);
}

/* Image Banner Ad */
.ad-image-banner {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.ad-banner-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.ad-image-banner:hover .ad-banner-image {
    transform: scale(1.05);
}

.ad-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem 1.5rem 1.5rem;
    color: white;
}

.ad-image-overlay h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.ad-overlay-cta {
    display: inline-block;
    background: white;
    color: #1f2937 !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Video Ad */
.ad-video-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: var(--color-charcoal);
}

.ad-video {
    width: 100%;
    height: auto;
    display: block;
}

.ad-video-info {
    padding: 1.5rem;
    background: var(--color-gray-soft);
}

.ad-video-info h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.ad-video-info p {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 1rem;
    color: var(--color-gray-muted);
}

/* Placement-Specific Styles */

/* Inline Article Ad */
.ad-unit-article_inline {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--color-gray-light);
    border-bottom: 1px solid var(--color-gray-light);
}

.ad-unit-article_inline .ad-native-card {
    max-width: 600px;
    margin: 0 auto;
}

/* Sidebar Ad */
.ad-unit-article_sidebar {
    position: sticky;
    top: 100px;
    margin: 2rem 0;
}

.ad-unit-article_sidebar .ad-native-card {
    max-width: 100%;
}

.ad-unit-article_sidebar .ad-image-wrapper {
    padding-top: 60%; /* Taller aspect ratio for sidebar */
}

.ad-unit-article_sidebar .ad-content {
    padding: 1rem;
}

.ad-unit-article_sidebar .ad-title {
    font-size: 1rem;
}

.ad-unit-article_sidebar .ad-description {
    font-size: 0.875rem;
}

/* Bottom Ad */
.ad-unit-article_bottom {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--color-gray-soft);
    border-radius: 12px;
}

/* Listing Grid Ad */
.ad-unit-listing_grid {
    grid-column: span 1;
}

.ad-unit-listing_grid .ad-native-card {
    height: 100%;
}

/* Homepage Banner Ad */
.ad-unit-homepage_banner {
    margin: 2rem 0;
}

.ad-unit-homepage_banner .ad-image-banner {
    max-height: 400px;
}

.ad-unit-homepage_banner .ad-banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .ad-label {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        top: 0.5rem;
        right: 0.5rem;
    }

    .ad-native-card {
        border-radius: 8px;
    }

    .ad-content {
        padding: 1rem;
        gap: 0.75rem;
    }

    .ad-title {
        font-size: 1.125rem;
    }

    .ad-description {
        font-size: 0.875rem;
    }

    .ad-cta {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
        justify-content: center;
    }

    .ad-unit-article_inline {
        margin: 2rem 0;
        padding: 1.5rem 0;
    }

    .ad-unit-article_sidebar {
        position: relative;
        top: 0;
        margin: 2rem 0;
    }

    .ad-unit-article_bottom {
        padding: 1.5rem;
    }

    .ad-image-overlay {
        padding: 1.5rem 1rem 1rem;
    }

    .ad-image-overlay h4 {
        font-size: 1.125rem;
    }
}

/* Accessibility */
.ad-unit:focus-within {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 12px;
}

/* Loading State */
.ad-unit[data-loading="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* Error State */
.ad-unit[data-error="true"] {
    display: none;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ad-unit {
    animation: fadeInUp 0.6s ease-out;
}
