/* --- إعدادات عامة وخطوط --- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #111827; /* bg-gray-900 */
    color: #e5e5e5;
    overflow-x: hidden;
}

/* --- تخصيص الهيدر (نمط أسود وأبيض واضح) --- */
header.glass-card {
    background: rgba(17, 24, 39, 0.95) !important; /* خلفية داكنة شبه صلبة */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* تحسين وضوح روابط الهيدر */
header nav a {
    color: #f3f4f6 !important; /* أبيض */
    font-weight: 700 !important;
}

header nav a:hover {
    color: #3b82f6 !important; /* أزرق عند التحويم */
}

/* --- شريط التمرير المخصص --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* --- شاشة التحميل --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111827;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- مؤشر فأرة مخصص --- */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    display: none;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background-color: #3b82f6;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }
    .cursor, .cursor-dot {
        display: block;
    }
}

/* --- خلفية الكانفاس --- */
#interactive-canvas {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
    z-index: 0;
}

/* --- قسم Hero الخلفية --- */
#hero {
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1531297484001-80022131f5a1?q=80&w=1740&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- التعديل هنا: تخفيف الغشاء الداكن --- */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* تم تعديل الشفافية من 0.85 إلى 0.4 فقط */
    background: linear-gradient(to bottom, rgba(17, 24, 39, 0.4), #111827);
    z-index: 1;
}

#hero .relative {
    z-index: 2;
}

.content-section {
    position: relative;
    z-index: 1;
    background: transparent; 
}

/* --- البطاقات الزجاجية (لباقي الأقسام) --- */
.glass-card {
    background: rgba(31, 41, 55, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
}

/* --- تلميح الأدوات --- */
#tooltip {
    position: fixed;
    display: none;
    padding: 8px 16px;
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fafafa;
    pointer-events: none;
    font-size: 14px;
    z-index: 9999;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* --- شارات المهارات --- */
.skill-badge {
    transition: all 0.3s ease;
}

.skill-badge:hover {
    transform: translateY(-3px);
    background-color: rgba(55, 65, 81, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

/* --- تأثيرات الظهور --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- زر الصعود للأعلى --- */
#scroll-to-top {
    z-index: 50;
}

#scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- أزرار الفلترة --- */
.filter-btn {
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.4);
    color: #d1d5db;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: rgba(55, 65, 81, 0.8);
    border-color: #3b82f6;
    color: white;
}

.filter-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* --- نافذة قيد التطوير --- */
#construction-modal {
    transition: opacity 0.3s ease-in-out;
}

#construction-modal > div {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-in-out;
}

#construction-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

#construction-modal.visible > div {
    transform: scale(1);
    opacity: 1;
}

@keyframes wrench-swing {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.animated-icon svg {
    animation: wrench-swing 2.5s ease-in-out infinite;
    transform-origin: bottom center;
}

/* --- الصور --- */
.image-placeholder {
    background-color: #1f2937;
    overflow: hidden;
}

.project-image {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.7s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-image.loaded {
    opacity: 1;
}

.project-card:hover .project-image {
    transform: scale(1.1);
}
