:root {
    --bg-color: #0f1115;
    --card-bg: #1c1f26;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent: #3b82f6;
    /* Professional Blue */
    --accent-hover: #2563eb;
    --border-color: #2d3748;
    --font-heading: 'Heebo', sans-serif;
    --font-body: 'Rubik', sans-serif;
    --container-width: 1100px;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --card-bg: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Layout */
.navbar,
section,
header {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}


/* Utilities */
.hidden {
    display: none !important;
}

/* Navbar */
.navbar-container {
    padding-top: 20px;
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    /* Sticky support */
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Hero */
.hero {
    padding-top: 100px;
    padding-bottom: 80px;
    text-align: center;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background-color: var(--accent);
    color: white;
    font-weight: 600;
    border-radius: 6px;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.cta-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

/* Sections */
section {
    padding-top: 80px;
    padding-bottom: 80px;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--accent);
    margin-top: 10px;
    border-radius: 2px;
}

/* About Grid */
.about-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Skills */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    padding: 8px 16px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

.card-image {
    height: 200px;
    background-color: #2d3748;
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.project-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.card-content p {
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

.project-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

.project-links a:hover {
    text-decoration: underline;
}

/* Contact */
.contact-section {
    text-align: center;
    background-color: var(--card-bg);
    padding: 60px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    /* Override section max-width locally if needed, but keeping consistent */
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.contact-icon {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.contact-icon:hover {
    color: var(--accent);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .about-container {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
        /* Simplification for quick clean mobile view */
    }

    .navbar-container {
        justify-content: center;
    }
}