/* =================================
   AAMP Public Styles
   واجهة الإعلانات الأمامية
   ================================= */

/* الحاوية الرئيسية */
.aamp-ad-container {
    margin: 20px auto;
    text-align: center;
    clear: both;
    position: relative;
    overflow: hidden;
}

/* الرابط */
.aamp-ad-link {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.2s ease;
    position: relative;
}

.aamp-ad-link:hover {
    opacity: 0.85;
    transform: scale(0.98);
}

.aamp-ad-link:focus {
    outline: 2px solid #2271b1;
    outline-offset: 3px;
}

/* الصورة */
.aamp-ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* مواقع الإعلانات المختلفة */
.aamp-location-header {
    margin: 0 auto 20px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.aamp-location-footer {
    margin: 30px auto 20px;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
}

.aamp-location-sidebar_right,
.aamp-location-sidebar_left {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.aamp-location-before_content {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e0e0e0;
}

.aamp-location-after_content {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #e0e0e0;
}

.aamp-location-widget {
    margin: 15px 0;
}

.aamp-location-shortcode {
    margin: 15px 0;
    display: inline-block;
}

/* Widget Styling */
.widget .aamp-ad-container {
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.widget .aamp-ad-image {
    box-shadow: none;
}

/* حالة التحميل */
.aamp-ad-loading {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    border-radius: 4px;
}

.aamp-ad-loading::before {
    content: "⏳";
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
}

/* حالة الخطأ */
.aamp-ad-error {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    text-align: center;
    color: #856404;
    border-radius: 4px;
}

/* أنيميشن الظهور */
@keyframes aampFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aamp-ad-container {
    animation: aampFadeIn 0.5s ease-out;
}

/* =================================
   Responsive Design
   ================================= */

/* Tablets */
@media (max-width: 1024px) {
    .aamp-ad-container {
        margin: 15px auto;
    }
    
    .aamp-location-header,
    .aamp-location-footer {
        padding: 15px 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .aamp-ad-container {
        margin: 15px auto;
        padding: 0 10px;
    }
    
    .aamp-ad-image {
        border-radius: 6px;
    }
    
    .aamp-location-sidebar_right,
    .aamp-location-sidebar_left {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .aamp-location-before_content,
    .aamp-location-after_content {
        margin: 20px 0;
        padding: 15px 0;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .aamp-ad-container {
        margin: 10px auto;
        padding: 0 5px;
    }
    
    .aamp-location-header {
        margin-bottom: 15px;
    }
    
    .aamp-location-footer {
        margin-top: 20px;
    }
    
    .widget .aamp-ad-container {
        padding: 8px;
    }
}

/* =================================
   Dark Mode Support
   ================================= */

@media (prefers-color-scheme: dark) {
    .aamp-location-sidebar_right,
    .aamp-location-sidebar_left {
        background: #1a1a1a;
        border: 1px solid #333;
    }
    
    .widget .aamp-ad-container {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .aamp-ad-loading {
        background: #1a1a1a;
        border-color: #444;
        color: #aaa;
    }
}

/* =================================
   Print Styles
   ================================= */

@media print {
    .aamp-ad-container {
        display: none !important;
    }
}

/* =================================
   Accessibility
   ================================= */

/* للأشخاص الذين يفضلون تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .aamp-ad-container {
        animation: none;
    }
    
    .aamp-ad-link {
        transition: none;
    }
}

/* تحسين التباين */
@media (prefers-contrast: high) {
    .aamp-ad-image {
        border: 2px solid #000;
    }
    
    .aamp-ad-link:focus {
        outline-width: 3px;
    }
}