/* ============================================
   Modern Ad Layout Templates - Clean & Professional
   ============================================ */

/* Sponsored Ad Container */
.sponsored-ad {
    border: 1px solid rgba(124, 58, 237, 0.2) !important;
    background: rgba(124, 58, 237, 0.02) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border-radius: 16px !important;
    transition: all 0.3s ease;
}

.sponsored-ad:hover {
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15) !important;
    border-color: rgba(124, 58, 237, 0.4) !important;
}

/* ============================================
   Layout Selection UI
   ============================================ */

.layout-selector { 
    cursor: pointer;
    transition: all 0.2s ease;
}

.layout-selector input { 
    display: none;
}

.layout-card { 
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.layout-icon { 
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.layout-selector input:checked + .layout-card { 
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.25);
    transform: translateY(-2px);
}

.layout-selector input:checked + .layout-card .layout-icon { 
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.15);
    transform: scale(1.1);
}

.layout-selector span { 
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* ============================================
   Live Preview Container
   ============================================ */

.live-preview-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

/* ============================================
   Ad Content Sections
   ============================================ */

.ad-content-section {
    padding: 10px 20px 8px 20px;
    background: rgba(255, 255, 255, 0.02);
}

.ad-content-section-compact {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(124, 58, 237, 0.1);
}

.ad-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.ad-title-compact {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.ad-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    text-indent: 0;
}

.ad-text-compact {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.ad-text-carousel {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

/* ============================================
   Video
   ============================================ */

.ad-video {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 15px;
}

/* ============================================
   Gallery & Image Styles
   ============================================ */

.ad-gallery-single {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ad-gallery-single:hover {
    transform: scale(1.02);
}

.ad-image-grid {
    display: grid;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
}

.ad-image-grid.grid-1 {
    grid-template-columns: 1fr;
    height: 300px;
}

.ad-image-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
    height: 250px;
}

.ad-image-grid.grid-3 {
    grid-template-columns: 1fr 1fr;
    height: 280px;
}

.ad-image-grid.grid-3 .grid-img-item:first-child {
    grid-row: span 2;
}

.ad-image-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    height: 280px;
}

.grid-img-item {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.grid-img-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.grid-img-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    border-radius: 10px;
}

.grid-img-item:hover::after {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   DEFAULT LAYOUT
   ============================================ */

.ad-layout-default {
    display: flex;
    flex-direction: column;
}

/* ============================================
   MEDIA TOP LAYOUT
   ============================================ */

.ad-layout-media-top {
    display: flex;
    flex-direction: column;
}

/* ============================================
   THUMBNAIL LAYOUT
   ============================================ */

.ad-layout-thumbnails {
    display: flex;
    flex-direction: column;
}

.ad-main-image-fixed {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
    border-radius: 12px;
    overflow: hidden;
    margin: 15px;
    margin-bottom: 10px;
}

.ad-main-display {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ad-main-display:hover {
    transform: scale(1.03);
}

.ad-thumbnails-row {
    display: flex;
    gap: 8px;
    padding: 0 15px 12px 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.ad-thumbnails-row::-webkit-scrollbar {
    height: 4px;
}

.ad-thumbnails-row::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.ad-thumbnails-row::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.4);
    border-radius: 4px;
}

.ad-thumbnails-row::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.6);
}

.ad-thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.ad-thumbnail:hover {
    opacity: 1;
    border-color: var(--accent-cyan);
}

.ad-thumbnail.active {
    opacity: 1;
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

/* ============================================
   SPLIT LAYOUT
   ============================================ */

.ad-layout-split {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ad-split-left {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-split-right {
    flex: 1;
    min-height: 250px;
    border-top: 1px solid rgba(124, 58, 237, 0.1);
}

@media (min-width: 768px) {
    .ad-layout-split {
        flex-direction: row;
        gap: 0;
    }

    .ad-split-left {
        border-right: 1px solid rgba(124, 58, 237, 0.1);
        border-top: none;
        flex: 0 0 48%;
    }

    .ad-split-right {
        flex: 1;
        border-top: none;
        border-left: 1px solid rgba(124, 58, 237, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   CAROUSEL LAYOUT
   ============================================ */

.ad-layout-carousel {
    display: flex;
    flex-direction: column;
}

.ad-carousel-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    margin: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
}

.ad-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.320, 1);
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(124, 58, 237, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--accent-purple);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 15px;
}

.carousel-btn.next {
    right: 15px;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: rgba(255,255,255,0.7);
}

.dot.active {
    background: var(--accent-cyan);
    width: 24px;
    border-radius: 4px;
}

/* ============================================
   AD INTERACTIONS
   ============================================ */

.ad-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--accent-purple), #a855f7);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.ad-cta-btn:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.ad-cta-label {
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 6px;
    color: var(--accent-purple);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ad-stat-badge:hover {
    background: rgba(124, 58, 237, 0.2);
}

.ad-stat-badge.dislike {
    color: var(--text-muted);
    background: rgba(0,0,0,0.1);
}

.ad-stat-badge.dislike:hover {
    background: rgba(0,0,0,0.15);
}