/* --- Root Variables & Global Styles --- */
:root {
    --background-color: #000000;
    --surface-color: #0a0a0a;
    --border-color: #222222;
    --text-color: #ffffff;
    --secondary-text-color: #b3b3b3;
    --accent-color: #ffffff;
    --glow-color: rgba(255, 255, 255, 0.1);
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Cairo', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    font-weight: 400;
    overflow-x: hidden;
}

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

/* --- Reusable Components & Typography --- */
h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-text-color);
}

.section {
    padding: 100px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--secondary-text-color);
    font-size: 1.1rem;
}

/* --- Header --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    background: transparent;
    transition: background-color 0.4s ease, padding 0.4s ease, border-bottom 0.4s ease;
}

.main-header.scrolled {
    padding: 15px 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

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

.nav-logo a {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 35px;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

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

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

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.lang-switcher a {
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-text-color);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lang-switcher a.active {
    opacity: 1;
    color: var(--text-color);
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger div {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center; /* Vertically center content */
    text-align: center;
    overflow: hidden;
    background-color: #000;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-container {
    position: relative;
    z-index: 3;
    display: flex; /* Default for mobile: centered content */
    justify-content: center;
    align-items: center;
    width: 100%;
}

.hero-content {
    padding: 0 20px;
    animation: fadeInContent 2s 0.5s forwards;
    opacity: 0;
}

.hero-title {
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.25rem);
    color: #e0e0e0;
    margin-top: 20px;
    max-width: 600px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    letter-spacing: 1px;
    z-index: 3;
    animation: pulse 2.5s infinite, fadeInContent 1s 2s forwards;
    opacity: 0;
}

/* Hide desktop image wrapper on mobile by default */
.hero-image-wrapper {
    display: none;
}

/* --- Desktop/Tablet Hero Layout --- */
@media (min-width: 769px) {
    .hero {
        background-image: none !important; /* Ensure JS background for mobile doesn't apply */
    }

    .hero-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
        align-items: center;
        text-align: left;
    }

    html[dir="rtl"] .hero-container {
        text-align: right;
    }

    .hero-content {
        padding: 0;
        animation: none; /* Reset mobile animation */
        opacity: 1;
    }

    .hero-title, .hero-subtitle {
        text-shadow: none;
        transform: translateY(20px);
        opacity: 0;
        animation: slideUp 1s forwards;
    }

    .hero-subtitle {
        animation-delay: 0.3s;
    }

    .hero-image-wrapper {
        display: block;
        perspective: 1500px;
    }

    #hero-desktop-img {
        width: 100%;
        height: auto;
        max-height: 80vh;
        object-fit: contain;
        border-radius: 12px;
        box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
        transform: rotateY(-15deg) rotateX(5deg);
        transition: transform 0.5s ease;
    }

    html[dir="rtl"] #hero-desktop-img {
        transform: rotateY(15deg) rotateX(5deg);
    }

    #hero-desktop-img:hover {
        transform: rotateY(0) rotateX(0) scale(1.05);
    }

    .hero-overlay {
        display: none; /* Hide overlay on desktop */
    }
}

/* Keyframes for Animations */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeInContent {
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Project Gallery Section (Upgraded) --- */
.filter-buttons {
    text-align: center;
    margin-bottom: 40px;
}

.filter-buttons .btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-buttons .btn.active, .filter-buttons .btn:hover {
    background-color: var(--accent-color);
    color: var(--background-color);
    border-color: var(--accent-color);
}

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

.project-image-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--border-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.project-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-image-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.5);
}

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

/* --- Lightbox Styles --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.5s;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85vh;
    animation: zoomIn 0.5s;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    inset-inline-end: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover, .lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 18px 22px;
    color: white;
    font-weight: bold;
    font-size: 28px;
    transition: background-color 0.4s ease;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    inset-inline-start: 0;
    border-start-end-radius: 5px;
    border-end-end-radius: 5px;
}

.lightbox-next {
    inset-inline-end: 0;
    border-start-start-radius: 5px;
    border-end-start-radius: 5px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 1rem;
}

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

@keyframes zoomIn {
    from {transform: scale(0.8)}
    to {transform: scale(1)}
}


/* --- Skills & Services (Card-based sections) --- */
.skills-grid, .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.skill-category, .service-card {
    background-color: var(--surface-color);
    padding: 35px 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover, .service-card:hover {
    transform: translateY(-5px);
    border-color: #444;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.skill-category h3, .service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.service-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.skill-category ul {
    list-style: none;
    padding-left: 0;
}

.skill-category li {
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    position: relative;
    padding-inline-start: 20px;
}

.skill-category li::before {
    content: '▹';
    position: absolute;
    inset-inline-start: 0;
    color: var(--accent-color);
}

/* --- Footer & Contact (Upgraded) --- */
#contact {
    background-color: var(--surface-color);
    padding: 100px 0;
}

#contact .section-header {
    margin-bottom: 60px;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: flex-start;
}

.contact-form-wrapper {
    width: 100%;
}

.contact-form {
    width: 100%;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 18px 15px;
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.contact-form label {
    position: absolute;
    top: 18px;
    inset-inline-start: 15px;
    color: var(--secondary-text-color);
    pointer-events: none;
    transition: all 0.3s ease;
    background-color: #1a1a1a;
    padding: 0 5px;
}

.contact-form input:focus + label,
.contact-form input:not(:placeholder-shown) + label,
.contact-form textarea:focus + label,
.contact-form textarea:not(:placeholder-shown) + label {
    top: -10px;
    font-size: 0.8rem;
    color: var(--accent-color);
}

.contact-form textarea {
    resize: vertical;
}

.btn-submit {
    background-color: var(--accent-color);
    color: var(--background-color);
    padding: 16px 35px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-submit:hover {
    background-color: #ccc;
    transform: translateY(-3px);
}

#form-status {
    margin-top: 20px;
    font-weight: 500;
    min-height: 24px;
}

.error-message {
    color: #ff4d4d;
    font-size: 0.85rem;
    padding-top: 5px;
    min-height: 20px;
}

.contact-info-wrapper .footer-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.contact-card {
    background-color: #121212;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically align items */
    gap: 20px; /* Space between icon and text */
    text-align: left; /* Align text to the left */
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

html[dir="rtl"] .contact-card {
    text-align: right;
}

.contact-card:hover {
    transform: translateY(-5px);
    background-color: #1a1a1a;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.contact-card i {
    font-size: 1.8rem; /* Slightly smaller icon */
    color: var(--accent-color);
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.contact-card .contact-title {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-color);
}

.contact-card .contact-value {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    word-break: break-all;
}

.footer-bottom {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

/* Responsive adjustments for contact section */
@media (max-width: 992px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 80px; /* Increase gap for stacked layout */
    }
}

@media (max-width: 480px) {
    .contact-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    html[dir="rtl"] .contact-card {
        text-align: center;
    }
}

/* --- Responsive Design --- */

/* Desktop Styles (The creative solution) */
@media (min-width: 769px) {
    /* Custom Camera Cursor */
    body {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="%23FFFFFF"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h4.05l1.83-2h4.24l1.83 2H20v12zM12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0 8c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"/></svg>') 8 8, auto;
    }

    a, button, .project-image-item, .lightbox-close, .lightbox-prev, .lightbox-next, .lang-btn, .hamburger {
        cursor: pointer; /* Keep pointer for interactive elements */
    }
}

/* Tablet & Mobile */
@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .hamburger {
        display: block;
    }
    .nav-links {
        position: fixed;
        top: 0;
        inset-inline-start: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: inset-inline-start 0.5s ease-in-out;
        z-index: 1000;
    }
    .nav-links.nav-active {
        inset-inline-start: 0;
    }
    .nav-links a {
        font-size: 1.5rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    .section {
        padding: 60px 0;
    }

    /* --- Upgraded Mobile Project Gallery --- */
    .project-section .section-desc {
        font-size: 1rem; /* Adjust font for smaller screens */
    }
    .projects-list {
        grid-template-columns: 1fr;
        gap: 20px;
        /* Edge-to-edge immersive effect */
        margin-left: -15px;
        margin-right: -15px;
    }
    .project-image-item {
        border-radius: 0; /* Remove radius for full-width */
        box-shadow: none; /* Remove shadow for a cleaner look */
    }
    .project-image-item:hover {
        transform: none; /* Disable hover effects on touch devices */
        box-shadow: none;
    }
    .project-image-item:hover img {
        transform: none;
    }

    .skills-grid, .services-grid, .footer-contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.1s linear;
}

/* About Section - Specific Styling */
#about .about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

#about .about-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    font-style: italic;
    color: #e0e0e0;
    margin-bottom: 20px;
}

#about .about-content cite {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    font-style: normal;
}

/* --- Language & RTL (Corrected) --- */

/* Hide spans for languages that are not active */
html[lang="en"] [lang="ar"],
html[lang="en"] [lang="tr"],
html[lang="ar"] [lang="en"],
html[lang="ar"] [lang="tr"],
html[lang="tr"] [lang="en"],
html[lang="tr"] [lang="ar"] {
    display: none;
}

/* Set text direction and font for RTL */
/* Set text direction and font for RTL */
html[lang="ar"] {
    direction: rtl;
}

html[lang="ar"] body {
    font-family: var(--font-secondary);
}

/* Turkish Font */
html[lang="tr"] body {
    font-family: 'Merriweather', serif;
}

