/* ======== الإعدادات الأساسية (Reset & Base) ======== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #0b132b; 
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #ffffff;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* إزالة الإطار الأزرق عند اللمس */
a, button, input, label, img, .hamburger {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
a:focus-visible, button:focus-visible {
    outline: 2px solid #00aaff;
    outline-offset: 2px;
}


/* ======== 1. الهيدر (شريط التنقل) ======== */
/* ( ... كود الهيدر كما هو ... ) */
.main-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    position: fixed;
    width: 100%;
    z-index: 1000; 
}
.main-header .container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}
.logo {
    line-height: 0; 
}
.logo-img {
    max-height: 40px; 
    width: auto;
}


/* ======== كود زر الهمبرجر المتحرك ======== */
/* ( ... كود زر الهمبرجر كما هو ... ) */
.hamburger {
  cursor: pointer;
  height: 2.2em; 
  z-index: 1001; 
  position: relative; 
}
.hamburger input {
  display: none;
}
.hamburger svg {
  height: 100%; 
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.line {
  fill: none;
  stroke: white; 
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  transition: stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1),
              stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.line-top-bottom {
  stroke-dasharray: 12 63;
}
.hamburger input:checked + svg {
  transform: rotate(-45deg);
}
.hamburger input:checked + svg .line-top-bottom {
  stroke-dasharray: 20 300;
  stroke-dashoffset: -32.42;
}
.menu-toggle {
    display: block; 
    background: none;
    border: none;
    cursor: pointer;
}


/* ======== 3. القائمة الجانبية (Sidebar) ======== */
/* ( ... كود القائمة الجانبية بالكامل كما هو ... ) */
.sidebar {
    position: fixed; 
    top: 0;
    right: -320px; 
    width: 320px; 
    height: 100vh; 
    background-color: #111a30; 
    padding: 20px;
    padding-top: 85px; 
    z-index: 999; 
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    overflow-y: auto; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.2); 
    scrollbar-width: thin;
    scrollbar-color: #00aaff #111a30;
}
.sidebar::-webkit-scrollbar {
    width: 8px;
}
.sidebar::-webkit-scrollbar-track {
    background: #111a30;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: #00aaff;
    border-radius: 4px;
}
.sidebar.open {
    right: 0; 
}
.sidebar-section {
    margin-bottom: 20px;
}
.sidebar-section h4 {
    color: #00aaff; 
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid #2a3a5a;
    padding-bottom: 8px;
    display: flex; 
    align-items: center;
}
.sidebar-section h4.ai-title i {
    margin-left: 8px; 
    color: #00e0ff; 
}
.sidebar ul li {
    margin-bottom: 5px; 
}
.sidebar ul li a {
    display: flex;
    align-items: center;
    color: #e6f7ff; 
    font-size: 15px;
    padding: 10px 10px; 
    border-radius: 5px;
    transition: background-color 0.3s ease;
}
.sidebar ul li a:hover {
    background-color: rgba(0, 170, 255, 0.1); 
    color: #fff;
}
.sidebar ul li a i {
    font-size: 16px; 
    width: 30px; 
    text-align: center;
    margin-left: 10px; 
}

/* ======== 4. تذييل القائمة الجانبية ======== */
/* ( ... كود تذييل القائمة كما هو ... ) */
.sidebar-footer {
    border-top: 1px solid #2a3a5a;
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}
.social-links {
    margin-bottom: 20px;
}
.social-links a {
    font-size: 24px; 
    margin: 0 10px;
    color: #aaa;
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: #00aaff;
}
.social-links a[href="update.html"] {
    display: inline-block; 
    font-size: 16px; 
    background: #00aaff;
    color: #111a30;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    margin-right: 10px;
}
.social-links a[href="update.html"] i {
    margin-left: 5px;
}
.social-links a[href="update.html"]:hover {
    background: #fff;
}
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px; 
    margin-bottom: 20px;
}
.footer-nav a {
    color: #bbb;
    font-size: 14px;
    transition: color 0.3s ease;
}
.footer-nav a:hover {
    color: #fff;
}
.footer-nav a i {
    margin-left: 4px;
}
.copyright {
    font-size: 12px;
    color: #777;
    line-height: 1.5;
}
.copyright strong {
    color: #999;
}


/* ======== 2. المحتوى الرئيسي (شبكة الأدوات) ======== */
.tools-section {
    min-height: 100vh;
    padding-top: 100px; 
    padding-bottom: 50px;
}
.section-title {
    font-size: 28px;
    color: #e6f7ff;
    border-bottom: 2px solid #00aaff;
    padding-bottom: 10px;
    margin-bottom: 30px;
    margin-top: 40px; 
    display: inline-flex; 
    align-items: center;
    gap: 10px; 
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px; 
}

/* (تعديل) إضافة position relative و padding-top */
.tool-card {
    position: relative; /* لجعل الشارة (badge) تتموضع بداخله */
    background-color: #111a30; 
    border-radius: 10px;
    /* (تعديل) إضافة مساحة للشارة في الأعلى */
    padding: 40px 25px 25px 25px; 
    display: flex; 
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #2a3a5a; 
    overflow: hidden; /* لإخفاء أي تجاوز للشارة */
}
.tool-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 20px rgba(0, 170, 255, 0.15); 
    border-color: #00aaff; 
}
.card-icon {
    flex-shrink: 0; 
}
.card-icon i {
    font-size: 32px; 
    color: #00aaff; 
    line-height: 1; 
}
.card-content h3 {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 5px;
    font-weight: 700;
}
.card-content p {
    font-size: 14px;
    color: #c0d0f0; 
    line-height: 1.5;
}

/* ======== (جديد) كود شارات AI / FREE ======== */
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px; /* (ستكون في أعلى اليسار - أعلى اليمين في RTL) */
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 5px;
    z-index: 2;
    text-transform: uppercase;
    
    /* (متغيرات لون التوهج) */
    --glow-color: rgba(255, 255, 255, 0.7);
    animation: glow 2s ease-in-out infinite;
}

/* (لإضافة صورة متحركة بدلاً من النص) */
.card-badge img {
    height: 16px; /* تحكم بحجم الأيقونة المتحركة */
    width: auto;
    display: block;
}

/* لون شارة AI */
.card-badge.ai {
    background-color: #00e0ff;
    color: #111a30;
    --glow-color: rgba(0, 224, 255, 0.7);
}

/* لون شارة FREE */
.card-badge.free {
    background-color: #00ff7f; /* أخضر فاتح */
    color: #111a30;
    --glow-color: rgba(0, 255, 127, 0.7);
}

/* (جديد) حركة التوهج (النبض) */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px 0px var(--glow-color);
    }
    50% {
        box-shadow: 0 0 10px 3px var(--glow-color);
    }
}


/* ======== 5. شريط ملفات تعريف الارتباط (Cookies) ======== */
/* ( ... كود الكوكيز كما هو ... ) */
.cookie-banner {
    opacity: 0;
    transform: translateY(30px); 
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    pointer-events: none; 
    position: fixed;
    bottom: 25px;
    right: 25px; 
    width: auto;
    max-width: 420px; 
    background-color: #111a30; 
    padding: 25px;
    z-index: 2000; 
    border-top: 2px solid #00aaff; 
    box-shadow: 0 5px 20px rgba(0, 170, 255, 0.2); 
    border-radius: 10px; 
}
.cookie-banner.show {
    opacity: 1;
    transform: translateY(0); 
    pointer-events: auto; 
}
.cookie-banner .container {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    gap: 15px; 
    padding: 0; 
}
.cookie-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%; 
}
.cookie-icon {
    font-size: 32px;
    color: #00aaff;
    margin-left: 5px;
}
.cookie-content p {
    color: #e6f7ff;
    font-size: 14px;
    line-height: 1.5;
    text-align: right; 
}
.cookie-content p a {
    color: #00aaff; 
    text-decoration: underline;
}
.cookie-content p a:hover {
    color: #fff;
}
.cookie-buttons {
    display: flex;
    gap: 10px;
    width: 100%; 
    justify-content: space-between; 
}
.cookie-btn {
    padding: 8px 15px; 
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1; 
    text-align: center;
}
.cookie-btn.btn-accept {
    background-color: #00aaff;
    color: #111a30;
}
.cookie-btn.btn-accept:hover {
    background-color: #fff;
}
.cookie-btn.btn-essential {
    background-color: transparent;
    color: #00aaff;
    border: 2px solid #00aaff;
}
.cookie-btn.btn-essential:hover {
    background-color: #00aaff;
    color: #111a30;
}


/* ======== التجاوب (Responsive) ======== */
@media (max-width: 768px) {
    /* تجاوب شبكة الأدوات */
    .section-title {
        font-size: 22px;
    }
    .tool-card {
        padding: 40px 20px 20px 20px; /* تعديل الـ padding للموبايل */
        gap: 15px;
    }
    .card-icon i {
        font-size: 28px;
    }
    .card-content h3 {
        font-size: 16px;
    }
    .card-content p {
        font-size: 13px;
    }
    
    /* (تعديل بسيط لبطاقة الكوكيز على الشاشات الصغيرة جداً) */
    .cookie-banner {
        right: 15px;
        left: 15px;
        bottom: 15px;
        max-width: none; 
    }
}