/* استيراد المتغيرات والخطوط من الملف الرئيسي */
@import url('../style.css');

/* ========================
   NAVBAR FIX (إصلاح القائمة واللوجو)
   ======================== */
.blog-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: rgba(3, 5, 8, 0.95); /* خلفية غامقة عشان يبين */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: fixed; /* تثبيت القائمة فوق */
    top: 0; 
    left: 0;
    width: 100%;
    z-index: 1000;
}

/* أهم سطر: تصغير اللوجو */
.nav-logo img {
    height: 45px !important; /* اجباري يصغر */
    width: auto;
    display: block;
}

.nav-home-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-home-link:hover {
    color: #00d2ff;
}

/* تضبيط الهيرو عشان ما يتغطى بالنافبار */
.tools-hero {
    padding-top: 150px; /* مساحة من فوق */
}
/* =========================================
   1. TOOLS HUB HERO (الواجهة الرئيسية)
   ========================================= */
.tools-hero {
    padding: 160px 5% 80px;
    text-align: center;
    background: radial-gradient(circle at top, #1e293b 0%, var(--dark-deep) 70%);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* شبكة ليزر في الخلفية (Matrix Effect) */
.tools-bg-grid {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 210, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 210, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle, black 30%, transparent 80%);
    z-index: 0;
    pointer-events: none;
}

.tools-hero-content {
    position: relative;
    z-index: 2;
}

.tools-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

/* =========================================
   2. TOOLS GRID (البطاقات)
   ========================================= */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 80px 8% 120px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* تصميم الكرت */
.tool-card {
    background: rgba(20, 25, 35, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 35px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* خط نيون علوي يظهر عند الهوفر */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: var(--accent-blue); /* أو #00d2ff */
    transform: scaleX(0);
    transform-origin: left;
    transition: 0.4s;
    box-shadow: 0 0 10px var(--accent-blue);
}

.tool-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 210, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

/* الأيقونة */
.tool-icon {
    width: 60px; height: 60px;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    color: #00d2ff;
    margin-bottom: 25px;
    transition: 0.4s;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.tool-card:hover .tool-icon {
    background: #00d2ff;
    color: black;
    transform: rotate(-10deg) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.tool-name {
    font-size: 1.4rem;
    color: white;
    margin-bottom: 10px;
    font-weight: 700;
}

.tool-desc {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
}

/* =========================================
   3. BINARY CONVERTER UI (واجهة التحويل)
   ========================================= */
.converter-container {
    max-width: 1100px;
    margin: -50px auto 100px; /* تداخل مع الهيرو */
    position: relative;
    z-index: 5;
    padding: 0 20px;
}

.converter-box {
    background: #0a0e14;
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    display: grid;
    grid-template-columns: 1fr 80px 1fr; /* مدخل - أزرار - مخرج */
    gap: 30px;
    align-items: stretch;
}

/* مناطق الكتابة */
.io-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.io-label {
    color: #00d2ff;
    font-weight: 700;
    font-size: 1rem;
    display: flex; 
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 210, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(0, 210, 255, 0.1);
}

.code-area {
    width: 100%;
    height: 350px;
    background: #05080f;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    color: #00d2ff; /* لون النص زي الماتريكس */
    font-family: 'Courier New', monospace; /* خط برمجي */
    font-size: 1.1rem;
    resize: none;
    transition: 0.3s;
    line-height: 1.6;
}

.code-area::placeholder { color: #334155; }

.code-area:focus {
    outline: none;
    border-color: #00d2ff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.1);
    background: #020305;
}

/* أزرار الوسط (التبديل) */
.controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ctrl-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover {
    background: #00d2ff;
    color: black;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 15px #00d2ff;
}

/* أزرار الإجراءات الصغيرة (نسخ / مسح) */
.action-row {
    display: flex;
    gap: 8px;
}

.mini-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

.mini-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.mini-btn.copy:hover { color: #10b981; } /* أخضر للنسخ */
.mini-btn.clear:hover { color: #ef4444; } /* أحمر للمسح */

/* --- Mobile Optimization --- */
@media (max-width: 900px) {
    .converter-box {
        grid-template-columns: 1fr; /* العناصر تحت بعض */
        padding: 25px;
        gap: 20px;
    }

    .controls { 
        flex-direction: row; /* الأزرار جنب بعض */
        padding: 10px 0;
    }
    
    .code-area { height: 200px; font-size: 1rem; }
    
    .tools-grid { padding: 40px 5% 80px; }
    .tools-title { font-size: 2.5rem; }
}

/* ========================
   WHATSAPP TOOL STYLES
   ======================== */

.wa-tool-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto 80px;
    align-items: center;
}

/* Inputs Side */
.wa-inputs {
    background: #0a0e14;
    border: 1px solid rgba(37, 211, 102, 0.2); /* أخضر واتساب خفيف */
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.phone-input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #25D366;
}

.wa-inputs input, .wa-inputs textarea {
    padding-right: 40px; /* مكان للأيقونة */
    border-color: rgba(255,255,255,0.1);
}

.wa-inputs input:focus, .wa-inputs textarea:focus {
    border-color: #25D366;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.1);
}

.btn-wa-generate {
    width: 100%;
    padding: 15px;
    background: #25D366; /* أخضر واتساب */
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.3);
}

.btn-wa-generate:hover {
    background: #1ebc57;
    transform: translateY(-3px);
}

/* Preview Side (Phone) */
.wa-preview {
    display: flex;
    justify-content: center;
}

.phone-mockup {
    width: 300px;
    height: 580px;
    background: #000;
    border-radius: 40px;
    border: 8px solid #222;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}

.notch {
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 120px; height: 25px;
    background: #222;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 10;
}

.screen {
    width: 100%; height: 100%;
    background: #0b141a; /* خلفية واتساب الدارك الأصلية */
    display: flex;
    flex-direction: column;
}

/* WhatsApp UI Simulation */
.wa-app-header {
    background: #202c33;
    padding: 35px 15px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #2f3b43;
}

.wa-avatar img { width: 35px; height: 35px; border-radius: 50%; }
.wa-info { display: flex; flex-direction: column; }
.wa-name { color: white; font-size: 0.9rem; font-weight: 600; }
.wa-status { color: #25D366; font-size: 0.7rem; }

.wa-chat-body {
    flex-grow: 1;
    padding: 20px;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-size: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wa-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
}

.received {
    background: #202c33;
    color: white;
    align-self: flex-start;
    border-top-right-radius: 10px;
    border-top-left-radius: 0;
}

.sent {
    background: #005c4b;
    color: white;
    align-self: flex-end;
    border-top-left-radius: 10px;
    border-top-right-radius: 0;
}

.time {
    display: block;
    text-align: left;
    font-size: 0.6rem;
    opacity: 0.6;
    margin-top: 4px;
}

.wa-footer {
    height: 60px;
    background: #202c33;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 15px;
    color: #8696a0;
    font-size: 1.2rem;
}

.wa-input-bar {
    flex-grow: 1;
    height: 35px;
    background: #2a3942;
    border-radius: 20px;
}

/* Mobile */
@media (max-width: 900px) {
    .wa-tool-wrapper { grid-template-columns: 1fr; }
    .wa-preview { order: -1; margin-bottom: 30px; } /* الموبايل يظهر فوق المدخلات */
}

/* ========================
   PREMIUM FOOTER STYLES
   ======================== */
.footer-premium {
    background-color: #020305; /* أسود حالك */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 80px 8% 30px;
    position: relative;
    overflow: hidden;
    margin-top: 0; /* لأن السيكشن اللي قبله غامق */
}

/* التوهج العلوي */
.footer-glow {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    box-shadow: 0 0 30px var(--accent-blue);
    opacity: 0.5;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr; /* تقسيم الأعمدة */
    gap: 40px;
    margin-bottom: 60px;
}

.footer-col h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

/* خط صغير تحت العنوان */
.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: -8px; right: 0;
    width: 40px; height: 2px;
    background: var(--accent-blue);
}

.brand-col p {
    color: var(--text-dim);
    line-height: 1.8;
    margin: 20px 0;
    font-size: 0.95rem;
}

/* السوشيال ميديا */
.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: white;
    transition: 0.3s;
    border: 1px solid transparent;
}

.social-links a:hover {
    background: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
}

/* الروابط */
.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-dim);
    font-size: 0.95rem;
    transition: 0.3s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--accent-blue);
    transform: translateX(-5px); /* حركة خفيفة لليسار */
}

/* النشرة البريدية */
.newsletter-col p { color: var(--text-dim); margin-bottom: 20px; font-size: 0.9rem; }

.newsletter-form {
    display: flex;
    position: relative;
    margin-bottom: 20px;
}

.newsletter-form input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-family: inherit;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.newsletter-form button {
    position: absolute;
    left: 5px; top: 5px; bottom: 5px;
    background: var(--accent-blue);
    border: none;
    width: 40px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.newsletter-form button:hover { background: #3a7bd5; }

.contact-mini {
    color: white;
    font-size: 0.9rem;
    display: flex; align-items: center; gap: 10px;
}

.contact-mini i { color: var(--accent-blue); }

/* الفوتر السفلي */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.legal-links a { color: var(--text-dim); margin: 0 10px; }
.legal-links a:hover { color: white; }
.separator { opacity: 0.3; }

/* زر العودة للأعلى */
#backToTop {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 50px; height: 50px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    opacity: 0; /* مخفي بالبداية */
    visibility: hidden;
    transition: 0.4s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    transform: translateY(-5px);
}

/* ------ Mobile Optimization ------ */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr; /* عمود واحد */
        text-align: center;
        gap: 50px;
    }

    .footer-col h3::after {
        right: 50%;
        transform: translateX(50%); /* توسيط الخط تحت العنوان */
    }

    .social-links {
        justify-content: center;
    }

    .footer-links a:hover {
        transform: none; /* الغاء الحركة في الموبايل */
        color: var(--accent-blue);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .newsletter-form {
        max-width: 400px;
        margin: 0 auto 20px;
    }
    
    .contact-mini {
        justify-content: center;
    }
}

/* زر واتساب العائم - عربي */
.whatsapp-float-ar {
    position: fixed;
    bottom: 30px;
    left: 30px; /* الزر على اليسار في العربي */
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Tooltip - الفقاعة النصية جهة اليمين */
.whatsapp-tooltip-ar {
    position: absolute;
    left: 75px; /* تظهر على يمين الزر */
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    direction: rtl; /* اتجاه النص عربي */
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.whatsapp-float-ar:hover .whatsapp-tooltip-ar {
    opacity: 1;
    visibility: visible;
    left: 80px;
}

.whatsapp-float-ar:hover {
    transform: scale(1.1);
    background-color: #20ba5a;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* الأنميشن - نفس النسخة الإنجليزية */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25d366;
    z-index: -1;
    animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* التوافق مع الموبايل */
@media screen and (max-width: 768px) {
    .whatsapp-float-ar {
        bottom: 20px;
        left: 20px;
        width: 55px;
        height: 55px;
        font-size: 25px;
    }
    .whatsapp-tooltip-ar {
        display: none;
    }
}