/**
 * Ad Display CSS for base-page_01.php and albums.php
 * Replicates the demo ad styling from create-ad.php
 */

/* Base Ad Demo Container */
.ad-container {
    margin: 16px auto 16px auto;
    display: flex;
    justify-content: center;
}

.ad-demo {
    background: white;
    border: 1px solid #134f2a;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.ad-demo:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* FEED AD STYLES (800px wide, scaled to 50% = 400px display) */
.ad-demo.feed-ad {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.ad-demo.feed-ad.size-large {
    aspect-ratio: 800 / 800;
}

.ad-demo.feed-ad.size-medium {
    aspect-ratio: 800 / 480;
}

.ad-demo.feed-ad.size-small {
    aspect-ratio: 800 / 240;
}

/* RIGHT COLUMN AD STYLES (400px wide, displayed at full size) */
.ad-demo.right-col-ad {
    width: 100%;
    max-width: 400px;
}

.ad-demo.right-col-ad.size-large {
    aspect-ratio: 400 / 500;
}

.ad-demo.right-col-ad.size-medium {
    aspect-ratio: 400 / 300;
}

.ad-demo.right-col-ad.size-small {
    aspect-ratio: 400 / 180;
}

/* Inner Ad Structure */
.ad-demo-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ad-image-wrapper {
    flex: 1;
    min-height: 45%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* Bottom Row: content link + menu dots column */
.ad-bottom-row {
    display: flex;
    flex-shrink: 0;
    background: #10292a;
}

/* Ad Content Area - now the flex item */
.ad-content {
    flex: 1;
    min-width: 0;
    padding: 8px;
    background: transparent;
}

/* Clickable content-link wrapper - wraps only title and description */
.ad-content-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background 0.2s;
    border-radius: 4px;
    padding: 4px;
    margin: -4px;
}

.ad-content-link:hover {
    background: rgba(255, 255, 255, 0.04);
}

.right-col-ad .ad-content {
    padding: 12px;
}

.ad-title {
    margin-top: -4px;
    font-weight: bold;
    font-size: 1.1em;
    color: white;
    line-height: 1;
}

.right-col-ad .ad-title {
    font-size: .9em;
    margin-bottom: 2px;
}

.ad-description {
    font-size: 0.9em;
    color: #b9b9b9;
    margin-top: -4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.right-col-ad .ad-description {
    font-size: 0.85em;
    margin-bottom: 10px;
}

/* === AD MENU COLUMN (three-dot menu on right) === */
.ad-menu-col {
    width: 32px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0 4px 8px 0;
    position: relative;
}

.btn-ad-menu {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-ad-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ad-menu-dot {
    width: 5px;
    height: 5px;
    background: #ffffff;
    border-radius: 50%;
    display: block;
}

/* Report Dropdown */
.ad-report-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    min-width: 140px;
    background: var(--surface-2, #1e2a3a);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    z-index: 100;
    padding: 4px;
    margin-bottom: 4px;
}

.ad-report-dropdown.active {
    display: block;
}

.btn-ad-report {
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    width: 100%;
    white-space: nowrap;
}

.btn-ad-report:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}

.btn-ad-report svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Sponsored Badge */
.ad-sponsored {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(64, 0, 255, 0.5);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Audio Player */
.ad-audio {
    width: 100%;
    margin-top: -3px;
    height: 28px;
}

.ad-description + .ad-audio {
    margin-top: 0px; /*DOESN'T MOVE THE PLAYER UP*/
}

.stop-btn {
    margin-top: 15px;
    padding: 12px 30px;
    font-size: 16px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

.stop-btn:hover {
    background-color: #cc0000;
}

.stop-btn:active {
    transform: scale(0.98);
}

/* SMALL FEED AD CONDENSED LAYOUT */
.feed-ad.size-small .ad-content {
    padding: 8px 12px;
}

.feed-ad.size-small .ad-title {
    font-size: 0.95em;
    margin-bottom: 4px;
}

.feed-ad.size-small .ad-description {
    font-size: 0.8em;
    margin-bottom: 6px;
    -webkit-line-clamp: 1;
}

.feed-ad.size-small .ad-audio {
    margin-top: 4px;
}

.feed-ad.size-small .ad-description + .ad-audio {
    margin-top: 4px;
}

/* Medium Feed Ad Adjustments */
.feed-ad.size-medium .ad-audio {
    margin-top: 6px;
}

.feed-ad.size-medium .ad-description + .ad-audio {
    margin-top: 6px;
}

/* Right Column Small Ad Adjustments */
.right-col-ad.size-small .ad-content {
    padding: 6px 10px;
}

.right-col-ad.size-small .ad-title {
    font-size: 0.9em;
    margin-bottom: 3px;
}

.right-col-ad.size-small .ad-description {
    font-size: 0.75em;
    margin-bottom: 4px;
    -webkit-line-clamp: 1;
}

.right-col-ad.size-small .ad-audio {
    margin-top: 4px;
}

.right-col-ad.size-small .ad-description + .ad-audio {
    margin-top: 4px;
}

/* Right Column Medium Ad Adjustments */
.right-col-ad.size-medium .ad-audio {
    margin-top: 6px;
}

.right-col-ad.size-medium .ad-description + .ad-audio {
    margin-top: 6px;
}

/* Small ad: tighter menu column */
.size-small .ad-menu-col {
    width: 28px;
    padding-bottom: 4px;
}

.size-small .ad-menu-dot {
    width: 4px;
    height: 4px;
}

.size-small .btn-ad-menu {
    gap: 2px;
    padding: 4px 3px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .ad-demo.feed-ad,
    .ad-demo.right-col-ad {
        max-width: 100%;
    }
    
    .ad-content {
        padding: 12px;
    }
    
    .ad-title {
        font-size: 1em;
    }
    
    .ad-description {
        font-size: 0.85em;
    }

    .ad-report-dropdown {
        right: -4px;
        min-width: 130px;
    }
}

/* Loading state */
.ad-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Hidden expired ads */
.ad-container.expired,
.event-card.expired {
    display: none !important;
}
