/* ==========================================================================
   DROID MAJ - COMPREHENSIVE RESPONSIVE STYLESHEET (responsive.css)
   Preserves 100% of existing aesthetic, colors, themes, & glassmorphism.
   Provides fluid, pixel-perfect responsiveness across all screen sizes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. GLOBAL SAFEGUARDS & BASE FLUID RESETS
   -------------------------------------------------------------------------- */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

img, video, iframe, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Prevent text overflow in narrow viewports */
h1, h2, h3, h4, h5, h6, p, span, a {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* --------------------------------------------------------------------------
   0.1 STRICT DESKTOP & UNIVERSAL CONTAINER BOUNDS
   Ensures all sections (Collections, Updates, Comparisons, Games, FAQs, Tutorials)
   strictly stay inside the 1280px container and never break out to 100vw.
   -------------------------------------------------------------------------- */
.container,
.main-wrapper {
    width: 100%;
    max-width: var(--container, 1280px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.complex-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 340px !important;
    gap: 30px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.main-col {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important; /* يمنع السلايدرات من تفجير عرض العمود في الشاشات العريضة */
    box-sizing: border-box !important;
}

.sidebar-col {
    min-width: 0 !important;
    max-width: 340px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.section-block,
.gaming-zone,
.news-strip-wrapper {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Horizontal sliders safely contained inside their grid columns */
.collections-wrapper,
.games-scroll {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   1. LAPTOPS & DESKTOPS (Max-Width: 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .container {
        padding: 0 20px;
    }

    .complex-layout {
        grid-template-columns: 1fr 300px;
        gap: 25px;
    }

    .hero-grid {
        gap: 15px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 15px;
    }

    .content-grid-lg {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 15px;
    }
}

/* --------------------------------------------------------------------------
   2. TABLETS IN LANDSCAPE & COMPACT LAPTOPS (Max-Width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    /* Navbar & Mobile Header Alignment */
    .navbar {
        margin: 10px 15px;
        padding: 0 15px;
        border-radius: 20px;
    }

    .nav-links {
        display: none !important; /* Move navigation to mobile drawer */
    }

    .mobile-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-main);
        font-size: 1.4rem;
        cursor: pointer;
        padding: 8px;
        border-radius: 10px;
        transition: 0.3s;
    }

    .mobile-toggle:hover {
        background: rgba(var(--primary-rgb, 59, 130, 246), 0.1);
        color: var(--primary);
    }

    /* Keep search and theme buttons visible in header on tablets and mobiles */
    .nav-end {
        display: flex !important;
        gap: 6px;
        align-items: center;
    }

    .nav-end .icon-btn {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Complex Two-Column Layout Transitions to Stack */
    .complex-layout,
    .article-layout {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    .sidebar-col {
        order: 2;
        width: 100%;
    }

    .main-col,
    .content-col {
        order: 1;
        width: 100%;
        min-width: 0;
    }

    /* Hero Section Responsive */
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }

    .main-hero {
        grid-row: auto;
        min-height: 280px;
        height: auto;
    }

    .sub-hero-1,
    .sub-hero-2 {
        height: 200px;
    }

    /* Stats Bar */
    .stats-bar {
        gap: 15px;
        padding: 20px;
    }

    /* Footer Columns */
    .footer-top {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 30px;
    }

    /* Collections & Cards Grid */
    .collections-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
        gap: 20px;
    }

    /* Battle Hero Section in Comparisons Show */
    .battle-hero {
        min-height: auto;
        padding: 20px 0;
    }

    .device-img {
        height: 220px;
    }

    .device-name {
        font-size: 1.4rem;
    }
}

/* --------------------------------------------------------------------------
   3. TABLETS IN PORTRAIT & LARGE MOBILES (Max-Width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Container Spacing */
    .container {
        padding: 0 16px;
    }

    .main-wrapper {
        padding-top: 20px;
        padding-bottom: 40px;
    }

    /* Ambient Background Lights Optimization (reduce size/blur on mobile for performance) */
    .ambient-light {
        width: 300px;
        height: 300px;
        filter: blur(80px);
        opacity: 0.35;
    }

    /* Top Ticker */
    .top-ticker {
        height: auto;
        min-height: 40px;
        margin-bottom: 12px;
    }

    .ticker-label {
        padding: 0 12px;
        font-size: 0.85rem;
    }

    .ticker-item {
        font-size: 0.85rem;
        padding: 8px 15px;
    }

    /* Trending Tags Strip */
    .tags-container-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }

    .tags-cloud {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dynamic-tag {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Stats Bar */
    .stats-bar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        padding: 15px 10px;
        text-align: center;
    }

    .stat-item {
        padding: 5px;
    }

    .stat-num {
        font-size: 1.5rem !important;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Section Headers */
    .section-head {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
    }

    .section-head h2 {
        font-size: 1.25rem;
        gap: 8px;
    }

    .view-all,
    .cyber-btn-link {
        font-size: 0.85rem;
    }

    /* Cards Grids */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .app-card {
        padding: 12px;
        border-radius: 16px;
    }

    .app-card .card-image {
        height: 90px !important;
    }

    .app-card .placeholder-icon {
        width: 55px !important;
        height: 55px !important;
        border-radius: 14px !important;
    }

    .app-card .card-body h3 {
        font-size: 0.95rem;
    }

    .app-card .card-body p {
        display: none; /* Hide snippet on small cards for clean aesthetics */
    }

    .app-card .card-foot {
        margin-top: 10px;
        padding-top: 8px;
    }

    /* Store Page Banner & Toolbar */
    .subcat-hero {
        height: auto;
        padding: 35px 0 25px;
        text-align: center;
    }

    .subcat-hero h1 {
        font-size: 1.5rem;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .subcat-hero .seo-intro-text {
        font-size: 0.95rem;
        margin-top: 10px;
    }

    .featured-item-mini {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 10px;
        max-width: 320px;
        margin: 15px auto 0;
    }

    /* Sticky Toolbar on Store Page */
    .sticky-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px;
        border-radius: 18px;
    }

    .filter-group {
        display: flex;
        width: 100%;
        justify-content: center;
    }

    .filter-group .ft-btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .search-group {
        max-width: 100%;
        width: 100%;
    }

    .search-group input {
        width: 100%;
    }

    .sort-group {
        width: 100%;
    }

    .sort-group select {
        width: 100%;
        padding: 10px 15px;
    }

    /* Store Grid Items */
    .content-grid-lg {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .item-card {
        padding: 14px;
        border-radius: 16px;
    }

    .ic-body {
        gap: 12px;
    }

    .ic-img {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .ic-info h3 {
        font-size: 1rem;
    }

    /* Collections Slider / Grid */
    .collections-wrapper {
        gap: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .c-card {
        min-width: 240px;
        flex: 0 0 240px;
    }

    .collections-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .library-header {
        padding: 40px 15px 30px;
    }

    .library-title {
        font-size: 2rem !important;
    }

    .library-subtitle {
        font-size: 1rem;
    }

    /* Collections Show Editorial Page */
    .collection-hero {
        padding: 35px 15px;
        margin-bottom: 30px;
    }

    .c-icon-wrapper {
        width: 75px;
        height: 75px;
        font-size: 2.4rem;
        border-radius: 20px;
        margin-bottom: 15px;
    }

    .c-hero-title {
        font-size: 1.8rem !important;
    }

    .c-hero-desc {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .article-box {
        padding: 22px 18px !important;
        border-radius: 18px !important;
    }

    .article-box h2 {
        font-size: 1.4rem;
        margin: 30px 0 15px;
    }

    .article-box h3 {
        font-size: 1.2rem;
    }

    .article-box table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Comparisons Index Page */
    .vs-hero {
        padding: 40px 15px;
        margin-bottom: 25px;
    }

    .vs-bg-text {
        font-size: 4rem !important;
        letter-spacing: 5px;
    }

    .vs-hero-content h1 {
        font-size: 1.8rem;
    }

    .vs-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .vs-builder {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }

    .select-box {
        width: 100%;
        min-width: 100%;
    }

    .vs-circle {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .start-vs-btn {
        width: 100%;
        padding: 12px 20px;
    }

    .comp-categories {
        gap: 8px;
        margin-bottom: 30px;
    }

    .c-tab {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .vs-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .deep-dive-section {
        padding: 20px 15px;
    }

    .dd-header h2 {
        font-size: 1.5rem;
    }

    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Single Comparison Show Page (Battle Hero Transformation) */
    .battle-hero {
        grid-template-columns: 1fr !important;
        min-height: auto;
        border-radius: 0 0 20px 20px;
    }

    .fighter-side {
        padding: 25px 15px;
    }

    .fighter-side.left {
        border-left: none;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    }

    .device-img {
        height: 180px;
        margin-bottom: 12px;
    }

    .device-name {
        font-size: 1.3rem;
    }

    .vs-divider {
        margin: -25px 0;
        z-index: 5;
    }

    .vs-badge-hero {
        position: relative;
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
        box-shadow: 0 0 0 6px var(--glass-bg), 0 5px 15px rgba(239, 68, 68, 0.4);
    }

    .intro-section {
        margin: 15px auto 25px;
    }

    .intro-wrapper {
        padding: 20px;
    }

    /* Single App Show Page */
    .article-header {
        padding: 20px 15px;
        border-radius: 18px;
    }

    .article-meta-top {
        flex-wrap: wrap;
        gap: 10px;
    }

    .article-title {
        font-size: 1.4rem !important;
        line-height: 1.4;
    }

    .stats-container {
        gap: 10px;
        flex-wrap: wrap;
    }

    .stat-badge {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .featured-image-wrapper {
        border-radius: 16px;
        overflow: hidden;
        margin-top: 15px;
    }

    .featured-img {
        max-height: 250px;
        object-fit: cover;
        width: 100%;
    }

    .article-body {
        padding: 20px 15px !important;
        font-size: 1rem;
    }

    .article-body h2 {
        font-size: 1.35rem;
        margin: 30px 0 15px;
    }

    .article-body h3 {
        font-size: 1.15rem;
    }

    .visual-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .pros-cons-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .tech-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .tech-table td:first-child {
        width: 40%;
    }

    /* Download Card in App Page */
    .download-card {
        padding: 20px 15px;
        border-radius: 20px;
    }

    .dc-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        margin-bottom: 20px;
    }

    .btn-download {
        max-width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    /* Review Dashboard in App Page */
    .review-dashboard {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 20px 15px;
        text-align: center;
    }

    .rating-summary,
    .rating-bars {
        border-left: none !important;
        padding-left: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 15px;
    }

    .c-form .input-group {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .submit-comment {
        float: none;
        width: 100%;
        padding: 12px;
    }

    .comment-item {
        padding: 15px;
        gap: 12px;
    }

    .comment-item.reply {
        margin-right: 20px;
    }

    /* Affiliate Card */
    .affiliate-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
        gap: 15px;
    }

    .aff-image {
        width: 140px;
        height: auto;
        margin: 0 auto;
    }

    .aff-footer {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .aff-btn {
        width: 100%;
        justify-content: center;
    }

    .promo-timer {
        justify-content: center;
    }

    /* Tutorials & Guides */
    .guides-wrapper {
        gap: 15px;
    }

    .guide-item {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .gi-img {
        width: 100%;
        height: 180px;
    }

    .gi-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .article-main-title {
        font-size: 1.6rem !important;
    }

    .article-header-pro {
        padding: 20px 15px;
    }

    .header-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .meta-divider {
        display: none;
    }

    .post-hero-wrapper {
        height: 220px;
        margin: 0 0 20px;
        border-radius: 16px;
    }

    .app-promo-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .app-main-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .app-specs-mini {
        justify-content: center;
        flex-wrap: wrap;
    }

    .share-footer-pro {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 15px;
    }

    .sf-links {
        justify-content: center;
        width: 100%;
    }

    /* Code Blocks */
    .code-wrapper {
        margin: 20px 0;
        border-radius: 12px;
        overflow: hidden;
    }

    pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 15px;
        font-size: 0.85rem;
    }

    /* Interactive Tools */
    /* 1. Speed Test */
    .fast-pure-container {
        min-height: 50vh;
        padding: 20px 10px;
    }

    .fast-pure-label {
        font-size: 1.2rem;
    }

    .fast-pure-number {
        font-size: clamp(4rem, 16vw, 7rem) !important;
    }

    .fast-pure-unit {
        font-size: clamp(1.4rem, 6vw, 2.2rem) !important;
    }

    /* 2. Link Scanner */
    .scanner-hero {
        padding: 35px 15px;
        margin-bottom: 25px;
    }

    .scanner-title {
        font-size: 1.8rem;
    }

    .scanner-desc {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .scan-input-wrap {
        flex-direction: column;
        gap: 10px;
    }

    .scan-input {
        padding: 14px 20px 14px 45px;
        font-size: 1rem;
    }

    .input-icon {
        top: 25px;
    }

    .scan-btn {
        width: 100%;
        padding: 14px;
        justify-content: center;
        font-size: 1rem;
    }

    .results-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    /* 3. Device Info */
    .device-hero {
        padding: 35px 15px;
        min-height: auto;
    }

    .start-scan-btn {
        padding: 15px 35px;
        font-size: 1rem;
        border-radius: 16px;
    }

    .specs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        margin-top: 30px;
    }

    .spec-card {
        padding: 15px 10px;
    }

    .spec-val {
        font-size: 1.1rem;
    }

    .creative-grid {
        grid-template-columns: 1fr !important;
    }

    /* 4. QR Generator */
    .qr-hero {
        padding: 35px 15px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .input-group {
        flex-direction: column;
        padding: 8px;
    }

    .generate-btn {
        width: 100%;
        justify-content: center;
    }

    .qr-result-card {
        padding: 20px 15px;
        margin: 25px auto 0;
    }

    /* Contact Us Page */
    .contact-hero {
        padding: 35px 15px;
    }

    .contact-form-section {
        padding: 20px 15px !important;
        border-radius: 18px !important;
    }

    .contact-form-section form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .info-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* Search Modal Overlay */
    .search-wrap {
        padding: 20px 15px;
        max-width: 95%;
    }

    .search-header-text h2 {
        font-size: 1.6rem !important;
    }

    .inner-box {
        padding: 8px 15px;
        border-radius: 18px;
    }

    .inner-box input {
        font-size: 1.1rem !important;
        padding: 8px;
    }

    .close-search-modern {
        top: -55px;
        left: 0;
        right: auto;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* Categories Index Page */
    .cat-tabs {
        gap: 8px;
    }

    .cat-tabs .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* Footer Bottom */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding-top: 20px;
    }
}

/* --------------------------------------------------------------------------
   4. SMALL & COMPACT MOBILES (Max-Width: 480px & down to 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .navbar {
        margin: 8px 10px;
        padding: 0 10px;
        height: 60px;
    }

    .nav-inner {
        height: 60px;
    }

    .brand {
        font-size: 1.3rem;
    }

    .brand img {
        height: 32px !important;
    }

    /* Single Column for Cards Grid on tiny screens */
    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .app-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: right;
        gap: 12px;
        padding: 12px;
    }

    .app-card .card-image {
        height: 65px !important;
        width: 65px !important;
        flex-shrink: 0;
        margin: 0;
    }

    .app-card .placeholder-icon {
        width: 60px !important;
        height: 60px !important;
    }

    .app-card .card-body {
        flex-grow: 1;
        padding: 0;
    }

    .app-card .card-foot {
        flex-direction: column;
        gap: 5px;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        align-items: flex-end;
    }

    .app-card .dl-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    /* Stats Bar Single Row / 3 Compact Columns */
    .stat-num {
        font-size: 1.25rem !important;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Device Info Specs Grid */
    .specs-grid {
        grid-template-columns: 1fr !important;
    }

    /* Related Apps Section Grid */
    .related-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .card-image-wrapper {
        width: 70px;
        height: 70px;
    }

    /* Breadcrumb Wrapping */
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 0.8rem;
        gap: 5px;
    }

    /* Footer 1 Column */
    .footer-top {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .ft-col h4 {
        margin-bottom: 15px;
    }

    .ft-col ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* --------------------------------------------------------------------------
   5. ERROR 404 PAGE RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .glitch-text {
        font-size: clamp(4rem, 18vw, 6rem) !important;
    }
    .error-card {
        padding: 30px 15px !important;
    }
    .error-actions {
        flex-direction: column;
        gap: 10px;
    }
    .btn-home, .btn-outline {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   6. SMART TOOLS HUB (الصفحة الرئيسية - أدوات أندرويد الذكية المباشرة)
   ========================================================================== */
.smart-tools-section {
    margin-bottom: 45px;
}

.tools-subtitle-badge {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(var(--primary-rgb, 59, 130, 246), 0.15);
}

.tools-hub-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.tool-hub-card {
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    border-radius: 22px;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: var(--glass-border);
    background: var(--glass-bg);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.tool-hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: 0.3s;
}

.tool-hub-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border-color: rgba(var(--primary-rgb, 59, 130, 246), 0.4);
}

.tool-hub-card:hover::before {
    opacity: 1;
}

.tool-hub-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 16px;
    transition: 0.3s;
}

.tool-hub-card:hover .tool-hub-icon-wrap {
    transform: scale(1.08) rotate(3deg);
}

.qr-accent { background: linear-gradient(135deg, #06b6d4, #0284c7); box-shadow: 0 8px 20px rgba(6, 182, 212, 0.35); }
.shield-accent { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35); }
.speed-accent { background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35); }
.device-accent { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35); }

.tool-hub-info {
    flex-grow: 1;
}

.tool-hub-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.pill-blue { background: rgba(6, 182, 212, 0.12); color: #0284c7; }
.pill-green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.pill-orange { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.pill-purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }

[data-theme="dark"] .pill-blue { color: #38bdf8; }
[data-theme="dark"] .pill-green { color: #34d399; }
[data-theme="dark"] .pill-orange { color: #fb923c; }
[data-theme="dark"] .pill-purple { color: #a78bfa; }

.tool-hub-info h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.tool-hub-info p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.tool-hub-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    transition: 0.3s;
}

.tool-hub-card:hover .tool-hub-foot i {
    transform: translateX(-4px);
}

@media (max-width: 1024px) {
    .tools-hub-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .tools-hub-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .tool-hub-card {
        padding: 18px 16px;
    }
}

/* ==========================================================================
   7. AFFILIATE & CUSTOM PROMO BANNER (بطاقة العروض المؤقتة والأفلييت)
   ========================================================================== */
.affiliate-card {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 24px;
    border-radius: 22px;
    margin: 35px 0;
    position: relative;
    overflow: hidden;
    border: var(--glass-border);
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
}

.aff-image-wrap {
    position: relative;
    width: 220px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.03);
}

.aff-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.4s;
}

.affiliate-card:hover .aff-image {
    transform: scale(1.05);
}

.aff-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.05);
}

.aff-badge-exclusive {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

.aff-content {
    flex: 1;
    min-width: 0;
}

/* Promo Timer */
.promo-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
    border: 1px solid rgba(var(--primary-rgb, 59, 130, 246), 0.2);
    border-radius: 10px;
    padding: 4px 10px;
    min-width: 48px;
}

.timer-unit .num {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-display, inherit);
    color: var(--primary);
    line-height: 1.1;
}

.timer-unit .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

.aff-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.3;
}

.aff-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.aff-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.aff-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--success);
    font-family: var(--font-display, inherit);
}

.old-price {
    font-size: 0.95rem;
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.7;
}

.aff-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark, #2563eb));
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(var(--primary-rgb, 59, 130, 246), 0.35);
    transition: 0.3s;
}

.aff-btn:hover {
    box-shadow: 0 10px 25px rgba(var(--primary-rgb, 59, 130, 246), 0.5);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .affiliate-card {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
        gap: 16px;
        margin: 25px 0;
    }
    .aff-image-wrap {
        width: 100%;
        height: 180px;
    }
    .aff-title {
        font-size: 1.15rem;
    }
    .aff-desc {
        font-size: 0.88rem;
    }
    .aff-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .aff-price {
        justify-content: center;
    }
    .aff-btn {
        justify-content: center;
        width: 100%;
    }
}

/* ==========================================================================
   8. TUTORIALS CATEGORY TOOLBAR RESPONSIVE FIXES
   (إصلاح شريط التنقل والفلاتر في أقسام الشروحات الفرعية)
   ========================================================================== */
@media (max-width: 768px) {
    .cyber-banner {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1.5rem 1rem !important;
        gap: 16px !important;
    }
    .banner-content {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px !important;
    }
    .banner-icon-wrapper {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
        border-radius: 16px !important;
        margin: 0 auto;
    }
    .banner-text h1 {
        font-size: 1.5rem !important;
        text-align: center;
    }
    .banner-stats-hud {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px 15px !important;
    }
    .glass-toolbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        border-radius: 18px !important;
        padding: 12px 14px !important;
        gap: 12px !important;
    }
    .breadcrumb-st {
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        font-size: 0.85rem !important;
        gap: 6px !important;
        justify-content: flex-start !important;
    }
    .breadcrumb-st a {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
    }
    .filter-pills {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding-bottom: 4px !important;
        width: 100% !important;
        scrollbar-width: none !important;
    }
    .filter-pills::-webkit-scrollbar {
        display: none !important;
    }
    .pill {
        flex-shrink: 0 !important;
        font-size: 0.8rem !important;
        padding: 6px 14px !important;
        white-space: nowrap !important;
    }
}

/* ==========================================================================
   9. GLOBAL ARTICLE TYPOGRAPHY & STORE STANDARDS
   (مقالات التطبيقات والشروحات بالمعايير العالمية)
   ========================================================================== */
.article-body,
.content-paragraph,
.analysis-body {
    font-size: 1.02rem;
    line-height: 1.8;
    color: var(--text-main);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-body h1, .content-paragraph h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 900; margin: 1.5rem 0 0.8rem; }
.article-body h2, .content-paragraph h2 { font-size: clamp(1.25rem, 4vw, 1.7rem); font-weight: 800; margin: 1.3rem 0 0.7rem; }
.article-body h3, .content-paragraph h3 { font-size: clamp(1.1rem, 3.5vw, 1.35rem); font-weight: 700; margin: 1rem 0 0.5rem; }

/* Safe scrolling for all code blocks and tables inside articles */
.article-body pre,
.content-paragraph pre,
.analysis-body pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.article-body table,
.content-paragraph table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


