/* CSS Reset & Variables */
:root {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --heading-color: #ffffff;
    --accent-color: #58a6ff;
    --secondary-accent: #238636;
    --card-bg: rgba(22, 27, 34, 0.7);
    /* More transparent for glassmorphism */
    --border-color: #30363d;
    --font-primary: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
    --header-height: 80px;
    --glow-shadow: 0 0 20px rgba(88, 166, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #58a6ff;
}

/* Selection Color */
::selection {
    background: rgba(88, 166, 255, 0.3);
    color: #fff;
}

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Background Animation Canvas */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0.6;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    font-family: var(--font-code);
    font-size: 2.5rem;
    margin-bottom: 4rem;
    text-align: center;
    color: var(--heading-color);
    position: relative;
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

.section-title span {
    color: var(--accent-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-accent));
    margin: 15px auto 0;
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--accent-color), #1f6feb);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-family: var(--font-code);
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(31, 111, 235, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(31, 111, 235, 0.5);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    font-weight: 600;
    font-family: var(--font-code);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--heading-color);
}

/* Header & Glassmorphism */
header {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--header-height);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(13, 17, 23, 0.95);
    height: 70px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: var(--font-code);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--heading-color);
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    right: 0;
    /* RTL animation for Arabic feel if needed, but keeping standard left-to-right */
    left: 0;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    z-index: 1001;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-height);
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero-tag {
    font-family: var(--font-code);
    color: var(--secondary-accent);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 5px 15px;
    background: rgba(35, 134, 54, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--heading-color);
}

.typed-cursor {
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    color: #8b949e;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.hero-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 30px;
    border: 4px solid rgba(88, 166, 255, 0.3);
    box-shadow: 0 0 30px rgba(88, 166, 255, 0.2);
    overflow: hidden;
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-img:hover img {
    transform: scale(1.1);
}

/* Services */
.services {
    padding: 100px 0;
    position: relative;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 40px 30px;
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(88, 166, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.service-card:hover::before {
    transform: translateX(100%);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: var(--glow-shadow);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 25px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: var(--heading-color);
}

/* Projects */
.projects {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-color) 0%, #13171f 100%);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary-accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-img {
    width: 100%;
    height: 220px;
    background-color: #21262d;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.project-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.project-card:hover .project-img::after {
    background: rgba(0, 0, 0, 0.0);
}

.project-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--heading-color);
    font-weight: 700;
}

.project-desc {
    font-size: 0.95rem;
    color: #8b949e;
    margin-bottom: 20px;
    flex: 1;
}

.project-tech {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-links a {
    font-size: 1.2rem;
    color: var(--text-color);
    padding: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.project-links a:hover {
    background: var(--accent-color);
    color: white;
}

/* Products */
.products {
    padding: 100px 0;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.item-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
}

.product-card:hover {
    border-color: var(--accent-color);
    transform: scale(1.02);
}

.product-price {
    font-family: var(--font-code);
    font-size: 1.8rem;
    color: var(--heading-color);
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Contact */
.contact {
    padding: 100px 0;
    text-align: center;
    background: linear-gradient(0deg, #090c10 0%, var(--bg-color) 100%);
}

.contact-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 50px;
    border-radius: 12px;
    max-width: 700px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.contact-info {
    margin-bottom: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--heading-color);
}

.contact-item i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

/* Footer */
footer {
    background: #090c10;
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    z-index: 10;
}

footer p {
    color: #8b949e;
}

/* Scroll Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: #161b22;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .hero-btns {
        flex-direction: column;
        padding: 0 40px;
    }
}