/* Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #070919;
    color: #111827;
    direction: rtl;
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

a {
    text-decoration: none;
}

button:focus,
input:focus,
textarea:focus {
    outline: none;
    box-shadow: none;
}

.navbar {
    background: rgba(7, 9, 25, 0.18);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    z-index: 999;
}

.navbar.scrolled {
    background: rgba(7, 9, 25, 0.94);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.82);
    transition: color 0.3s;
    position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #7c3aed;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #7c3aed;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 100%;
}

.hero-section {
    min-height: 100vh;
    position: relative;
    padding: 120px 0 80px;
    background: radial-gradient(circle at top right, rgba(125, 90, 255, 0.35), transparent 22%),
                radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.22), transparent 18%),
                radial-gradient(circle at 85% 25%, rgba(16, 185, 129, 0.14), transparent 14%),
                linear-gradient(135deg, #0a1122 0%, #141b3e 35%, #221c47 100%);
    background-size: 220% 220%, 180% 180%, 160% 160%, cover;
    background-position: 0% 20%, 100% 10%, 90% 70%, 0% 0%;
    animation: heroBackgroundShift 18s ease-in-out infinite;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12), transparent 42%);
    pointer-events: none;
    opacity: 0.9;
    animation: heroGlow 12s ease-in-out infinite;
}

.hero-title {
    animation: heroTextIn 1.2s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-text {
    animation: heroSubtitleIn 1.4s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-section .hero-buttons,
.hero-section .btn {
    animation: heroButtonsIn 1.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-card {
    animation: heroCardFloat 10s ease-in-out infinite alternate;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.02)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

@keyframes heroBackgroundShift {
    0%, 100% { background-position: 0% 20%, 100% 10%, 90% 70%, 0% 0%; }
    50% { background-position: 100% 10%, 0% 40%, 35% 25%, 100% 100%; }
}

@keyframes heroGlow {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

@keyframes heroTextIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroSubtitleIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroButtonsIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroCardFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-12px); }
}

.hero-title {
    max-width: 720px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    0% { filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.6)); }
}

.hero-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.hero-card::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -90px;
    left: -90px;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-card-header h5,
.hero-card-header p {
    color: #ffffff;
}

.service-preview,
.about-card,
.stats-card,
.service-card,
.project-card,
.contact-panel {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.service-preview {
    border-radius: 24px;
    transition: all 0.3s ease;
}

.service-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.service-preview .icon-box,
.service-card .icon-box {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.service-preview .icon-box:hover,
.service-card .icon-box:hover {
    transform: scale(1.1);
}

.service-card,
.project-card,
.about-card,
.stats-card,
.contact-panel {
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.service-card::before,
.project-card::before,
.about-card::before,
.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.service-card:hover::before,
.project-card:hover::before,
.about-card:hover::before,
.stats-card:hover::before {
    left: 100%;
}

.service-card:hover,
.project-card:hover,
.about-card:hover,
.stats-card:hover,
.contact-panel:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}

.section-title {
    font-size: clamp(2rem, 2.5vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    border-radius: 2px;
    transform: translateX(-50%);
}

.section-header span {
    display: block;
    color: #818cf8;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.section-header h2 {
    font-size: 2.7rem;
    font-weight: 700;
}

.about-card,
.stats-card,
.service-card,
.project-card,
.contact-panel {
    padding: 1.8rem;
}

.about-card p,
.service-card p,
.project-card p,
.contact-panel p,
.stats-card p {
    color: #57606f;
}

.stats-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    text-align: center;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.stats-card p {
    margin-top: 0.5rem;
    font-weight: 500;
}

.service-card .icon-box {
    margin-bottom: 1rem;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #f97316 0%, #facc15 100%);
}

.bg-gradient-tertiary {
    background: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%);
}

.bg-gradient-quaternary {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

.service-card h5,
.project-card h5 {
    margin-bottom: 1rem;
    font-weight: 700;
    color: #1f2937;
}

/* تحسينات الخدمات */
.service-card .icon-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.service-card .icon-box:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.service-card h5 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.service-card ul {
    padding-right: 1rem;
}

.service-card li {
    margin-bottom: 0.5rem;
}

.service-card .btn {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.service-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* تحسينات المشاريع */
.project-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
    transition: all 0.3s ease;
}

.project-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.4);
}

.project-card {
    border: 1px solid rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 50px 50px 0;
    border-color: transparent #7c3aed transparent transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::after {
    opacity: 0.1;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}

.tech-stack {
    margin-bottom: 1rem;
}

.tech-stack .badge {
    margin: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.project-card .btn {
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.project-card .btn:hover {
    transform: translateX(-3px);
}

/* فلتر المشاريع */
.btn-group .btn {
    border-radius: 25px !important;
    margin: 0.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-group .btn.active {
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    border-color: #7c3aed;
    color: white;
}

.btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* إخفاء وعرض المشاريع */
.project-item {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.project-item.hidden {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
    display: none;
}

/* إحصائيات الخدمات */
.display-4 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تحسينات البطاقات العامة */
.card, .service-card, .project-card, .about-card, .stats-card, .contact-panel {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover, .service-card:hover, .project-card:hover, .about-card:hover, .stats-card:hover, .contact-panel:hover {
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.1);
}

/* تأثيرات متقدمة للبطاقات */
.service-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #7c3aed, #2563eb, #f97316, #0ea5e9);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 0.3;
}

.project-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #2563eb, #7c3aed, #ec4899, #8b5cf6);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 0.3;
}

/* تحسينات الأيقونات */
.service-card .icon-box i, .project-badge i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* تأثيرات النصوص */
.service-card h5, .project-card h5 {
    transition: color 0.3s ease;
}

.service-card:hover h5, .project-card:hover h5 {
    color: #7c3aed;
}

/* تحسينات الأزرار */
.btn-outline-primary {
    position: relative;
    overflow: hidden;
}

.btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.1), transparent);
    transition: left 0.5s;
}

.btn-outline-primary:hover::before {
    left: 100%;
}

.project-card {
    border: 1px solid rgba(15, 23, 42, 0.05);
    position: relative;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent #7c3aed transparent transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::after {
    opacity: 0.1;
}

.contact-panel {
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-panel h2,
.contact-panel p,
.contact-panel a,
.contact-panel span {
    color: #f8fafc;
}

.contact-panel i {
    color: #c7d2fe;
}

.bg-gradient-contact {
    background: linear-gradient(135deg, #070919 0%, #1e293b 45%, #111827 100%);
    position: relative;
}

.bg-gradient-contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(124, 58, 237, 0.1), transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.1), transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5b21b6 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
}

footer {
    background: #0f172a;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), transparent);
}

footer a {
    color: rgba(255, 255, 255, 0.72);
    transition: all 0.3s ease;
}

footer a:hover {
    color: #7c3aed;
    transform: translateY(-2px);
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 240px;
    overflow: hidden;
    pointer-events: none;
}

.hero-wave::before,
.hero-wave::after {
    content: '';
    position: absolute;
    left: -20%;
    width: 140%;
    height: 180px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50% 50% 0 0;
    transform: translateY(40px);
    filter: blur(10px);
    opacity: 0.7;
    animation: waveFloat 12s ease-in-out infinite;
}

.hero-wave::after {
    top: 20px;
    width: 130%;
    opacity: 0.55;
    animation-duration: 16s;
    background: rgba(124, 58, 237, 0.12);
}

.hero-wave svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wave-shape {
    fill: rgba(255, 255, 255, 0.08);
}

.wave-shape.wave-2 {
    fill: rgba(124, 58, 237, 0.14);
    opacity: 0.75;
}

@keyframes waveFloat {
    0%, 100% { transform: translate(0, 40px); }
    50% { transform: translate(-25px, 20px); }
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}

.bubble-1 {
    width: 120px;
    height: 120px;
    background: #8b5cf6;
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.bubble-2 {
    width: 90px;
    height: 90px;
    background: #22d3ee;
    top: 40%;
    right: 25%;
    animation-delay: 1s;
}

.bubble-3 {
    width: 70px;
    height: 70px;
    background: #fb7185;
    top: 72%;
    right: 15%;
    animation-delay: 2s;
}

.hero-text,
.hero-title {
    position: relative;
    z-index: 1;
}

.form-control {
    border: 2px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.loading {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991px) {
    .hero-section {
        padding-top: 140px;
    }

    .hero-card {
        margin-top: 2rem;
    }

    .section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 767px) {
    .section-title {
        font-size: 2.2rem;
    }

    .hero-section {
        padding-top: 120px;
    }

    .hero-card::after {
        width: 180px;
        height: 180px;
        top: -70px;
        left: -70px;
    }

    .hero-bubble {
        display: none;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hide {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    margin-bottom: 10px;
    font-weight: 700;
}

.loading-content p {
    opacity: 0.8;
    font-size: 0.9rem;
}
