        @import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

        /* ----------------------------------
           متغيرات الألوان للوضع الداكن (الافتراضي)
        ----------------------------------- */
        :root {
            --bg-color: #1e1e22;
            --nav-bg: #25262b;
            --paper-bg: #25262b;
            --border-color: rgba(255, 255, 255, 0.07);
            --shadow-color: rgba(0, 0, 0, 0.28);

            --icon-color: #8a8a90;
            --icon-active-color: #fff;
            --text-label-bg: rgba(255, 255, 255, 0.15);
            --text-label-color: #fff;

            --paper-title: #16729c;
            --paper-text: #8a8a90;
            --indicator-gradient: radial-gradient(circle at 35% 28%, #8a8a90, #4e4e54);
        }

        /* ----------------------------------
           متغيرات الألوان للوضع الفاتح 
        ----------------------------------- */
        .light-mode {
            --bg-color: #f0f3f8;
            --nav-bg: #ffffff;
            --paper-bg: #ffffff;
            --border-color: rgba(0, 0, 0, 0.08);
            --shadow-color: rgba(0, 0, 0, 0.08);

            --icon-color: #90949c;
            --icon-active-color: #16729c;
            --text-label-bg: rgba(22, 114, 156, 0.15);
            --text-label-color: #16729c;

            --paper-title: #16729c;
            --paper-text: #55555e;
            --indicator-gradient: radial-gradient(circle at 35% 28%, #e4e7ec, #ffffff);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Cairo', sans-serif;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: var(--bg-color);
            padding: 20px;
            /* تأثير الانتقال الناعم عند تغيير الوضع */
            transition: background 0.4s ease;
        }

        .wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 25px;
            width: 100%;
            max-width: 400px;
        }

        .nav {
            position: relative;
            width: 100%;
            height: 70px;
            background: var(--nav-bg);
            border: 1px solid var(--border-color);
            box-shadow: 0 18px 42px var(--shadow-color);
            border-radius: 15px;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10;
            transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
        }

        .nav ul {
            display: flex;
            width: 100%;
            padding: 0 10px;
            position: relative;
            list-style: none;
        }

        .nav ul li {
            position: relative;
            flex: 1;
            height: 70px;
            z-index: 1;
        }

        .nav ul li a {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            width: 100%;
            height: 100%;
            text-decoration: none;
            text-align: center;
        }

        .nav ul li a .icon {
            position: relative;
            width: 63px;
            height: 63px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 1.8em;
            color: var(--icon-color);
            transition: 0.6s cubic-bezier(.34, 1.45, .64, 1), color 0.4s ease;
        }

        .nav ul li.active a .icon {
            transform: translateY(-31px);
            color: var(--icon-active-color);
        }

        /* تأثير الصعود لزر الثيم عند الضغط عليه (مؤقت ليظهر تفاعل) */
        .nav ul li.theme-btn:active a .icon {
            transform: scale(0.9);
        }

        .nav ul li a .text {
            position: absolute;
            color: var(--text-label-color);
            font-weight: 600;
            font-size: 0.7em;
            letter-spacing: 0.05em;
            transition: 0.5s;
            opacity: 0;
            transform: translateY(20px);
            background: var(--text-label-bg);
            padding: 4px 10px;
            border-radius: 12px;
            white-space: nowrap; /* يمنع نزول الكلمة لسطر جديد إذا كانت طويلة، أو أزلها لو تبيه ينزل بسطر مرتب */
            margin-top: 12px;    /* يعطي مسافة راحة بين السطرين */
        }

        .nav ul li.active a .text {
            opacity: 1;
            transform: translateY(12px);
        }

        .indicator {
            position: absolute;
            top: -28px;
            width: 63px;
            height: 63px;
            border-radius: 50%;
            border: 5px solid #16729c;
            background: var(--indicator-gradient);
            box-shadow:
                0 0 12px rgba(22, 114, 156, .2),
                inset 0 3px 5px rgba(255, 255, 255, .28);
            transition: left .6s cubic-bezier(.34, 1.45, .64, 1), background 0.4s ease;
        }

        .paper-container {
            position: relative;
            width: 95%;
            perspective: 1200px;
        }

        .paper {
            width: 100%;
            height: auto;
            min-height: 120px;
            background: var(--paper-bg);
            border: 1px solid var(--border-color);
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 18px 42px var(--shadow-color);

            transform-origin: top;
            transform: rotateX(-90deg);
            opacity: 0;
            visibility: hidden;

            transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.4s,
                visibility 0.6s, background 0.4s ease, border-color 0.4s ease;

            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            gap: 10px;
        }

        .paper.active-paper {
            transform: rotateX(0deg);
            opacity: 1;
            visibility: visible;
        }

        .paper h2 {
            color: var(--paper-title);
            font-size: 1.5em;
        }

        .paper p {
            color: var(--paper-text);
            font-size: 1.1em;
            line-height: 1.6;
            transition: color 0.4s ease;
        }

        /* تنسيقات صفحة الملف الشخصي */
        .profile-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            gap: 15px;
            margin-top: 5px;
        }

        /* إطار الصورة الدائري */
        .avatar-frame {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            border: 3px solid #16729c;
            overflow: hidden;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            display: flex;
            justify-content: center;
            align-items: center;
            background: var(--bg-color);
        }

        .avatar-frame img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-info {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 0 10px;

        }

        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9em;
            width: 100%;
            direction: rtl;
            /* فرض الاتجاه العربي الصحيح */
        }

        .info-row .label {
            color: var(--paper-title);
            font-weight: 600;
            text-align: right;
        }

        /* إضافة النقطتين برمجياً لضمان عدم انعكاسها */
        .info-row .label::after {
            content: " :";
        }

        .info-row .value {
            color: var(--paper-text);
            text-align: right;
            flex: 1;
            margin-right: 7px;
        }

        .divider {
            width: 100%;
            height: 1px;
            background-color: var(--border-color);
            margin: 2px 0;
        }

        .img-avatar {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .avatar-placeholder {
            font-size: 32pt;
                        color: var(--icon-color);

        }

/* حاوية النبذة مع النبض اللطيف */
    .typing-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 80px;
        text-align: center;
        animation: softPulse 2.5s ease-in-out infinite;
    }

    .typing-text {
        font-size: 1.3em;
        color: var(--paper-title);
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        animation: fadeInScale 0.6s ease-in-out;
    }

    /* تأثير الكتابة الحقيقي للنص العربي */
    .text-content {
        display: inline-block;
        overflow: hidden;
        white-space: nowrap;
        border-left: 2px solid var(--paper-title);
        animation: typingEffect 4s steps(22, end) infinite, blinkCursor 0.75s step-end infinite;
        padding-left: 3px;
    }

    @keyframes typingEffect {
        0% { width: 0; }
        40% { width: 100%; } /* تنكتب بالكامل */
        70% { width: 100%; } /* تثبت قليلاً */
        95%, 100% { width: 0; } /* تمسح وتنتهي */
    }

    @keyframes blinkCursor {
        from, to { border-color: transparent; }
        50% { border-color: var(--paper-title); }
    }

    /* حركة الوجه المبتسم (تطفو بخفة) */
    .moving-emoji {
        display: inline-block;
        animation: floatEmoji 3s ease-in-out infinite;
    }

    @keyframes floatEmoji {
        0%, 100% {
            transform: translateY(0) rotate(0deg);
        }
        50% {
            transform: translateY(-8px) rotate(-5deg);
        }
    }

    /* حركة النقاط المتتالية */
    .dot {
        opacity: 0;
        animation: blinkDot 1.4s infinite;
        color: var(--paper-text);
    }

    .dot1 { animation-delay: 0.2s; }
    .dot2 { animation-delay: 0.4s; }
    .dot3 { animation-delay: 0.6s; }

    @keyframes fadeInScale {
        0% {
            opacity: 0;
            transform: translateY(10px) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    @keyframes softPulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.03); }
    }

    @keyframes blinkDot {
        0% { opacity: 0; }
        50% { opacity: 1; }
        100% { opacity: 0; }
    }
