/**
 * Breaking News Bar - Frontend Styles
 * Modern, Eye-Catching Designs with Zero Animation Impact
 */

/* Base Breaking News Bar */
.bnb-bar {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform, opacity;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    overflow: visible;
    min-height: 50px;
}

.bnb-bar.bnb-top {
    top: 0;
}

.bnb-bar.bnb-bottom {
    bottom: 0;
}

.bnb-bar.bnb-hidden {
    opacity: 0;
    pointer-events: none;
}

.bnb-bar.bnb-top.bnb-hidden {
    transform: translateY(-100%);
}

.bnb-bar.bnb-bottom.bnb-hidden {
    transform: translateY(100%);
}

/* Inner Container */
.bnb-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
    position: relative;
}

/* Icon */
.bnb-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: inline-block;
}

/* Title */
.bnb-title {
    font-weight: 800;
    letter-spacing: 0.5px;
    flex: 1;
    font-size: 1.4em;
    line-height: 1.3;
    text-align: center;
    display: block;
    padding: 0 10px;
}

.bnb-title a {
    color: inherit;
    text-decoration: none;
}

.bnb-title a:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .bnb-title {
        font-size: 1.2em;
    }
}

/* Title Styles */
.bnb-bar.bnb-title-normal .bnb-title {
    font-weight: 700;
}

.bnb-bar.bnb-title-bold .bnb-title {
    font-weight: 800;
}

.bnb-bar.bnb-title-extra-bold .bnb-title {
    font-weight: 900;
    font-size: 1.6em;
    letter-spacing: 1px;
}

.bnb-bar.bnb-title-uppercase .bnb-title {
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
}

.bnb-bar.bnb-title-glow .bnb-title {
    font-weight: 800;
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 30px currentColor;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor; }
    50% { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor, 0 0 40px currentColor; }
}

.bnb-bar.bnb-title-shadow .bnb-title {
    font-weight: 900;
    text-shadow: 
        3px 3px 0 rgba(0,0,0,0.3),
        6px 6px 0 rgba(0,0,0,0.2),
        9px 9px 0 rgba(0,0,0,0.1);
}

.bnb-bar.bnb-title-outline .bnb-title {
    font-weight: 900;
    -webkit-text-stroke: 2px rgba(0,0,0,0.5);
    text-stroke: 2px rgba(0,0,0,0.5);
    font-size: 1.5em;
}

.bnb-bar.bnb-title-gradient-text .bnb-title {
    font-weight: 900;
    background: linear-gradient(45deg, #ff0000, #ffff00, #00ff00, #00ffff, #ff00ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Close Button */
.bnb-close {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
    position: fixed !important;
    right: auto !important;
    left: 15px !important;
    z-index: 99999 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* للشريط في الأعلى - الزر أسفل الشريط بمسافة صغيرة */
.bnb-top .bnb-close {
    top: calc(var(--bar-height, 60px) + 5px) !important;
    bottom: auto !important;
}

/* للشريط في الأسفل - الزر فوق الشريط بمسافة صغيرة */
.bnb-bottom .bnb-close {
    bottom: calc(var(--bar-height, 60px) + 5px) !important;
    top: auto !important;
}

.bnb-close:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
}

.bnb-close:active {
    transform: scale(0.9);
}

/* Responsive للموبايل */
@media (max-width: 768px) {
    .bnb-close {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        left: 12px !important;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    }
    
    .bnb-top .bnb-close {
        top: calc(var(--bar-height, 60px) + 5px) !important;
    }
    
    .bnb-bottom .bnb-close {
        bottom: calc(var(--bar-height, 60px) + 5px) !important;
    }
}

/* Design Styles */

/* Modern Design */
.bnb-bar.bnb-design-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.bnb-bar.bnb-design-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

/* Minimal Design */
.bnb-bar.bnb-design-minimal {
    background: #ffffff;
    color: #1e1e1e;
    border-bottom: 3px solid #1e1e1e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.bnb-bar.bnb-design-minimal.bnb-top {
    border-bottom: 3px solid #1e1e1e;
    border-top: none;
}

.bnb-bar.bnb-design-minimal.bnb-bottom {
    border-top: 3px solid #1e1e1e;
    border-bottom: none;
}

.bnb-bar.bnb-design-minimal .bnb-title {
    background: #1e1e1e;
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 20px;
}

/* Bold Design */
.bnb-bar.bnb-design-bold {
    background: #ff0000;
    color: #ffffff;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 6px 30px rgba(255, 0, 0, 0.4);
}

.bnb-bar.bnb-design-bold .bnb-title {
    font-size: 1.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.bnb-bar.bnb-design-bold .bnb-content {
    font-weight: 800;
}

/* Elegant Design */
.bnb-bar.bnb-design-elegant {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-top: 3px solid rgba(44, 62, 80, 0.1);
    border-bottom: 3px solid rgba(44, 62, 80, 0.1);
}

.bnb-bar.bnb-design-elegant .bnb-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 600;
    color: #34495e;
}

.bnb-bar.bnb-design-elegant .bnb-icon {
    opacity: 0.7;
}

/* Gradient Design */
.bnb-bar.bnb-design-gradient {
    background: linear-gradient(90deg, 
        #ff6b6b 0%, 
        #feca57 25%, 
        #48dbfb 50%, 
        #ff9ff3 75%, 
        #ff6b6b 100%
    );
    background-size: 200% 100%;
    color: #ffffff;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.bnb-bar.bnb-design-gradient .bnb-title {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* Neon Design */
.bnb-bar.bnb-design-neon {
    background: #000000;
    color: #00ff00;
    border: 2px solid #00ff00;
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.bnb-bar.bnb-design-neon .bnb-title {
    text-shadow: 0 0 15px rgba(0, 255, 0, 1);
    animation: bnbNeonPulse 2s ease-in-out infinite;
}

.bnb-bar.bnb-design-neon .bnb-icon {
    filter: drop-shadow(0 0 10px #00ff00);
}

@keyframes bnbNeonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Clickable State */
.bnb-bar[data-clickable="true"] {
    cursor: pointer;
}

.bnb-bar[data-clickable="true"]:hover {
    transform: scale(1.01);
}

.bnb-bar.bnb-top[data-clickable="true"]:hover {
    transform: translateY(-2px) scale(1.01);
}

.bnb-bar.bnb-bottom[data-clickable="true"]:hover {
    transform: translateY(2px) scale(1.01);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .bnb-bar {
        font-size: 14px;
        gap: 10px;
    }
    
    .bnb-bar-inner {
        padding: 0 15px;
        gap: 10px;
    }
    
    .bnb-icon {
        font-size: 20px;
    }
    
    .bnb-title {
        font-size: 0.9em;
    }
    
    .bnb-close {
        padding: 4px 10px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .bnb-bar {
        font-size: 13px;
    }
    
    .bnb-bar-inner {
        flex-wrap: wrap;
        text-align: center;
        justify-content: center;
    }
    
    .bnb-content {
        width: 100%;
        order: 2;
    }
    
    .bnb-close {
        position: absolute;
        top: 5px;
        right: 5px;
    }
}

/* Animation Entrance Styles */
.bnb-animation-fade {
    animation: bnbFadeIn 0.5s ease;
}

.bnb-animation-slide {
    animation: bnbSlideIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bnb-animation-bounce {
    animation: bnbBounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bnbFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bnbSlideIn {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.bnb-bottom.bnb-animation-slide {
    animation-name: bnbSlideInBottom;
}

@keyframes bnbSlideInBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes bnbBounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading State */
.bnb-loading {
    position: relative;
    overflow: hidden;
}

.bnb-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: bnbShimmer 1.5s infinite;
}

@keyframes bnbShimmer {
    to {
        left: 100%;
    }
}

/* Accessibility */
.bnb-bar:focus-within {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: -3px;
}

.bnb-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .bnb-bar {
        display: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bnb-bar {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bnb-bar,
    .bnb-bar *,
    .bnb-close {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bnb-bar.bnb-design-minimal {
        background: #1e1e1e;
        color: #ffffff;
        border-color: #ffffff;
    }
    
    .bnb-bar.bnb-design-minimal .bnb-title {
        background: #ffffff;
        color: #1e1e1e;
    }
}
