/* ============================================
   🎨 Ultra CMS - Premium Frontend Theme
   Version: 2.0 - Professional Edition
   ============================================ */

:root {
    /* متغيرات محقونة من قاعدة البيانات (قالب الموقع) */
    --primary:   #6366f1;
    --secondary: #0ea5e9;
    --bg:        #ffffff;
    --text:      #1e293b;
    --font-ar:   'Cairo', 'Tajawal', sans-serif;

    /* Default Colors (Light) — derived from the bridged vars above */
    --primary-color: var(--primary);
    --secondary-color: var(--secondary);
    --accent-color: #f59e0b;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --text-main: var(--text);
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --bg-body: var(--bg);
    --bg-card: #ffffff;
    --bg-header: #ffffff;

    /* Variables */
    --header-height: 80px;
    --top-bar-height: 40px;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.12), 0 2px 6px -2px rgba(15,23,42,0.08);
    --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, 0.16), 0 6px 16px -4px rgba(15,23,42,0.1);

    /* Transitions */
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
body.dark-mode {
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Outfit', var(--font-ar), sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .logo-text, .navbar-ultra .nav-link, .footer-widget-title, .megamenu-title {
    font-family: var(--font-ar), 'Outfit', sans-serif;
}

/* ============================================
   🔝 Top Bar
   ============================================ */
.top-bar {
    height: var(--top-bar-height);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    font-size: 0.85rem;
    position: relative;
    z-index: 1050;
}

.hover-accent:hover {
    color: var(--secondary-color) !important;
    text-decoration: none;
}

.social-links-mini a {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 5px;
    transition: var(--transition-base);
    font-size: 0.9rem;
}

.social-links-mini a:hover {
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   🦅 Main Header
   ============================================ */
.main-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

body.dark-mode .logo-text {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-ad {
    background-color: rgba(0, 0, 0, 0.03);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .header-ad {
    background-color: rgba(255, 255, 255, 0.03);
}

/* ============================================
   🧭 Navigation Bar
   ============================================ */
.navbar-ultra {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    box-shadow: var(--shadow-sm);
}

.navbar-ultra .nav-link {
    color: var(--text-main);
    font-weight: 600;
    padding: 18px 20px !important;
    position: relative;
    transition: var(--transition-base);
}

.navbar-ultra .nav-link:hover,
.navbar-ultra .nav-link.active,
.navbar-ultra .nav-link.show {
    color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.04);
}

.navbar-ultra .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: right;
}

.navbar-ultra .nav-link:hover::after,
.navbar-ultra .nav-link.active::after {
    transform: scaleX(1);
}

/* Mega Menu */
.has-megamenu {
    position: static;
}

.megamenu {
    width: 100%;
    left: 0;
    right: 0;
    margin-top: 0;
    border: none;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
    background-color: var(--bg-card);
    padding: 30px 0;
}

.megamenu-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(79, 70, 229, 0.1);
    display: inline-block;
}

.megamenu ul li a {
    display: block;
    padding: 8px 0;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-base);
    font-weight: 500;
}

.megamenu ul li a:hover {
    color: var(--text-main);
    padding-right: 8px;
}

.megamenu-featured img {
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.megamenu-featured:hover img {
    transform: scale(1.02);
}

/* ============================================
   🔍 Search
   ============================================ */
.search-form input {
    background-color: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    color: var(--text-main);
    transition: var(--transition-base);
}

body.dark-mode .search-form input {
    background-color: rgba(255, 255, 255, 0.05);
}

.search-form input:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* ============================================
   ⚡ Breaking News
   ============================================ */
.breaking-news-wrapper {
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.breaking-news-container {
    background-color: var(--bg-card);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.news-label {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
    z-index: 2;
}

.news-ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 24px;
    margin-right: 15px;
}

.ticker-item {
    position: absolute;
    width: 100%;
    animation: tickerSlide 15s infinite linear;
    opacity: 0;
    white-space: nowrap;
}

.ticker-item a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.ticker-item a:hover {
    color: var(--primary-color);
}

@keyframes tickerSlide {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }

    5% {
        transform: translateY(0);
        opacity: 1;
    }

    30% {
        transform: translateY(0);
        opacity: 1;
    }

    35% {
        transform: translateY(-100%);
        opacity: 0;
    }

    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.ticker-item:nth-child(1) {
    animation-delay: 0s;
}

.ticker-item:nth-child(2) {
    animation-delay: 5s;
}

.ticker-item:nth-child(3) {
    animation-delay: 10s;
}

/* ============================================
   📱 Mobile Menu
   ============================================ */
.hamburger-icon span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    margin: 5px 0;
    border-radius: 3px;
    transition: var(--transition-base);
}

/* ============================================
   📄 Footer
   ============================================ */
.footer-ultra {
    background-color: #0f172a;
    color: #cbd5e1;
    padding-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-widget-title {
    color: white;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}

.footer-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: white;
    padding-right: 8px;
}

.footer-links a i {
    font-size: 0.8rem;
    margin-left: 10px;
    color: var(--primary-color);
}

.footer-bottom {
    background-color: #020617;
    padding: 25px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

/* ============================================
   🛠 Utility Classes
   ============================================ */
.extra-small {
    font-size: 0.75rem;
}

.object-cover {
    object-fit: cover;
}

.rounded-xl {
    border-radius: 12px;
}

.shadow-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}