/* Modern Content Placement System CSS */

/* Base Placement Container Styles */
.placement-container {
    position: relative;
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.placement-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Content Labels */
.content-label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Content Links */
.content-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.content-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Content Images */
.content-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.content-link:hover .content-image {
    transform: scale(1.02);
}

/* Banner Placements */
.placement-banner {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.placement-banner .content-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0;
}

.placement-banner .content-body {
    padding: 1rem;
    color: var(--text);
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header Placement Section */
.placement-section.placement-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(168, 85, 247, 0.05));
    padding: 2rem 0;
    margin: 2rem 0;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.placement-section .placement-container {
    margin: 0;
}

/* Sidebar Placements */
.sidebar-placements {
    position: sticky;
    top: 2rem;
    margin: 2rem 0;
}

.placement-sidebar {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.placement-sidebar .content-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.placement-sidebar .content-body {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.placement-sidebar .content-label {
    top: 1rem;
    right: 1rem;
}

/* Footer Placements */
.placement-footer {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.placement-footer .content-image {
    max-width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    margin: 0 auto;
}

.placement-footer .content-body {
    color: var(--text);
    margin-top: 1rem;
}

.placement-footer .content-label {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

/* Popup Placements */
.placement-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.placement-popup {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.placement-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.placement-popup-header .content-label {
    position: static;
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    margin: 0;
}

.placement-popup-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.placement-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.placement-popup-content {
    padding: 1.5rem;
    text-align: center;
}

.placement-popup-content .content-image {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
}

.placement-popup-content .content-body {
    color: var(--text);
    line-height: 1.6;
}

.placement-popup-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.placement-popup-footer .btn {
    min-width: 120px;
}

/* Custom Placements */
.placement-custom {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text);
}

/* Placement Loading States */
.placement-container.loading {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

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

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Content Blocker Detection */
.blocker-notice {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
    display: none;
}

.blocker-notice.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .placement-section.placement-header {
        padding: 1rem 0;
        margin: 1rem 0;
    }
    
    .placement-banner .content-image {
        height: 80px;
    }
    
    .placement-sidebar .content-image {
        height: 150px;
    }
    
    .placement-popup {
        width: 95%;
        margin: 1rem;
    }
    
    .placement-popup-content {
        padding: 1rem;
    }
    
    .placement-popup-content .content-image {
        max-height: 200px;
    }
    
    .sidebar-placements {
        position: static;
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    .placement-banner .content-image {
        height: 60px;
    }
    
    .placement-sidebar {
        padding: 0.75rem;
    }
    
    .placement-sidebar .content-image {
        height: 120px;
    }
    
    .placement-footer {
        padding: 1rem;
    }
    
    .placement-popup-header,
    .placement-popup-content,
    .placement-popup-footer {
        padding: 1rem;
    }
}

/* Dark Mode Optimizations */
@media (prefers-color-scheme: dark) {
    .placement-container {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .content-label {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .placement-popup-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Sky Placements (160x600) */
.sky-placements-container {
    position: relative;
    pointer-events: none; /* Allow clicks to pass through to content */
    z-index: 1;
}

.sky-placement {
    position: fixed !important;
    top: 100px !important;
    width: 160px !important;
    height: 600px !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
    /* Use transform3d for hardware acceleration */
    transform: translate3d(0, 0, 0) !important;
    will-change: auto !important;
}

.sky-placement--left {
    left: 20px !important;
}

.sky-placement--right {
    right: 20px !important;
}

/* Force visibility and positioning */
.sky-placement {
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
    z-index: 999 !important;
    position: fixed !important;
}

/* Force placement-container visibility */
.sky-placement .placement-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Remove loading state */
.sky-placement .placement-container.loading {
    display: block !important;
}

/* Sky Placement Content */
.sky-placement .placement-container {
    width: 100%;
    height: 100%;
    margin: 0;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Empty sky placement placeholder */
.sky-placement .placement-container:empty::before {
    content: "160×600\AContent Area";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
    white-space: pre-line;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 2px dashed rgba(255,255,255,0.1);
}

.sky-placement .placement-sky {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sky-placement .content-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.sky-placement .content-body {
    padding: 1rem;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.sky-placement .content-label {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Sky Placement Hover Effects */
.sky-placement:hover .placement-container {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.sky-placement:hover .content-image {
    transform: scale(1.05);
}

/* Sky Placement Close Button */
.sky-placement .content-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    z-index: 20;
    transition: all 0.3s ease;
}

.sky-placement .content-close:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: scale(1.1);
}

/* Responsive Design for Sky Placements */
@media (max-width: 1400px) {
    .sky-placement--left {
        left: 10px;
    }
    
    .sky-placement--right {
        right: 10px;
    }
}

@media (max-width: 1200px) {
    .sky-placement {
        width: 120px;
        height: 480px;
    }
    
    .sky-placement--left {
        left: 5px;
    }
    
    .sky-placement--right {
        right: 5px;
    }
}

/* Hide sky placements on tablets and mobile */
@media (max-width: 1024px) {
    .sky-placements-container,
    .sky-placement {
        display: none !important;
    }
}

/* Print Styles */
@media print {
    .placement-container,
    .placement-section,
    .sidebar-placements,
    .placement-popup-overlay,
    .sky-placements-container,
    .sky-placement {
        display: none !important;
    }
}
