* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent: #06b6d4;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body[dir="ltr"] {
    font-family: 'Inter', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switcher {
    position: relative;
}

.lang-icon-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}

.lang-icon-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.lang-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.current-lang {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

[dir="ltr"] .lang-dropdown {
    right: auto;
    left: 0;
}

.language-switcher.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[dir="ltr"] .lang-option {
    text-align: left;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.lang-option.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

.lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-code {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.7;
}

.lang-option.active .lang-code {
    color: var(--primary-color);
    opacity: 1;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1f3a 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.greeting {
    display: block;
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.name {
    display: block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.role {
    display: block;
    font-size: 2rem;
    color: var(--accent);
    margin-top: 0.5rem;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s ease-out 0.3s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.code-animation {
    width: 100%;
    max-width: 400px;
    background: var(--dark-card);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-line {
    height: 12px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 4px;
    margin-bottom: 1rem;
    animation: shimmer 2s infinite;
}

.code-line:nth-child(1) { width: 80%; }
.code-line:nth-child(2) { width: 60%; }
.code-line:nth-child(3) { width: 90%; }

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* About Section */
.about {
    background: var(--dark-card);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--dark-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--accent);
    font-size: 1.5rem;
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-name {
    color: var(--text-primary);
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: var(--dark-bg);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 1s ease-out;
    animation: slideIn 1s ease-out;
}

@keyframes slideIn {
    from { width: 0; }
}

/* Projects Section */
.projects {
    background: var(--dark-card);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--dark-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    position: relative;
    overflow: hidden;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s;
}

.project-link:hover {
    background: var(--secondary-color);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    padding: 0.25rem 0.75rem;
    background: var(--dark-card);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--dark-card);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-icon {
    font-size: 2rem;
}

.contact-item h3 {
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.contact-item p {
    color: var(--text-secondary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

/* Footer */
.footer {
    background: var(--dark-card);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    color: var(--text-secondary);
}

/* RTL/LTR Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .hero::before {
    right: auto;
    left: -50%;
}

[dir="ltr"] .code-line {
    background: linear-gradient(270deg, var(--primary-color), transparent);
}

[dir="ltr"] .skill-progress {
    background: linear-gradient(270deg, var(--primary-color), var(--secondary-color));
}

[dir="ltr"] .hero .container {
    direction: ltr;
}

[dir="rtl"] .hero .container {
    direction: rtl;
}

[dir="ltr"] .stats {
    direction: ltr;
}

[dir="ltr"] .contact-content {
    direction: ltr;
}

[dir="ltr"] .projects-grid {
    direction: ltr;
}

[dir="ltr"] .skills-grid {
    direction: ltr;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .language-switcher {
        order: -1;
    }
    
    .lang-dropdown {
        right: 0;
        left: auto;
    }
    
    [dir="ltr"] .lang-dropdown {
        left: 0;
        right: auto;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background: var(--dark-card);
        width: 100%;
        text-align: center;
        transition: right 0.3s, left 0.3s;
        padding: 2rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    [dir="ltr"] .nav-menu {
        right: auto;
        left: -100%;
    }

    .nav-menu.active {
        right: 0;
    }

    [dir="ltr"] .nav-menu.active {
        left: 0;
        right: auto;
    }
    
    [dir="ltr"] .nav-actions {
        flex-direction: row-reverse;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .role {
        font-size: 1.5rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .greeting {
        font-size: 1.2rem;
    }

    .role {
        font-size: 1.3rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

