:root {
    --bg-color: #030014;
    --card-bg: rgba(10, 7, 34, 0.75);
    --border-glow: rgba(255, 255, 255, 0.08);
}

/* تصحيح عام لجميع العناصر */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: #ffffff;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at top, rgba(88, 28, 135, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 90% 20%, rgba(219, 39, 119, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
}

.map-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    padding: 10px;
    display: flex;
    justify-content: center;
}

#map {
    width: 98%;
    height: 100%;
    border-radius: 22px;
    overflow: hidden;
    border: 6px solid #3b0069;
    box-shadow: 0 0 40px rgba(140, 0, 255, .35);
}

/* تنسيق العنوان الفضائي الاحترافي المتوهج */
.space-title-1 {
    text-align: center;
font-family: sans-serif;
    font-size: 3rem;
    font-weight: bold;
    color: #e0f7fa;
    letter-spacing: 4px;
}

/* زر الهوم */
#homeBtn {
    position: absolute;
    top: 20px;
    right: 35px;
    z-index: 1000;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: #5b84e7;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    transition: .3s;
}

#homeBtn:hover {
    transform: translateY(-3px);
    background: #6d93ee;
}

/* لون الخريطة */
.leaflet-container {
    background: #ececec;
}

.leaflet-control-attribution {
    display: none;
}

.leaflet-control-zoom a {
    background: #5b84e7 !important;
    color: white !important;
    border: none !important;
    width: 34px;
    height: 34px;
    line-height: 34px;
    font-size: 18px;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
    border-radius: 12px;
    overflow: hidden;
}

/* النقاط البنفسجي */
.custom-marker {
    width: 18px;
    height: 18px;
    background: #5f00d0;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow:
        0 0 0 10px rgba(95, 0, 208, .18),
        0 0 25px rgba(95, 0, 208, .55);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(95, 0, 208, .35),
            0 0 20px rgba(95, 0, 208, .45);
    }
    70% {
        transform: scale(1.15);
        box-shadow:
            0 0 0 18px rgba(95, 0, 208, 0),
            0 0 30px rgba(95, 0, 208, .25);
    }
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(95, 0, 208, 0),
            0 0 20px rgba(95, 0, 208, .45);
    }
}

/* صندوق المعلومات */
.leaflet-popup-content-wrapper {
    border-radius: 16px;
    padding: 8px;
}

.leaflet-popup-content {
    text-align: center;
    font-family: 'Cairo', sans-serif;
    min-width: 150px;
}

.leaflet-popup-content h3 {
    color: #5f00d0;
    margin-bottom: 6px;
}

.leaflet-popup-content p {
    color: #444;
    font-size: 14px;
}

.mouse-light {
    position: fixed;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(140, 70, 255, .35), transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: .05s;
}

/* === الهيدر العلوي === */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 30px;
    background: rgba(9, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    width: 100%;
    height: 50px; /* تقليل الارتفاع أكثر ليتطابق مع حجم اللوجو المضبوط */
    box-sizing: border-box;
    z-index: 1000;
}

/* تنسيق اللوجو وإزالة الهوامش الزائدة */
.logo {
    font-size: 18px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin-top: 10px; /* تعديل النزول ليكون في المنتصف تماماً */
    line-height: 1;
}

.logo img {
    max-height: 35px; /* تصغير ارتفاع الصورة قليلاً لتناسب الهيدر الصغير */
    width: auto;
    object-fit: contain;
}

.logo span { 
    color: #ec4899; 
}

/* القائمة في المنتصف تماماً بالشاشات الكبيرة */
.nav-menu {
    display: flex;
    gap: 30px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    order: 1;
    align-items: center;
    margin: 0;
}

.nav-item {
    color: white;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
    white-space: nowrap;
}

.nav-item:hover, .nav-item.active {
    color: #f472b6;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #f472b6;
    transition: 0.3s;
}

.nav-item:hover::after, .nav-item.active::after {
    width: 100%;
}

.theme-icon {
    background: #120d36;
    border: 1px solid #312e81;
    color: #fbbf24;
    font-size: 14px;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    order: 3;
    transition: 0.3s;
}

.theme-icon:hover {
    transform: scale(1.05);
    border-color: #fbbf24;
}

/* === القسم الرئيسي (Hero) === */
.hero-section {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px 20px 20px 20px;
    position: relative;
    gap: 8px;
}

.welcome-text {
    color: #ec4899;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 0px;
}

.main-title {
    font-size: 60px;
    font-weight: 900;
    margin-bottom: 0px;
    background: linear-gradient(135deg, #ffffff, #e0f7fa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(236, 72, 153, 0.3);
}

.main-title span {
    color: #ec4899;
    -webkit-text-fill-color: #ec4899;
}

.description {
    color: #94a3b8;
    font-size: 16px;
    margin-bottom: 0px;
    max-width: 600px;
}

/* === حقل الإدخال وزر الرحلة === */
.input-group {
    background: rgba(15, 12, 42, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 6px;
    border-radius: 30px;
    display: flex;
    width: 100%;
    max-width: 460px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.name-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 0 20px;
    text-align: right;
    font-size: 15px;
}

.cta-button {
    background: linear-gradient(to left, #e879f9, #a855f7);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cta-button:hover {
    opacity: 0.9;
}

.user-greeting {
    color: #fbbf24;
    font-weight: 600;
    font-size: 15px;
    min-height: 22px;
}

/* === تصميم السهم الثلاثي الأبعاد === */
.space-arrow-container {
    position: relative !important;
    margin: 15px auto 10px auto !important;
    width: 35px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    animation: floatArrow 2s infinite ease-in-out;
}

.space-arrow-3d {
    width: 30px;
    height: 42px;
    background: linear-gradient(135deg, #a855f7, #3b82f6, #f97316);
    clip-path: polygon(40% 0%, 60% 0%, 60% 50%, 90% 50%, 50% 100%, 10% 50%, 40% 50%);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.4);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.space-arrow-container:hover .space-arrow-3d {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 10px rgba(168, 85, 247, 0.8));
}

@keyframes floatArrow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(4px);
    }
}

/* === شبكة الكروت الكونية === */
.worlds-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 6% 80px 6%;
}

.world-card {
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 360px;
    transition: transform 0.3s, filter 0.3s;
}

.world-card:hover {
    transform: translateY(-5px);
}

.card-image {
    height: 50%; 
    width: 100%;
    object-fit: cover;
}

.card-info {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.card-info h2 { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.card-info p { color: #94a3b8; font-size: 13px; line-height: 1.6; }

.enter-btn {
    border: none;
    padding: 8px 0;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    display: inline-block;
    text-decoration: none;
    transition: background-color 0.2s;
}

.card-purple .enter-btn { background: #2e1065; border: 1px solid #a855f7; }
.card-blackhole .enter-btn { background: #1e1b4b; border: 1px solid #4f46e5; }
.card-sun .enter-btn { background: #451a03; border: 1px solid #f59e0b; }
.card-galaxy .enter-btn { background: #3b0764; border: 1px solid #d946ef; }
.card-moon .enter-btn { background: #1f2937; border: 1px solid #6b7280; }
.card-planets .enter-btn { background: #172554; border: 1px solid #3b82f6; }
.card-comets .enter-btn { background: #042f2e; border: 1px solid #14b8a6; }
.card-nebula .enter-btn { background: #065f46; border: 1px solid #10b981; }

/* === الفوتر === */
.main-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 60px 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-tag { color: #ec4899; font-size: 13px; font-weight: 700; }
.footer-title { font-size: 28px; font-weight: 900; margin: 8px 0; }
.footer-desc { color: #64748b; font-size: 14px; max-width: 480px; }

.stats-container { display: flex; gap: 50px; }
.stat-box { text-align: center; display: flex; flex-direction: column; align-items: center;}
.stat-icon { font-size: 22px; margin-bottom: 5px; }
.stat-number { font-size: 32px; font-weight: 900; }
.stat-label { color: #475569; font-size: 13px; }

.text-yellow { color: #fbbf24; }
.text-pink { color: #ec4899; }
.text-purple { color: #a855f7; }

.bottom-bar {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #334155;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #0f0c2d;
    border: 1px solid #1e1b4b;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    margin-right:50px;
}

/* === تحسينات التجاوب والـ Media Queries === */
@media (max-width: 1024px) {
    .worlds-grid { grid-template-columns: repeat(2, 1fr); }
    .main-footer { flex-direction: column; text-align: center; gap: 40px; }
}

@media (max-width: 900px) {
    .main-header {
        height: auto;
        padding: 8px 15px;
        flex-direction: column;
        gap: 5px;
    }

    .logo {
        font-size: 16px;
        margin-top: 0;
        order: 1;
    }

    .nav-menu {
        position: relative;
        left: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
        overflow-x: auto;
        padding: 4px 5px;
        gap: 12px;
        order: 2;
        background: rgba(25, 20, 50, 0.6);
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 1000;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        font-size: 12px;
        white-space: nowrap;
    }

    .theme-icon {
        order: 3;
        padding: 4px;
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .worlds-grid { grid-template-columns: 1fr; }
    .main-title { font-size: 36px; }
}
/* === الهيدر العلوي === */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 30px;
    background: rgba(9, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    width: 100%;
    height: 70px; /* زيادة طفيفة في ارتفاع الهيدر لإعطاء مساحة أوسع للوجو */
    box-sizing: border-box;
    z-index: 1000;
}

/* تنسيق اللوجو ونزوله للأسفل */
.logo {
    font-size: 18px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin-top:100px; /* زيادة مسافة النزول للأسفل لتتوسط الهيدر تماماً */
    line-height: 1;
}

.logo img {
    max-height: 45px; /* ضبط حجم الصورة لتتلاءم مع النزول الجديد */
    width: auto;
    object-fit: contain;
}
