@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #0a8f2a 0%, #0ec230 50%, #22c55e 100%);
    --secondary-gradient: linear-gradient(135deg, #4ade80 0%, #86efac 100%);
    --dark-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    --accent-color: #0ec230;
    
    /* Dark mode variables (default) */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #777777;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Light mode variables */
[data-theme="light"] {
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #edf2f7;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --header-bg: rgba(255, 255, 255, 0.95);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: all 0.3s ease;
}

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

/* Language Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    margin: 5vh auto;
    padding: 3rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: var(--hover-shadow);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.language-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.language-option {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.language-option:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent-color);
}

.flag {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 12px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.theme-toggle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--hover-shadow);
}

.theme-toggle-icon {
    width: 24px;
    height: 24px;
    display: block;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.95);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] header.scrolled {
    background: rgba(255, 255, 255, 0.98);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 9999;
    padding: 2rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
}

.mobile-nav-links li {
    margin: 2rem 0;
}

.mobile-nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.mobile-nav-links a:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero {

    padding: 180px 0 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Starfield Canvas */
.starfield-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(14, 194, 48, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('assets/legend.aeb553ba.webp') no-repeat center center;
    background-size: contain;
    opacity: 0.15;
    z-index: 1;
    filter: blur(1px);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 400;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0.8;
    animation: fadeInUp 1s ease 0.4s both;
}

.btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 16px 40px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.6s both;
    position: relative;
    overflow: hidden;
}

.btn::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:hover::before {
    left: 100%;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Sections */
section {
    padding: 120px 0;
    position: relative;
}

.section-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -1px;
    position: relative;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* About Section */
.about {
    background: var(--bg-secondary);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

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

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

.about-image {
    text-align: center;
    position: relative;
}

.profile-img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid white;
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.05);
}

.about-image::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--secondary-gradient);
    z-index: 1;
    opacity: 0.8;
}

/* Skills Section */
.skills {
    background: var(--bg-primary);
    position: relative;
}

.skills::before {
    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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(102,126,234,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 2;
}

.skill-item {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.skill-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--hover-shadow);
}

.skill-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    filter: grayscale(0.5);
    transition: filter 0.3s ease;
}

.skill-item:hover .skill-icon {
    filter: grayscale(0);
}

.skill-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-item p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Projects Section */
.projects {
    background: var(--bg-secondary);
    position: relative;
}

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

.project-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--hover-shadow);
}

.project-image {
    width: 100%;
    height: 240px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    position: relative;
    overflow: hidden;
}

.project-image::before {
    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"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="3" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 15s ease-in-out infinite;
}

.project-content {
    padding: 2.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.project-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.project-link:hover::after {
    transform: translateX(5px);
}

.project-link:hover {
    color: #0a8f2a;
}

/* GitHub Repositories Section */
.github-repos {
    background: var(--bg-primary);
    position: relative;
    padding: 120px 0;
}

.github-repos::before {
    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="github-grid" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(14,194,48,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23github-grid)"/></svg>');
}

.github-loading {
    text-align: center;
    padding: 3rem 0;
    position: relative;
    z-index: 2;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.github-error {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
}

.github-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.repo-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
}

.repo-card.visible {
    opacity: 1;
}

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.repo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent-color);
}

.repo-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.repo-icon {
    width: 20px;
    height: 20px;
    fill: var(--accent-color);
}

.repo-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.repo-name:hover {
    color: var(--accent-color);
}

.repo-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.repo-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.repo-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.repo-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.loading-repos {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.error-repos {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

/* Contact Section */
.contact {
    background: var(--dark-gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

.contact::before {
    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 1000 1000"><defs><radialGradient id="contact-grad" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="rgba(102,126,234,0.1)"/><stop offset="100%" stop-color="transparent"/></radialGradient></defs><circle cx="100" cy="100" r="50" fill="url(%23contact-grad)"/><circle cx="900" cy="200" r="80" fill="url(%23contact-grad)"/><circle cx="200" cy="800" r="60" fill="url(%23contact-grad)"/></svg>');
    animation: float 25s ease-in-out infinite reverse;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.contact-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.contact-info h3 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    background: var(--secondary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-info p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.contact-info .highlight {
    color: var(--text-primary);
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    min-height: 60px;
}

.footer-language-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-self: start;
}

.footer-language-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-language-btn:hover,
.footer-language-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 194, 48, 0.3);
}

.footer-copyright {
    text-align: center;
    justify-self: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.footer-copyright p {
    margin: 0;
    padding: 0.5rem 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

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

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero::after {
        background-size: cover;
        opacity: 0.08;
        filter: blur(2px);
    }

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

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

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

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

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

    .profile-img {
        width: 200px;
        height: 200px;
    }

    .about-image::before {
        width: 200px;
        height: 200px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-language-selector {
        order: 2;
        justify-self: center;
    }

    .footer-copyright {
        order: 1;
        justify-self: center;
    }

    /* Modal responsive fixes */
    .modal-content {
        margin: 5% auto;
        padding: 2rem 1.5rem;
        width: 95%;
        max-width: none;
    }

    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
    }

    .modal-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .language-options {
        gap: 0.8rem;
        flex-direction: column;
    }

    .language-option {
        padding: 1rem 1.5rem;
        min-width: 100%;
        flex-direction: row;
        justify-content: center;
        font-size: 0.95rem;
    }

    .flag {
        font-size: 1.5rem;
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
}

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

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

    .container {
        padding: 0 15px;
    }

    .skill-item,
    .project-card,
    .contact-form {
        padding: 2rem 1.5rem;
    }

    /* Modal responsive fixes for very small screens */
    .modal-content {
        margin: 2% auto;
        padding: 1.5rem 1rem;
        width: 98%;
        border-radius: 15px;
    }

    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 0.6rem;
    }

    .modal-content p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }

    .language-option {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .flag {
        font-size: 1.3rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0a8f2a;
}

/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: all 0.8s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.preloader-text {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: preloaderSpin 1s linear infinite;
}

@keyframes preloaderPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(14, 194, 48, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(14, 194, 48, 0.5);
    }
}

@keyframes preloaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chat Button */
.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: var(--hover-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 250px;
    white-space: nowrap;
}

.chat-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(14, 194, 48, 0.4);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 100px);
    background-color: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--hover-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.chat-window.hidden {
    display: none;
}

.chat-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-chat {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.chat-input {
    display: flex;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    gap: 12px;
    align-items: flex-end;
    border-radius: 0 0 20px 20px;
}

.chat-input textarea {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    resize: none;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    min-height: 44px;
    transition: all 0.2s ease;
}

.chat-input textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(14, 194, 48, 0.1);
}

.chat-input textarea::placeholder {
    color: var(--text-muted);
}

.chat-input button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    height: 44px;
}

.chat-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 194, 48, 0.3);
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    margin: 4px 0;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.chat-bubble.user {
    background: var(--primary-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    margin-left: auto;
}

.chat-bubble.bot {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border-color);
}

.chat-bubble.loading {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Typing indicator animation */
.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-color);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .chat-window {
    left: 20px;
    right: auto;
}

[dir="rtl"] .chat-button {
    left: 20px;
    right: auto;
}

[dir="rtl"] .chat-bubble.user {
    align-self: flex-start;
    margin-left: 0;
    margin-right: auto;
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 6px;
}

[dir="rtl"] .chat-bubble.bot {
    align-self: flex-end;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 6px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 10px;
        left: 10px;
        border-radius: 15px;
    }
    
    .chat-button {
        bottom: 15px;
        right: 15px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    [dir="rtl"] .chat-window {
        left: 10px;
    }
    
    [dir="rtl"] .chat-button {
        left: 15px;
        right: auto;
    }
    
    .chat-bubble {
        max-width: 90%;
        font-size: 13px;
    }
}


