/* Ad Slider CSS */
.ad-slider-container {
    max-width: 600px;
    position: relative;
    margin: 5px auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    /* Original: 1/1 square. 
       User req: remove 60px from top/bottom. 
       Assuming 600px width -> 600px height. New height = 600 - 60 - 60 = 480px.
       Ratio = 600 / 480 = 1.25. */
    aspect-ratio: 600/460; 
    background: #f0f0f0;
}

.ad-slider-wrapper {
    width: 100%;
    height: 100%;
}

.ad-slide {
    display: none;
    width: 100%;
    height: 100%;
    animation: fadeEffect 1.5s; /* Fade effect */
}

.ad-slide.active {
    display: block;
}

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

/* Slide Caption Overlay */
.ad-slide-caption {
    position: absolute;
    bottom: 0; /* Align to bottom */
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background for contrast */
    color: #fff; /* White text */
    padding: 10px 10px 55px 10px; /* Top padding 10px, Bottom padding 55px to cover dots area */
    box-sizing: border-box;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap; /* Single line */
    overflow: hidden;
    text-overflow: ellipsis; /* ... if too long */
    z-index: 5;
    backdrop-filter: blur(2px); /* Optional: slight blur for readability */
}

/* Navigation Buttons */
.ad-prev, .ad-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px; /* Larger hit area */
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px; /* Larger icon */
    transition: 0.3s ease;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    border: none;
    z-index: 10;
    border-radius: 50%; /* Rounded buttons */
}

.ad-prev {
    left: 10px; /* Offset from edge */
}

.ad-next {
    right: 10px; /* Offset from edge */
}

.ad-prev:hover, .ad-next:hover {
    background-color: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(1.1);
}

/* Dots Container - Sliding Effect */
.ad-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 150px; /* Limit width to force scrolling/hiding if many dots */
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Changed from center to manage scroll */
    overflow: hidden; /* Hide extra dots */
    z-index: 10;
    background: rgba(0,0,0,0.2); /* Subtle background/pill shape */
    padding: 0 10px;
    border-radius: 20px;
    scroll-behavior: smooth; /* Native smooth scroll */
}

/* Individual Dot */
.ad-dot {
    cursor: pointer;
    flex: 0 0 10px; /* Flex no-shrink, fixed width */
    height: 10px;
    margin: 0 6px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Active Dot - Centered & Highlighted */
.ad-dot.active {
    background-color: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

/* Animation */
@keyframes fadeEffect {
    from {opacity: .4} 
    to {opacity: 1}
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .ad-slider-container {
        margin: 5px auto; 
        width: 100%; /* Revert to full width */
        box-shadow: none; /* Optional: remove shadow on full width if desired, or keep it */
        /* border-radius removed to restore default inheriting from parent or apply explicity if needed. 
           However, parent's radius might not show on full width. 
           User asked to Restore it. */
        border-radius: 12px;
    }
    
    .ad-prev, .ad-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    /* Adjust caption for mobile */
    .ad-slide-caption {
        font-size: 14px; /* Smaller font */
        padding: 8px 10px 40px 10px; /* Reduced bottom padding */
    }
    
    /* Adjust dots position if needed */
    .ad-dots {
        bottom: 10px;
    }
}

/* Ad Overlay Label "광고" */
.ad-overlay-label {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent black */
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: normal;
    z-index: 20; /* Ensure it stays on top of everything */
    border-bottom-left-radius: 8px; /* Rounded corner for aesthetic */
    pointer-events: none; /* Let clicks pass through if needed */
}