/* المتغيرات والأساسيات */
:root {
    --primary: #6a11cb;
    --secondary: #2575fc;
    --dark: #0f0c29;
    --light: #ffffff;
    --accent: #ff4d94;
    --text: #e6e6e6;
    --space-dark: #05051e;
    --nebula-purple: #3a1c71;
    --nebula-blue: #2575fc;
    --star-glow: rgba(255, 255, 255, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background: var(--space-dark);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* الكون ثلاثي الأبعاد */
#universe-3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

#stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 8s infinite;
}

.star.small {
    width: 1px;
    height: 1px;
}

.star.medium {
    width: 2px;
    height: 2px;
}

.star.large {
    width: 3px;
    height: 3px;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }
}

#nebula {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(58, 28, 113, 0.2) 0%, rgba(37, 117, 252, 0.1) 40%, rgba(15, 12, 41, 0) 70%);
}

/* الشريط العلوي المحسن للجوال */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header.scrolled {
    padding: 0.8rem 5%;
}

/* الـ Logo */
.logo {
    font-size: 2.5rem;
    font-weight: 800;
}

.logo-text {
    background: linear-gradient(135deg, #ff4d94, #6a11cb, #2575fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(106, 17, 203, 0.6);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo-text:hover {
    text-shadow: 0 0 30px rgba(255, 77, 148, 0.8);
    transform: scale(1.05);
}

/* التنقل - تصميم متجاوب */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-list li a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    font-size: 1rem;
}

.nav-list li a:hover {
    color: var(--accent);
}

.nav-list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-list li a:hover::after {
    width: 100%;
}

/* زر القائمة للجوال */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text);
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.menu-toggle:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.15);
}

.menu-toggle.active {
    color: var(--accent);
}

/* طبقة التعتيم للقائمة الجانبية */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* قسم الترحيب */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 5% 50px;
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.logo-3d-container {
    margin: 0 auto 3rem;
    width: 350px;
    height: 350px;
    perspective: 1000px;
}

.custom-logo {
    width: 100%;
    height: 100%;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(106, 17, 203, 0.6));
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    transition: all 0.5s ease;
}

.custom-logo:hover .logo-image {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 40px rgba(255, 77, 148, 0.8));
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(106, 17, 203, 0.4);
}

/* العناوين العامة */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}

section {
    padding: 4rem 0;
    position: relative;
}

/* قسم من نحن */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: block;
}

.about-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(106, 17, 203, 0.1), rgba(37, 117, 252, 0.1));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.about-image:hover::before {
    opacity: 1;
}

.about-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

/* قسم الخدمات */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-card {
    height: 500px;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    border-radius: 20px;
}

.service-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card-front {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.card-back {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: rotateY(180deg);
    text-align: center;
    justify-content: center;
}

.service-visual {
    height: 280px;
    margin-bottom: 1.5rem;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.service-image-3d {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.service-card:hover .service-image-3d {
    transform: scale(1.15);
}

.service-features {
    list-style: none;
    text-align: right;
    margin-bottom: 2rem;
}

.service-features li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-right: 1.5rem;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--accent);
    font-weight: bold;
}

.service-link {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.service-link:hover {
    background: white;
    color: var(--primary);
}

/* قسم معرض الأعمال */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 500px;
    position: relative;
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    display: block;
    cursor: pointer;
}

.portfolio-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(106, 17, 203, 0.3);
    border-color: rgba(106, 17, 203, 0.3);
    text-decoration: none;
    color: inherit;
}

.portfolio-visual {
    height: 100%;
    overflow: hidden;
    position: relative;
}

.portfolio-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.portfolio-item:hover .portfolio-image {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(15, 12, 41, 0) 0%,
            rgba(15, 12, 41, 0.8) 70%,
            rgba(15, 12, 41, 0.9) 100%);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    opacity: 1;
    transition: all 0.3s ease;
}

.portfolio-content {
    width: 100%;
    text-align: center;
}

.portfolio-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.portfolio-item:hover .portfolio-link {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(106, 17, 203, 0.4);
}

.portfolio-stats {
    display: none !important;
}

/* قسم تواصل معنا */
.contact-container {
    display: flex;
    justify-content: center;
}

.whatsapp-card {
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 20px;
    padding: 2.5rem;
    color: white;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(37, 211, 102, 0.3);
}

.whatsapp-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.whatsapp-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #25D366;
}

.whatsapp-header h3 {
    font-size: 1.8rem;
    margin: 0;
    color: white;
}

.whatsapp-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.contact-item i {
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: white;
    color: #25D366;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.whatsapp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

/* التذييل المحسن */
footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 3rem 0 1rem;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    position: relative;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent);
}

/* المنصات الاجتماعية في الفوتر */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text);
    text-decoration: none;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-link i {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(106, 17, 203, 0.3);
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover i {
    color: white;
}

/* نموذج النشرة البريدية */
.newsletter-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-input-container {
    position: relative;
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 14px 45px 14px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(106, 17, 203, 0.3);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.form-control:focus+.input-icon {
    color: var(--primary);
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 25px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #ccc;
}

/* زر الأدمن */
.admin-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.admin-btn a {
    background: rgba(106, 17, 203, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.admin-btn a:hover {
    background: rgba(106, 17, 203, 0.5);
}

/* تأثيرات البطاقات */
.card-3d {
    transition: all 0.3s ease;
}

.card-3d:hover {
    transform: translateY(-5px);
}

/* تأثيرات الهولوغرام */
.holographic-scene {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    overflow: hidden;
    border-radius: 15px;
}

.real-character-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.real-person {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: hue-rotate(45deg) contrast(1.1) brightness(1.05);
    animation: hologramFlicker 4s ease-in-out infinite;
    transition: all 0.5s ease;
}

.service-card:hover .real-person {
    filter: hue-rotate(30deg) contrast(1.2) brightness(1.1);
    transform: scale(1.1);
}

.hologram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 0%, rgba(106, 17, 203, 0.1) 25%, transparent 50%, rgba(37, 117, 252, 0.1) 75%, transparent 100%);
    animation: scanLine 3s linear infinite;
    mix-blend-mode: overlay;
}

@keyframes hologramFlicker {

    0%,
    100% {
        filter: hue-rotate(45deg) contrast(1.1) brightness(1.05);
    }

    50% {
        filter: hue-rotate(60deg) contrast(1.2) brightness(1.1);
    }
}

@keyframes scanLine {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* تصميم متجاوب للجوال */
@media (max-width: 768px) {
    header {
        padding: 0.8rem 5%;
    }

    .logo {
        font-size: 1.8rem;
    }

    .logo-text {
        font-size: 1.8rem;
    }

    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(15, 12, 41, 0.98);
        backdrop-filter: blur(20px);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        padding: 80px 2rem 2rem;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        pointer-events: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .main-nav.active {
        right: 0;
        pointer-events: auto;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-list li:last-child {
        border-bottom: none;
    }

    .nav-list li a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        width: 100%;
        transition: all 0.3s ease;
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
        touch-action: manipulation;
    }

    .nav-list li a:hover {
        color: var(--accent);
        padding-right: 10px;
    }

    .nav-list li a::after {
        display: none;
    }

    /* تحسينات الاستجابة للأقسام */
    .about-content,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .services-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .hero {
        padding: 100px 5% 50px;
    }

    .logo-3d-container {
        width: 250px;
        height: 250px;
    }

    .service-visual {
        height: 220px;
    }

    .service-card {
        height: 450px;
    }

    .about-image img {
        height: 400px;
    }

    .whatsapp-card {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }

    .whatsapp-header {
        flex-direction: column;
        text-align: center;
    }

    .whatsapp-header h3 {
        font-size: 1.5rem;
    }

    .portfolio-item {
        height: 400px;
    }

    .portfolio-content h3 {
        font-size: 1.5rem;
    }

    .portfolio-link {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }

    .portfolio-overlay {
        padding: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-column h3::after {
        right: 50%;
        transform: translateX(50%);
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.6rem;
    }

    .logo-text {
        font-size: 1.6rem;
    }

    .main-nav {
        width: 250px;
    }

    .nav-list li a {
        font-size: 1rem;
        padding: 0.8rem 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .logo-3d-container {
        width: 200px;
        height: 200px;
    }

    .service-visual {
        height: 180px;
    }

    .service-card {
        height: 420px;
    }

    .about-image img {
        height: 300px;
    }

    .portfolio-item {
        height: 350px;
    }

    .portfolio-content h3 {
        font-size: 1.3rem;
    }

    .portfolio-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .portfolio-overlay {
        padding: 1rem;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* تحسينات إضافية للشريط العلوي */
@media (min-width: 769px) {
    .nav-list {
        gap: 2.5rem;
    }

    .nav-list li a {
        font-size: 1.05rem;
    }
}

/* تحسينات تحميل الصور */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

.service-image-3d,
.real-person,
.about-image img,
.portfolio-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* تحسينات إضافية للقائمة على الموبايل */
@media (max-width: 768px) {
    .main-nav {
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-overlay {
        transition: opacity 0.3s ease;
    }

    /* تحسين أداء القائمة */
    .main-nav,
    .nav-overlay {
        will-change: transform, opacity;
    }

    /* منع الاهتزاز */
    .nav-list li a {
        -webkit-tap-highlight-color: transparent;
    }
}

/* تحسينات للأجهزة التي تدعم اللمس */
@media (hover: none) and (pointer: coarse) {
    .nav-list li a:hover {
        color: var(--text);
        padding-right: 0;
    }

    .nav-list li a:active {
        color: var(--accent);
        background: rgba(255, 255, 255, 0.05);
    }
}

/* تحسينات نهائية للقائمة على الموبايل */
@media (max-width: 768px) {
    .main-nav {
        transition: right 0.4s ease-in-out;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .nav-overlay {
        transition: opacity 0.3s ease-in-out;
    }

    /* تحسين النقر على الروابط */
    .nav-list li a {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
        display: block;
        padding: 1rem 0;
        cursor: pointer;
    }

    /* تحسين أداء القائمة */
    .main-nav,
    .nav-overlay {
        will-change: transform, opacity;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}

/* إصلاح مشاكل اللمس على الأجهزة المحمولة */
@media (hover: none) and (pointer: coarse) {
    .menu-toggle {
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
    }

    .nav-list li a {
        min-height: 44px;
        display: flex;
        align-items: center;
        cursor: pointer;
    }
}

/* تحسينات للأجهزة التي تدعم اللمس */
.touch-device .nav-list li a:active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* تأكد من أن الرواق قابلة للنقر */
.nav-link {
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
}

/* تحسين ظهور الصور */
img[loading="lazy"].loaded {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* إصلاح مشاكل التمرير السلس */
html {
    scroll-behavior: smooth;
}

/* تحسين أداء التمرير */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* تحسينات القائمة الجانبية للموبايل */
@media (max-width: 768px) {
    .main-nav {
        transition: right 0.3s ease-in-out;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .nav-list li a {
        min-height: 50px;
        display: flex;
        align-items: center;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        touch-action: manipulation;
        padding: 1.2rem 0;
        font-size: 1.1rem;
    }

    .nav-list li a:active {
        background: rgba(255, 255, 255, 0.1);
        color: var(--accent);
    }

    /* تحسين حجم صور بطاقات الخدمات */
    .service-visual {
        height: 320px !important;
    }

    .service-card {
        height: 520px !important;
    }

    .service-visual img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* تحسين التمرير السلس */
    html {
        scroll-behavior: smooth;
    }
}

/* تحسينات إضافية للشاشات الصغيرة */
@media (max-width: 480px) {
    .service-visual {
        height: 280px !important;
    }

    .service-card {
        height: 480px !important;
    }
}