/* الوضع النهاري (افتراضي) */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: radial-gradient(circle at center, #d0d0e7, #bfa2f8);
    color: #000000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    color: white;
}

header {
  
    background-color: #B895FF; /* بنفسجي غامق */
 
    padding: 15px;
    text-align: right;
    display: flex;
    justify-content: space-between; /* لضبط العناصر في الترويسة */
   /* justify-content: center;*/
    z-index: 0; /* يجعل الهيدر والفوتر فوق الخلفية */
}

header img {
    
    width: 400px; /* عرض الصورة */
    height: auto; /* ارتفاع الصورة */
    border-radius: 25px; /* تدوير الحواف */
    justify-content: center;
}
.background {
    position: absolute;
  
            left: 0;
    width: 100%;
    overflow: hidden;
    z-index: -1; /* يجعل الخلفية في الخلف */
}

.line {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, #2c0477, transparent);
    opacity: 0.8;
    animation: moveLine 5s linear infinite;
   
}

.dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #97089c;
    border-radius: 50%;
    animation: blink 2s infinite alternate;
}

@keyframes moveLine {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes blink {
    0% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.4;
    }
}
/* النص فوق الخلفية */



.container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
 min-height: 420px;
    /*grid-template-columns: repeat(4, 1fr);*/
    gap: 20px;
    padding: 20px;
    z-index: 1; /* يجعل العناصر أمام الخلفية */
}

.card {
   
    background-color: rgb(255, 255, 255);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
 
    width: 35%;
    direction: rtl; /* لضمان النص على اليمين */
    transition: transform 0.3s, background-color 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.card img {
    width: 80px; /* عرض الصورة */
    height: 80px; /* ارتفاع الصورة */
   /* width: 100%;
    height: 100px;*/
    border-radius: 8px;
    object-fit: cover;

    margin-left: 15px; /* إزالة أي مسافة إضافية على اليسار */
}

.card h3 {
    margin: 0px ;
    font-size: 18px;
    color: #97089c;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  
}


.card a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row; /* يجعل النصوص على اليمين والصورة على اليسار */
    text-decoration: none;
    direction: rtl; /* لضمان النص على اليمين */
}

footer {
   
    background-color: #B895FF;
    color: white;
    padding: 20px;
    text-align: center;
    display: grid;
    margin-top: auto; /* يجعل الذيل دائمًا في الأسفل */
  width: 100%;
    box-sizing: border-box; /* لضمان أن الحشو لا يتسبب في زيادة الحجم الكلي */
    z-index: 0; /* يجعل الهيدر والفوتر فوق الخلفية */
    position: relative;
}

footer p, footer a {
    font-size: 14px;
    margin: 10px 0;
    color: white;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* الوضع الليلي */
body.dark-mode {
    background: radial-gradient(circle at center, #000000, #000000);
    color: #f5f5f5; /* لون النص */
}

header.dark-mode, footer.dark-mode {
    background-color: #333; /* لون داكن للرأس والذيل */
    color: #fff;
}

.card h3.dark-mode{
    color: #9f58cc;
}
.card.dark-mode {
    background-color: #2a2a2a; /* لون داكن للكروت */
    color: #ddd;
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1); /* تأثير خفيف */
}
.toggle-cont {
    position: absolute;
    --primary: #B895FF;
    --light: #d9d9d9;
    --dark: #6d6d6d;
    --gray: #d9d9d9;
  
    position: relative;
    z-index: 10;
  
    width: fit-content;
    height: 18px; /* تم تصغير الارتفاع هنا */
    top: 3px;
    
    right: 10px; /* المسافة من الحافة اليسرى */
    border-radius: 999px;
}

.toggle-cont .toggle-input {
    display: none;
}

.toggle-cont .toggle-label {
    --gap: 1px;
    --width: 18px; /* تم تصغير العرض هنا */
  
    cursor: pointer;
  
    position: relative;
    display: inline-block;
  
    padding: 0.5rem;
    width: calc((var(--width) + var(--gap)) * 2);
    height: 18px; /* تم تصغير الارتفاع هنا */
    background-color: var(--dark);
  
    border: 1px solid #777777;
    border-bottom: 0;
  
    border-radius: 9999px;
    box-sizing: content-box;
    transition: all 0.3s ease-in-out;
}

.toggle-label::before {
    content: "";
  
    position: absolute;
    z-index: -10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  
    width: calc(100% + 1rem);
    height: calc(100% + 1rem);
    background-color: var(--gray);
  
    border: 1px solid #777777;
    border-bottom: 0;
    border-radius: 9999px;
  
    transition: all 0.3s ease-in-out;
}

.toggle-label::after {
    content: "";
  
    position: absolute;
    z-index: -10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  
    width: 100%;
    height: 100%;
    background-image: radial-gradient(
      circle at 50% -90%,
      rgb(99, 5, 207) 0%,
      rgb(44, 44, 44) 90%
    );
  
    border-radius: 9999px;
}

.toggle-cont .toggle-label .cont-icon {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  
    width: var(--width);
    height: 18px; /* تم تصغير الارتفاع هنا */
    background-image: radial-gradient(
      circle at 50% 0%,
      #666666 0%,
      var(--gray) 100%
    );
  
    border: 1px solid #aaaaaa;
    border-bottom: 0;
    border-radius: 9999px;
    box-shadow: inset 0 -0.15rem 0.15rem var(--primary),
      inset 0 0 0.5rem 0.75rem var(--second);
  
    transition: transform 0.3s ease-in-out;
}

.cont-icon {
    overflow: clip;
    position: relative;
    /* حفظ العرض والارتفاع الخاصين بالدائرة المتحركة */
    width: 25px;  /* القيمة الثابتة هنا */
    height: 25px; /* الدائرة المتحركة الحجم ثابت */
}

.cont-icon .sparkle {
    position: absolute;
    top: 50%;
    left: 50%;
  
    display: block;
  
    width: calc(var(--width) * 1px); /* إبقاء الدائرة المتحركة كما هي */
    aspect-ratio: 1;
    background-color: var(--light);
  
    border-radius: 50%;
    transform-origin: 50% 50%;
    rotate: calc(1deg * var(--deg));
    transform: translate(-50%, -50%);
    animation: sparkle calc(100s / var(--duration)) linear
      calc(0s / var(--duration)) infinite;
}

@keyframes sparkle {
    to {
        width: calc(var(--width) * 0.5px);
        transform: translate(2000%, -50%);
    }
}

.cont-icon .icon {
    width: 0.5rem;
    fill: var(--light);
}

/* التفاعل عند تغيير الحالة */
.toggle-cont:has(.toggle-input:checked) {
    --checked: true;
}

/* تغيير الاتجاه من اليمين لليسار */
@container style(--checked: true) {
    .toggle-cont .toggle-label {
        background-color: #41434400;
  
        border: 1px solid #3d6970;
        border-bottom: 0;
    }
  
    .toggle-cont .toggle-label::before {
        box-shadow: 0 1rem 2.5rem -2rem #B895FF;
    }
  
    .toggle-cont .toggle-label .cont-icon {
        overflow: visible;
  
        background-image: radial-gradient(
          circle at 50% 0%,
          #B895FF 0%,
          var(--primary) 100%
        );
  
        border: 1px solid var(--primary);
        border-bottom: 0;
  
        /* التعديل هنا ليصبح الانتقال من اليمين إلى اليسار */
        transform: translateX(-100%) rotate(225deg); /* عكس الاتجاه */
    }
  
    .toggle-cont .toggle-label .cont-icon .sparkle {
        z-index: -10;
  
        width: calc(var(--width) * 2px);
        background-color: #d2c3f1;
  
        animation: sparkle calc(100s / var(--duration)) linear
          calc(10s / var(--duration)) infinite;
    }
}

/* تفعيل التأثير على الحركة */
@keyframes sparkle {
    to {
        width: calc(var(--width) * 1px);
        transform: translate(5000%, -50%);
    }
}
@media (max-width: 768px) {
    header {
      
        padding: 15px ;
    }
    header img {
    
        max-width: 50%;   /* تغيير إلى 100% لجعل الصورة تأخذ العرض الكامل */
        height: auto; /* ارتفاع الصورة */ }
        .background {
            top: 35px;    
        }
        .line {
           
            animation: moveLine 8s linear infinite;
           
        }
    .container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* تغيير عدد الأعمدة تلقائيًا */
        gap: 15px;
        min-height: 520px;
    }
    .card {
        width: 80%;
    }
    .card img {
        max-width: 50px;   /* تغيير إلى 100% لجعل الصورة تأخذ العرض الكامل */
        height: 50px;     /* الحفاظ على نسب الصورة */
    }

    .card h3 {
        font-size: 0.8em;
    }

    .card p {
        font-size: 0.8em;
    }


.toggle-cont {
   
    width: fit-content;
    height: 9px; /* تصغير الارتفاع للنصف */
    top: 0px;
    
    left: 30px; /* المسافة من الحافة اليسرى */
  
}

.toggle-cont .toggle-label {
    --gap: 1px; /* تصغير الفجوة */
    --width: 9px; /* تصغير العرض للنصف */
    padding: 0.2rem; /* تقليل الحواف */
    width: calc((var(--width) + var(--gap)) * 2);
    height: 9px; /* تصغير الارتفاع للنصف */
}
.toggle-cont .toggle-label .cont-icon {  
    height: 9px; /* تصغير الارتفاع للنصف */  
}
.cont-icon { 
    /* حفظ العرض والارتفاع الخاصين بالدائرة المتحركة */
    width: 12.5px;  /* تصغير الحجم للنصف */
    height: 12.5px; 
}
.cont-icon .sparkle {  
    width: calc(var(--width) * 0.5px); /* تعديل الحجم */
    
}

.cont-icon .icon {
    width: 0.3rem; /* تقليل حجم الأيقونة */
  
}

footer p, footer a {
    font-size: 8px;
   
}
/* تفعيل التأثير على الحركة */
@keyframes sparkle {
    to {
        width: calc(var(--width) * 0.8px);
        transform: translate(1700%, -50%);
    }
}
}
@media (max-width: 480px) {
    .card h3 {
        font-size: 1em;
    }

    .card p {
        font-size: 0.8em;
    }
    footer {
        width: 100%;
        font-size: 0.2em;
        padding: 10px;
    }
    
}

