:root {
    --bg-color: #0d0f13;
    --text-color: #ffffff;
    --text-muted: #8b9bb4;
    --neon-blue-1: #2b8bff;
    --neon-blue-2: #4db1ff;
    --neon-blue-3: #79d0ff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(43, 139, 255, 0.2);
    --font-main: 'Space Grotesk', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --easing: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 800;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s var(--easing);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn.primary {
    background: rgba(43, 139, 255, 0.1);
    border-color: var(--neon-blue-1);
    color: var(--neon-blue-3);
    box-shadow: 0 0 15px rgba(43, 139, 255, 0.2);
}

.btn.primary:hover {
    background: var(--neon-blue-1);
    color: #fff;
    box-shadow: 0 0 30px rgba(43, 139, 255, 0.6);
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(43, 139, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--neon-blue-1);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn.active,
.lang-btn:hover {
    border-color: var(--neon-blue-1);
    color: var(--neon-blue-1);
    box-shadow: 0 0 10px rgba(43, 139, 255, 0.3);
}

/* Wave Overlay */
.wave-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--neon-blue-1);
    z-index: 9998;
    transform: translateX(-100%);
    pointer-events: none;
}

/* --- HERO SECTION --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
    /* Prevent overflow from floating elements */
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 50px;
}

/* Left Side: Text */
.hero-text {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.name {
    font-size: 5rem;
    /* Bigger name */
    line-height: 1.1;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, var(--neon-blue-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role {
    font-size: 2rem;
    color: var(--neon-blue-1);
    margin-bottom: 30px;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.bio {
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 500px;
    border-left: 3px solid var(--neon-blue-1);
    padding-left: 20px;
}

/* Right Side: Visuals */
.hero-visuals {
    flex: 1;
    position: relative;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-img-container {
    position: relative;
    width: 350px;
    height: 450px;
    z-index: 1;
}

.main-img-placeholder {
    width: 100%;
    height: 100%;
    background: url(assets/hero.jpg);
    background-size: cover;
    /* Makes the image fill the box */
    background-position: center;
    /* Centers the image */
    background-repeat: no-repeat;
    /* Prevents repeated patterns */
    border-radius: 20px;
    position: relative;
    z-index: 2;
    overflow: hidden;
}


/* Fancy Border Effect */
.fancy-border {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--neon-blue-1);
    border-radius: 20px;
    z-index: 1;
    transition: transform 0.5s var(--easing);
}

.hero-visuals:hover .fancy-border {
    transform: translate(10px, 10px);
}

/* Floating Card */
.floating-card {
    position: absolute;
    bottom: 40px;
    left: -20px;
    width: 220px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 3;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

}

.float-title {
    font-weight: bold;
    color: #fff;
    font-size: 0.9rem;
}

.float-subtitle {
    font-size: 0.8rem;
    color: var(--neon-blue-2);
}

/* --- PORTFOLIO SECTION --- */
#portfolio {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
    color: #fff;
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    height: 300px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: pointer;
    transition: all 0.4s var(--easing);
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(43, 139, 255, 0.15);
    border-color: var(--neon-blue-1);
}

.project-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(13, 15, 19, 0.95), rgba(13, 15, 19, 0.4));
    z-index: 1;
    transition: opacity 0.3s ease;
}

.project-content {
    position: relative;
    z-index: 2;
}

.project-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 5px;
}

.project-short-desc {
    color: var(--neon-blue-2);
    font-size: 0.9rem;
}

/* Hover Images Popups */
.hover-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .hover-images {
    opacity: 1;
}

.hover-img {
    position: absolute;
    width: 80px;
    height: 60px;
    background: #333;
    border: 1px solid var(--neon-blue-1);
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0);
    background-size: cover;
    background-position: center;
}

.project-card:hover .hover-img:nth-child(1) {
    top: 20%;
    left: 10%;
    transform: scale(1) rotate(-10deg);
    transition-delay: 0.1s;
}

.project-card:hover .hover-img:nth-child(2) {
    top: 15%;
    right: 10%;
    transform: scale(1) rotate(10deg);
    transition-delay: 0.2s;
}

.project-card:hover .hover-img:nth-child(3) {
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%) scale(1) rotate(0deg);
    transition-delay: 0.3s;
}

/* --- 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(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    /* Increased width for better gallery view */
    max-height: 90vh;
    /* Limit height */
    overflow-y: auto;
    /* Enable scrolling */
    padding: 40px;
    background: #151920;
    border: 1px solid var(--neon-blue-1);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--neon-blue-1);
    border-radius: 4px;
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.close-modal:hover {
    color: #fff;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--neon-blue-1);
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.modal-tag {
    background: rgba(43, 139, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(43, 139, 255, 0.2);
}

.modal-desc {
    margin-bottom: 30px;
    line-height: 1.8;
    color: #ddd;
}

.modal-desc ul {
    margin-left: 20px;
    margin-top: 10px;
}

.modal-desc li {
    margin-bottom: 8px;
}

/* Modal Gallery */
.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.modal-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(43, 139, 255, 0.2);
    transition: transform 0.3s ease;
}

.modal-gallery img:hover {
    transform: scale(1.05);
    border-color: var(--neon-blue-1);
}

/* --- CONTACT SECTION --- */
#contact {
    padding: 100px 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-details {
    margin: 20px 0;
}

.contact-details p {
    margin: 10px 0;
    color: var(--text-muted);
    font-size: 1rem;
}

.contact-email,
.contact-phone {
    color: #fff !important;
    font-weight: 400;
}

.phone-number {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

.contact-form {
    padding: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-group select option {
    background: rgba(13, 15, 19, 0.95);
    color: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--neon-blue-1);
    box-shadow: 0 0 15px rgba(43, 139, 255, 0.2);
}

/* Cloudflare Turnstile styling */
.form-group .cf-turnstile {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

.form-group .cf-turnstile iframe {
    border-radius: 4px;
}

/* Footer */
footer {
    padding: 40px 0;
    border-top: 1px solid rgba(43, 139, 255, 0.2);
    text-align: center;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 40px;
    }

    .hero-text {
        margin-top: 40px;
    }

    .bio {
        margin: 0 auto;
        border-left: none;
        border-top: 3px solid var(--neon-blue-1);
        padding-left: 0;
        padding-top: 20px;
    }

    .name {
        font-size: 3.5rem;
    }

    .floating-card {
        left: 50%;
        transform: translateX(-50%);
        bottom: 20px;
        animation: none;
        /* Disable float on mobile to prevent layout shifts if needed, or keep it */
    }
}

@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }

    .modal-gallery {
        grid-template-columns: 1fr 1fr;
    }
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .lang-switcher {
    right: auto;
    left: 20px;
}

[dir="rtl"] .hover-img:nth-child(1) {
    left: auto;
    right: 10%;
}

[dir="rtl"] .hover-img:nth-child(2) {
    right: auto;
    left: 10%;
}

[dir="rtl"] .bio {
    border-left: none;
    border-right: 3px solid var(--neon-blue-1);
    padding-left: 0;
    padding-right: 20px;
}

[dir="rtl"] .fancy-border {
    right: auto;
    left: -15px;
}

[dir="rtl"] .floating-card {
    left: auto;
    right: -20px;
}

[dir="rtl"] .modal-desc ul {
    margin-left: 0;
    margin-right: 20px;
}

/* Alert Notification */
.alert-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    min-width: 300px;
    max-width: 90%;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: top 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    pointer-events: none;
}

.alert-notification.show {
    top: 30px;
    opacity: 1;
    pointer-events: all;
}

.alert-notification.success {
    background: rgba(34, 197, 94, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.alert-notification.error {
    background: rgba(239, 68, 68, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.alert-icon {
    font-size: 20px;
    line-height: 1;
}

.alert-message {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

/* RTL Support for Alert */
[dir="rtl"] .alert-notification {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* Floating Contact Button */
.floating-contact {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.floating-phone-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--neon-blue-1);
    border: 2px solid var(--neon-blue-2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(43, 139, 255, 0.4);
    transition: all 0.3s var(--easing);
    position: relative;
    z-index: 2;
}

.floating-phone-btn:hover {
    background: var(--neon-blue-2);
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(43, 139, 255, 0.6);
}

.floating-phone-btn:active {
    transform: scale(0.95);
}

.contact-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s var(--easing);
    pointer-events: none;
}

.contact-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.contact-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s var(--easing);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.contact-option:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(43, 139, 255, 0.5);
}

.contact-option.whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
}

.contact-option.phone:hover {
    background: var(--neon-blue-1);
    border-color: var(--neon-blue-1);
}

.contact-option svg {
    width: 24px;
    height: 24px;
}

/* RTL Support for Floating Contact */
[dir="rtl"] .floating-contact {
    right: auto;
    left: 30px;
}

[dir="rtl"] .contact-popup {
    right: auto;
    left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .floating-contact {
        bottom: 20px;
        right: 20px;
    }

    [dir="rtl"] .floating-contact {
        right: auto;
        left: 20px;
    }

    .floating-phone-btn {
        width: 55px;
        height: 55px;
    }

    .contact-option {
        width: 45px;
        height: 45px;
    }

    .contact-option svg {
        width: 20px;
        height: 20px;
    }
}