/**
 * Bulletin Slider Module — Standalone CSS
 * اللوحة الإعلانية المتحركة — ملف تنسيق مستقل
 * مجموعة الوكالة التجارية
 *
 * يُحمَّل تلقائياً من داخل bulletin_slider.php
 * ليعمل في أي صفحة (dashboard.php / index.php / store.php) دون الحاجة لـ dashboard.css
 */

/* === المتغيرات الاحتياطية (تُستخدم عند غياب dashboard.css) === */
:root {
    --bs-radius-lg: 14px;
    --bs-radius-sm: 6px;
    --bs-radius-pill: 9999px;
    --bs-shadow-md: 0 4px 18px rgba(0,0,0,0.18);
    --bs-shadow-lg: 0 8px 30px rgba(0,0,0,0.28);
    --bs-transition: 0.2s ease;
    --bs-brand-gradient: linear-gradient(135deg, #E30613 0%, #891811 100%);
    --bs-metallic-border: rgba(140,140,140,0.35);
}

/* === الحاوية الرئيسية للسلايدر === */
.bulletin-slider {
    width: 100%;
    height: clamp(120px, 30vw, 200px);
    border-radius: var(--radius-lg, var(--bs-radius-lg));
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-md, var(--bs-shadow-md));
    background: linear-gradient(135deg, #1A1A1A 0%, #2D3748 100%);
    border: 1px solid var(--metallic-border, var(--bs-metallic-border));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
    transition: transform 0.3s ease;
}

.bulletin-slider:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg, var(--bs-shadow-lg));
}

/* === حاوية الشرائح — الشرائح مكدّسة فوق بعضها === */
.bulletin-slides {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* === شريحة واحدة — مخفية بشكل افتراضي === */
.bulletin-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

/* === الشريحة النشطة — ظاهرة فقط === */
.bulletin-slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* === نوع الصورة الكاملة (is-graphic) === */
.bulletin-slide.is-graphic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg, var(--bs-radius-lg));
}

/* === نوع البطاقة النصية (is-card) === */
.bulletin-card-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 14px;
    position: relative;
    box-sizing: border-box;
}

.bulletin-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 75%;
    z-index: 2;
}

/* === وسم التصنيف (Tag) === */
.bulletin-slide-tag {
    align-self: flex-start;
    font-size: 0.64rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-pill, var(--bs-radius-pill));
    background: var(--brand-primary-gradient, var(--bs-brand-gradient));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(137, 24, 17, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}

.bulletin-slide.is-graphic .bulletin-slide-tag {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 5;
}

/* === عنوان ووصف الشريحة === */
.bulletin-slide-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bulletin-slide-desc {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === زر الإجراء CTA === */
.bulletin-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 2;
}

.bulletin-cta-btn {
    padding: 4px 12px !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    border-radius: var(--radius-sm, var(--bs-radius-sm)) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28), inset 0 1px 1px #ffffff !important;
    transition: all 0.2s ease !important;
    background: linear-gradient(135deg, #c8c8c8 0%, #a0a0a0 50%, #e8e8e8 100%);
    color: #1a1a1a;
    border: none;
    cursor: pointer;
}

.bulletin-cta-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 2px #ffffff !important;
    color: #1a1a1a;
}

/* === نقاط التنقل (Indicators) === */
.bulletin-indicators {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.bulletin-dot {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-pill, var(--bs-radius-pill));
    transition: all 0.3s ease;
    cursor: pointer;
}

.bulletin-dot.active {
    width: 18px;
    background: var(--brand-primary-gradient, var(--bs-brand-gradient));
    box-shadow: 0 0 8px rgba(227, 6, 19, 0.7);
}
