/* Enhanced Ad System Styling */

/* Ad Container Enhancements */
.ad-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(30, 60, 114, 0.1);
}

.ad-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Islamic-themed ad styling */
.ad-islamic {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: 2px solid #d4af37;
}

.ad-islamic .ad-title {
    color: #d4af37;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ad-islamic .ad-description {
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Video Ad Enhancements */
.video-ad-container {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.video-play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.video-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    color: #1e3c72;
    font-size: 24px;
}

/* Ad Position Specific Styling */
.ad-homepage-center {
    max-width: 600px;
    margin: 30px auto;
    text-align: center;
}

.ad-homepage-bottom {
    width: 100%;
    margin: 20px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 3px solid #d4af37;
}

.ad-dashboard-top,
.ad-dashboard-bottom {
    margin: 15px 0;
    padding: 20px;
    border-left: 4px solid #1e3c72;
}

.ad-journal-top,
.ad-journal-bottom {
    margin: 20px 0;
    border-radius: 10px;
    background: rgba(30, 60, 114, 0.05);
    border: 1px solid rgba(30, 60, 114, 0.1);
}

.ad-gate {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 15px;
    margin: 30px 0;
}

.ad-gate .ad-title {
    color: #d4af37;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Ad Content Styling */
.ad-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e3c72;
}

.ad-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #555;
}

.ad-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.ad-cta-button {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ad-cta-button:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    border-color: #d4af37;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Ad Badge/Label */
.ad-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(212, 175, 55, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .ad-container {
        margin: 15px 5px;
        border-radius: 8px;
    }
    
    .ad-homepage-center {
        max-width: 100%;
        margin: 20px 10px;
    }
    
    .ad-gate {
        padding: 30px 15px;
        margin: 20px 5px;
    }
    
    .ad-title {
        font-size: 1.1rem;
    }
    
    .ad-description {
        font-size: 0.9rem;
    }
    
    .ad-cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .video-play-button {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Loading States */
.ad-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.ad-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ad Performance Indicators (for admin) */
.ad-performance {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ad-container:hover .ad-performance {
    opacity: 1;
}

/* Enhanced hover effects */
.ad-interactive {
    cursor: pointer;
    transition: all 0.3s ease;
}

.ad-interactive:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.15);
}

/* Accessibility improvements */
.ad-container:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.ad-cta-button:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ad-container {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        border-color: rgba(212, 175, 55, 0.2);
    }
    
    .ad-title {
        color: #ecf0f1;
    }
    
    .ad-description {
        color: #bdc3c7;
    }
}