/* Base Layout, Containers & Typography */
        /* Custom Dark Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: #0d0b0a;
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(139, 92, 246, 0.4);
            border-radius: 8px;
            border: 1px solid rgba(13, 11, 10, 0.8);
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(139, 92, 246, 0.75);
        }
        * {
            scrollbar-width: thin;
            scrollbar-color: rgba(139, 92, 246, 0.4) #0d0b0a;
        }

        /* Main Page Wrapper */
        .main-wrapper {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 32px 16px 48px;
            position: relative;
            z-index: 10;
        }
        body.is-native-app .main-wrapper {
            padding: 0;
        }

        /* Screen Container */
        .app-container {
            width: 100%;
            max-width: 450px;
            position: relative;
            z-index: 10;
            margin: 0 auto;
        }
        .app-container:has(.places-dropdown.show),
        .app-container.has-dropdown-open {
            z-index: 2000;
        }
        @media (min-width: 768px) {
            .app-container {
                max-width: 660px;
            }
        }
        body.is-native-app .app-container {
            max-width: 450px !important;
        }

        /* Top Bar with Language Switcher & APK Download (Mobile/Native) */
        .top-bar {
            display: none;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 14px;
            width: 100%;
            direction: ltr !important;
        }
        body.is-native-app .top-bar {
            display: flex;
        }


        /* Language Toggle Pill */
        .lang-pill-container {
            position: relative;
            display: inline-flex;
            align-items: center;
            background: rgba(28, 25, 23, 0.92);
            border: 1px solid var(--border);
            border-radius: 50px;
            padding: 3px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            direction: ltr !important;
            unicode-bidi: isolate;
        }
        .lang-btn {
            position: relative;
            z-index: 2;
            background: transparent;
            border: none;
            color: var(--text-sub);
            font-family: 'Inter', 'Cairo', sans-serif;
            font-size: 11px;
            font-weight: 700;
            width: 48px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50px;
            cursor: pointer;
            transition: color 0.22s ease, transform 0.12s ease;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }
        .lang-btn:active {
            transform: scale(0.92);
        }
        .lang-btn.active {
            color: #ffffff;
            font-weight: 800;
        }
        .lang-slider {
            position: absolute;
            top: 3px;
            left: 3px;
            width: 48px;
            height: 26px;
            background: var(--primary-gradient);
            border-radius: 50px;
            box-shadow: 0 2px 10px rgba(124, 58, 237, 0.45);
            transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
            z-index: 1;
            pointer-events: none;
        }


        /* Header */
        header {
            text-align: center;
            margin-top: 4px;
            margin-bottom: 22px;
        }
        .app-icon {
            width: 56px;
            height: 56px;
            margin: 0 auto 12px;
            border-radius: 18px;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 24px -4px rgba(124, 58, 237, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.15);
        }
        .app-icon svg {
            width: 32px;
            height: 32px;
        }
        header h1 {
            font-size: 22px;
            font-weight: 900;
            letter-spacing: -0.3px;
            color: #ffffff;
            margin-bottom: 4px;
        }
        header p {
            font-size: 13px;
            color: var(--text-sub);
            font-weight: 600;
        }

        /* Glass Cards */
        .glass-card {
            position: relative;
            z-index: 20;
            background: var(--card);
            backdrop-filter: blur(24px) saturate(180%);
            -webkit-backdrop-filter: blur(24px) saturate(180%);
            border: 1px solid var(--border);
            border-radius: var(--radius-app);
            padding: 20px 16px;
            box-shadow: var(--shadow-glass);
            margin-bottom: 16px;
        }
        body.is-native-app .glass-card {
            background: linear-gradient(180deg, rgba(31, 28, 26, 0.96) 0%, rgba(22, 19, 18, 0.97) 100%);
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }

        .main-input-card {
            z-index: 50;
        }
        .main-input-card:has(.places-dropdown.show),
        .main-input-card.has-dropdown-open {
            z-index: 2000;
        }


        /* App Version & Update Pill in Top Bar */
        .btn-version-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 12px;
            background: rgba(28, 25, 23, 0.9);
            border: 1px solid var(--border);
            border-radius: 50px;
            color: var(--text-muted);
            font-family: 'Inter', 'Cairo', sans-serif;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
            user-select: none;
        }
        @media (hover: hover) and (pointer: fine) {
            .btn-version-pill:hover {
                background: rgba(139, 92, 246, 0.12);
                border-color: rgba(139, 92, 246, 0.4);
                color: #c4b5fd;
                transform: translateY(-1px);
            }
        }
        .btn-version-pill:active {
            transform: scale3d(0.95, 0.95, 1);
        }
        .btn-version-pill.has-update {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.22) 0%, rgba(16, 185, 129, 0.35) 100%);
            border: 1.5px solid #22c55e;
            color: #ffffff;
            font-weight: 800;
            box-shadow: 0 0 16px rgba(34, 197, 94, 0.45), 0 2px 8px rgba(0, 0, 0, 0.4);
            animation: badge-attention-glow 2.4s ease-in-out infinite;
        }
        .btn-version-pill.has-update::after {
            content: 'New';
            font-size: 9.5px;
            font-weight: 800;
            background: #22c55e;
            color: #0c0a09;
            padding: 1px 6px;
            border-radius: 20px;
            margin-left: 4px;
            letter-spacing: 0.2px;
            display: inline-block;
        }
        [dir="rtl"] .btn-version-pill.has-update::after,
        html[lang="ar"] .btn-version-pill.has-update::after {
            content: 'تحديث';
            margin-left: 0;
            margin-right: 4px;
        }
        .version-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #78716c;
            display: inline-block;
            transition: background 0.3s;
        }
        .btn-version-pill.has-update .version-dot {
            background: #4ade80;
            box-shadow: 0 0 10px #4ade80;
            animation: ping-radar 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
        }
        @keyframes ping-radar {
            0% {
                transform: scale(0.9);
                box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.8);
            }
            70% {
                transform: scale(1.25);
                box-shadow: 0 0 0 7px rgba(74, 222, 128, 0);
            }
            100% {
                transform: scale(0.9);
                box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
            }
        }
        @keyframes badge-attention-glow {
            0%, 100% {
                box-shadow: 0 0 12px rgba(34, 197, 94, 0.35), inset 0 0 6px rgba(34, 197, 94, 0.2);
                border-color: rgba(34, 197, 94, 0.6);
            }
            50% {
                box-shadow: 0 0 22px rgba(34, 197, 94, 0.75), inset 0 0 10px rgba(34, 197, 94, 0.4);
                border-color: #4ade80;
            }
        }

        /* Brand Badge (Navbar) clickable */
        .brand-badge {
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .brand-badge:hover {
            transform: scale(1.05);
            background: rgba(139, 92, 246, 0.25);
            border-color: rgba(139, 92, 246, 0.5);
            color: #c4b5fd;
        }
        .brand-badge.has-update {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.22) 0%, rgba(16, 185, 129, 0.35) 100%);
            border: 1.5px solid #22c55e;
            color: #ffffff;
            font-weight: 800;
            box-shadow: 0 0 16px rgba(34, 197, 94, 0.45);
            animation: badge-attention-glow 2.4s ease-in-out infinite;
        }
        .brand-badge.has-update::after {
            content: 'New';
            font-size: 9px;
            font-weight: 800;
            background: #22c55e;
            color: #0c0a09;
            padding: 1px 5px;
            border-radius: 20px;
            margin-left: 4px;
        }
        [dir="rtl"] .brand-badge.has-update::after,
        html[lang="ar"] .brand-badge.has-update::after {
            content: 'تحديث';
            margin-left: 0;
            margin-right: 4px;
        }


        /* Responsive adjustments for compact screens */
        @media (max-width: 380px) {
            body {
                padding: 12px 10px 92px;
            }
            body.is-native-app {
                padding: 12px 12px 20px;
            }
            .glass-card {
                padding: 16px 12px;
            }
            .mode-tab {
                padding: 6px 10px;
                font-size: 11.5px;
                gap: 5px;
            }
            .mode-tab svg {
                width: 14px;
                height: 14px;
            }
            .input-row {
                gap: 5px;
            }
            .btn-trash {
                width: 38px;
                min-width: 38px;
            }
            .btn-paste {
                padding: 0 8px;
                font-size: 11px;
            }
            .url-input {
                padding: 0 8px;
            }
            .url-input::placeholder {
                font-size: 10.5px;
            }
            .search-input::placeholder {
                font-size: 11px;
            }
        }
