/**
 * AdMind Public Styles
 * Responsive and modern ad display
 */

/* ===========================
   Base Ad Styles
=========================== */
.admind-ad {
    position: relative;
    margin: 20px 0;
    box-sizing: border-box;
}

/* ADS Badge */
.admind-ads-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
}

.admind-ad * {
    box-sizing: border-box;
}

/* Alignment */
.admind-ad-align-left {
    margin-left: 0;
    margin-right: auto;
}

.admind-ad-align-center {
    margin-left: auto;
    margin-right: auto;
}

.admind-ad-align-right {
    margin-left: auto;
    margin-right: 0;
}

/* ===========================
   Image Ads
=========================== */
.admind-ad-image {
    display: block;
}

.admind-ad-link {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.admind-ad-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.admind-ad-link:hover .admind-ad-img {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ===========================
   Video Ads
=========================== */
.admind-ad-video {
    display: block;
}

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

.admind-video-slide {
    position: relative;
    width: 100%;
    height: 100%;
}

.admind-skip-video {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInSkip 0.5s ease 2s forwards;
}

@keyframes fadeInSkip {
    to {
        opacity: 1;
    }
}

.admind-skip-video:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: scale(1.05);
}

/* ===========================
   Text Ads
=========================== */
.admind-text-ad {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* ===========================
   Slider/Carousel
=========================== */
.admind-ad-slider {
    display: block;
}

.admind-slider-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.admind-slides {
    position: relative;
    width: 100%;
}

.admind-slide {
    display: none;
    width: 100%;
    line-height: 0;
}

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

.admind-slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* Navigation Arrows */
.admind-slider-prev,
.admind-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 15px 12px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.3s ease;
    z-index: 10;
}

.admind-slider-prev:hover,
.admind-slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.admind-slider-prev {
    left: 10px;
}

.admind-slider-next {
    right: 10px;
}

/* Dot Indicators */
.admind-slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.admind-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.admind-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.admind-dot.active {
    background: #fff;
    transform: scale(1.2);
}

/* ===========================
   Slider Transitions
=========================== */

/* Fade */
.admind-slider-wrapper[data-slider-type="fade"] .admind-slide {
    animation-name: fadeIn;
    animation-duration: 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Horizontal */
.admind-slider-wrapper[data-slider-type="slide"] .admind-slide {
    animation-name: slideInRight;
    animation-duration: 0.5s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Slide Vertical */
.admind-slider-wrapper[data-slider-type="slide-vertical"] .admind-slide {
    animation-name: slideInDown;
    animation-duration: 0.5s;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Zoom */
.admind-slider-wrapper[data-slider-type="zoom"] .admind-slide {
    animation-name: zoomIn;
    animation-duration: 0.6s;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Flip */
.admind-slider-wrapper[data-slider-type="flip"] .admind-slide {
    animation-name: flip;
    animation-duration: 0.7s;
}

@keyframes flip {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

/* Cube */
.admind-slider-wrapper[data-slider-type="cube"] .admind-slide {
    animation-name: cubeRotate;
    animation-duration: 0.8s;
}

@keyframes cubeRotate {
    from {
        transform: perspective(800px) rotateY(-90deg);
        opacity: 0;
    }
    to {
        transform: perspective(800px) rotateY(0deg);
        opacity: 1;
    }
}

/* Cover Flow */
.admind-slider-wrapper[data-slider-type="coverflow"] .admind-slide {
    animation-name: coverflow;
    animation-duration: 0.7s;
}

@keyframes coverflow {
    from {
        transform: perspective(600px) rotateY(45deg) scale(0.8);
        opacity: 0;
    }
    to {
        transform: perspective(600px) rotateY(0deg) scale(1);
        opacity: 1;
    }
}

/* Ken Burns Effect */
.admind-slider-wrapper[data-slider-type="kenburns"] .admind-slide.active img {
    animation: kenburns 8s ease-out;
}

@keyframes kenburns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

/* ===========================
   Branding
=========================== */
.admind-branding {
    text-align: center;
    padding: 8px;
    font-size: 10px;
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.admind-branding a {
    color: #999;
    text-decoration: none;
}

.admind-branding a:hover {
    color: #666;
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 768px) {
    .admind-ad {
        margin: 15px 0;
    }

    .admind-slider-prev,
    .admind-slider-next {
        padding: 10px 8px;
        font-size: 18px;
    }

    .admind-slider-prev {
        left: 5px;
    }

    .admind-slider-next {
        right: 5px;
    }

    .admind-slider-dots {
        bottom: 10px;
    }

    .admind-dot {
        width: 8px;
        height: 8px;
    }
}

/* ===========================
   Accessibility
=========================== */
.admind-slider-prev:focus,
.admind-slider-next:focus,
.admind-dot:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .admind-ad-img,
    .admind-slide,
    .admind-dot {
        animation: none !important;
        transition: none !important;
    }
}

/* ===========================
   Print Styles
=========================== */
@media print {
    .admind-slider-prev,
    .admind-slider-next,
    .admind-slider-dots {
        display: none;
    }

    .admind-slide {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* ===========================
   FRONTEND DESIGN ENHANCEMENTS
=========================== */

/* Enhanced Ad Container */
.admind-ad {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.admind-ad:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Improved ADS Badge */
.admind-ads-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    animation: fadeInDown 0.5s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Image Hover */
.admind-ad-image img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.admind-ad:hover .admind-ad-image img {
    transform: scale(1.05);
}

/* Video Loading State */
.admind-video {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.admind-video::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: videoLoader 1s linear infinite;
}

@keyframes videoLoader {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Slider Controls Enhancement */
.admind-slider-prev,
.admind-slider-next {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.admind-slider-prev:hover,
.admind-slider-next:hover {
    background: rgba(102, 126, 234, 0.9);
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Dot Navigation Enhancement */
.admind-slider-dots {
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
}

.admind-dot {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.admind-dot:hover {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.8);
}

.admind-dot.active {
    background: #667eea;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.6);
    transform: scale(1.2);
}

/* Skip Button Enhancement */
.admind-skip-video {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    font-weight: 600;
}

.admind-skip-video:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.admind-skip-video:active {
    transform: translateY(0) scale(0.98);
}

/* Text Ad Enhancement */
.admind-text-ad {
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.admind-text-ad:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Text Ad Link Wrapper */
.admind-text-ad-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.admind-text-ad-link:hover {
    opacity: 0.9;
}

.admind-text-ad-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 4px;
}

/* Branding Enhancement */
.admind-branding {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.admind-branding:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    transform: scale(1.02);
}

/* Slide Transitions */
.admind-slide {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.admind-slide:not(.active) {
    opacity: 0;
    transform: scale(0.95);
}

.admind-slide.active {
    opacity: 1;
    transform: scale(1);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Image Enhancement */
.admind-ad-image img,
.admind-ad-gif img {
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Loading Placeholder */
.admind-loading {
    position: relative;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Click Effect */
.admind-ad a {
    position: relative;
    overflow: hidden;
}

.admind-ad a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.admind-ad a:active::after {
    width: 300px;
    height: 300px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .admind-ads-badge {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .admind-slider-prev,
    .admind-slider-next {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .admind-skip-video {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .admind-text-ad {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
        color: #f3f4f6;
    }
    
    .admind-ads-badge {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(8px);
    }
}

/* Accessibility Enhancements */
.admind-ad:focus-within {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

.admind-slider-prev:focus-visible,
.admind-slider-next:focus-visible,
.admind-skip-video:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 4px;
}

/* Performance Optimization */
.admind-ad {
    contain: layout style paint;
    will-change: transform;
}

.admind-slide {
    contain: layout;
}
