/* Smart Ad Manager - Frontend Styles */

.sam-ad-container {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.sam-ad-container::before {
    content: "Advertisement";
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sam-ad-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Ad Position Styles */
.sam-ad-top {
    margin-top: 0;
    margin-bottom: 30px;
}

.sam-ad-middle {
    margin: 30px 0;
}

.sam-ad-bottom {
    margin-top: 30px;
    margin-bottom: 0;
}

/* Ad Alignment Styles */
.sam-ad-default {
    text-align: left;
}

.sam-ad-centered {
    text-align: center;
}

.sam-ad-left {
    text-align: left;
}

.sam-ad-right {
    text-align: right;
}

.sam-ad-fullwidth {
    width: 100%;
    margin-left: -15px;
    margin-right: -15px;
    padding: 20px 15px;
    border-radius: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sam-ad-container {
        margin: 15px 0;
        padding: 10px;
    }
    
    .sam-ad-fullwidth {
        margin-left: -10px;
        margin-right: -10px;
        padding: 15px 10px;
    }
}

@media (max-width: 480px) {
    .sam-ad-container {
        margin: 10px 0;
        padding: 8px;
    }
    
    .sam-ad-fullwidth {
        margin-left: -5px;
        margin-right: -5px;
        padding: 10px 5px;
    }
}

/* Ad Content Styling */
.sam-ad-container iframe {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.sam-ad-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Animation for ad appearance */
.sam-ad-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects */
.sam-ad-container:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Print styles */
@media print {
    .sam-ad-container {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sam-ad-container {
        border: 2px solid #000;
        background: #fff;
    }
    
    .sam-ad-container::before {
        color: #000;
        font-weight: bold;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sam-ad-container {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sam-ad-container {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .sam-ad-container::before {
        color: #a0aec0;
    }
}

/* Focus styles for accessibility */
.sam-ad-container:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading state */
.sam-ad-container.loading {
    position: relative;
    overflow: hidden;
}

.sam-ad-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Ad spacing for better readability */
.sam-ad-container + p {
    margin-top: 20px;
}

p + .sam-ad-container {
    margin-top: 20px;
}

/* Special styling for different ad types */
.sam-ad-container[data-ad-type="banner"] {
    text-align: center;
    padding: 20px;
}

.sam-ad-container[data-ad-type="sidebar"] {
    float: right;
    width: 300px;
    margin-left: 20px;
}

.sam-ad-container[data-ad-type="inline"] {
    display: inline-block;
    margin: 10px;
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
    .sam-ad-container[data-ad-type="sidebar"] {
        float: none;
        width: 100%;
        margin-left: 0;
    }
}
