/* -------------------------------- Body and general styling -------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Cairo', sans-serif;
    color: white;
    -webkit-overflow-scrolling: touch;
    /* smooth momentum scrolling on iOS */
}

/* ---- Remove extra horizontal space---- */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ── Fix FontAwesome icons in RTL: the glyph lives in ::before, not the element itself ── */
[dir="rtl"] .fa::before,
[dir="rtl"] .fas::before,
[dir="rtl"] .far::before,
[dir="rtl"] .fab::before,
[dir="rtl"] .fal::before,
[dir="rtl"] [class^="fa-"]::before,
[dir="rtl"] [class*=" fa-"]::before {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Cairo renders at a slightly larger optical size — compensate */
[dir="rtl"] body {
    font-size: 105%;
}

[dir="rtl"] .section-title {
    letter-spacing: 0 !important;
    /* Arabic doesn't use letter-spacing */
}

[dir="rtl"] .section-description,
[dir="rtl"] .about-description,
[dir="rtl"] .timeline-highlight p,
[dir="rtl"] .feature-list li,
[dir="rtl"] .contact-intro {
    line-height: 1.9;
}

[dir="rtl"] .stat-label,
[dir="rtl"] .about-role,
[dir="rtl"] .skills-group-title,
[dir="rtl"] .timeline-badge,
[dir="rtl"] .about-label,
[dir="rtl"] .education-badge,
[dir="rtl"] .project-badge,
[dir="rtl"] .certificate-badge {
    letter-spacing: 0 !important;
}

body {
    background-color: #010101;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Remove extra horizontal space */
}

/* General Button Styles */
button {
    padding: 12px 60px;
    font-size: 1vw;
    cursor: pointer;
    border-radius: 30px;
    border-width: 2px;
    border-style: solid;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: white;
    border-color: white;
    color: #010101;
    line-height: 110%;
    font-weight: 500;
    text-transform: uppercase;
    -webkit-appearance: none;
    appearance: none;
}

/* Hover effect for buttons */
button:hover {
    border-color: #007f73;
    background-color: #007f73;
    /* Background color changes to #007f73 */
    background: #007f73;
    /* Keep the same background color on hover */
    color: white;
    /* Text color changes to white */
}

/* Outline Button */
.btn-outline {
    border-color: white;
    background: transparent;
    /* Transparent background for outline button */
    color: white;
    /* Text color is white for outline button */
}

/* Filled Button */
.btn-filled {
    border-color: #ffffff;
    background: #ffffff;
    /* Filled button background */
    color: black;
    /* White text for filled button */
}

/* Section Styling */
section {
    padding: 20px;
    text-align: center;
    margin: 30px 0;
}

/* Title Styling */
.section-title {
    font-size: 3.1vw;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    /* Center text */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Description Styling */
.section-description {
    font-size: 0.9rem;
    font-weight: normal;
    /* Regular weight */
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    /* Center text */
    /* Gap between description and cards */
    max-width: 700px;
    /* Limit the maximum width of the text */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;

    margin: 0 auto;
}

.section-title.animate {
    opacity: 1;
    transform: translateY(0);
    animation: zoomIn 1.5s ease-out forwards;

}

.section-description.animate {
    opacity: 1;
    transform: translateY(0);
    animation: zoomIn 1.5s ease-out 0.25s forwards;
    /* Added 0.25s delay */
}


@media (max-width: 768px) {
    button {
        width: auto;
        /* Make buttons full width */
        font-size: 0.75rem;
        /* Adjust font size for smaller screens */
    }

    .section-title {
        font-size: 10vw;
    }

    .section-description {
        font-size: 2.5vw;
    }
}

@media (max-width: 350px) {
    .section-description {
        font-size: 3.5vw;
    }
}

/* -------------------------------- Header Styling -------------------------------- */
header {
    position: fixed;
    top: 0;
    inset-inline: 0;
    /* left:0; right:0; in LTR → right:0; left:0; in RTL */
    z-index: 100;
    background-color: #010101;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Subtracting 50px margin from both sides */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    gap: 24px
        /* helps spacing between logo/nav */
}

/* ── Logo ─────────────────────────────────────────────── */
.logo {
    flex-shrink: 0;
}

.logo img {
    max-height: 40px;
    display: block;
}

/* ── Nav container ────────────────────────────────────── */
nav {
    display: flex;
    align-items: center;
    gap: 32px;
    /* space between links, language, menu-icon */
    flex-grow: 1;
    justify-content: flex-end;
    /* pushes content to right in LTR */
}

.navbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
}

/* ── Nav links (desktop) ──────────────────────────────── */
.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    font-size: 18px;
}

.nav-links a {
    text-decoration: none;
    color: white;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #007f73;
}

/* ── Language dropdown ────────────────────────────────── */
.language-dropdown {
    min-width: 110px;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.6)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: white;
    padding: 6px 32px 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-left:auto;

}

.language-dropdown:focus {
    border: 1px solid #00bcd4;
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.2);
}


.language-dropdown option {
    color: black;
    background-color: #ffffff30;
}


/* ── Mobile menu icon ─────────────────────────────────── */
.menu-icon {
    font-size: 30px;
    cursor: pointer;
    display: none;
    /* hidden on desktop */
}

/* Sidebar for the menu */
.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 340px;
    height: 100%;
    background: linear-gradient(160deg, #0f1113 0%, #1a1d21 60%, #0d1210 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border-left: 1px solid rgba(0, 127, 115, 0.15);
    border-top: 3px solid #007f73;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar.open {
    right: 0;
}

/* Sidebar inner scroll container */
.sidebar>* {
    flex-shrink: 0;
}

/* Close Button Styling */
.sidebar .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.6) !important;
    cursor: pointer;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 1;
    transition: all 0.25s ease;
    line-height: 0;
    padding: 0;
    text-align: center;
}

.sidebar .close-btn:hover {
    color: #007f73 !important;
    background: rgba(0, 127, 115, 0.15);
    border-color: rgba(0, 127, 115, 0.3);
    transform: rotate(90deg);
}

.sidebar .close-btn,
.sidebar #sidebarClose {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 999 !important;
}

/* Divider Styling */
.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin: 0 24px 20px;
    width: calc(100% - 48px);
}

/* Nav links inside sidebar */
.sidebar .nav-links {
    padding: 0 24px !important;
    margin-top: 80px !important;
    width: 100%;
    align-items: start;
}

.sidebar .nav-links li a.menu-item {
    display: flex;
    align-items: start;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 1rem !important;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar .nav-links li a.menu-item:hover {
    background: rgba(0, 127, 115, 0.12);
    border-color: rgba(0, 127, 115, 0.2);
    color: #00bfa5;
    padding-left: 22px;
}

/* Language selector inside sidebar — enhanced */
.sidebar-lang-section {
    padding: 16px 24px 32px;
    width: 100%;
}

.sidebar-lang-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
    display: block;
}

.sidebar-lang-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sidebar-lang-btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-lang-btn:hover {
    background: rgba(0, 127, 115, 0.15);
    border-color: rgba(0, 127, 115, 0.3);
    color: #00bfa5;
}

.sidebar-lang-btn.active {
    background: rgba(0, 127, 115, 0.2);
    border-color: #007f73;
    color: #00bfa5;
    font-weight: 700;
}

/* Sidebar social links at bottom */
.sidebar-socials {
    padding: 0 24px 24px;
    width: 100%;
    display: flex;
    gap: 12px;
}

.sidebar-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.sidebar-socials a:hover {
    background: rgba(0, 127, 115, 0.2);
    border-color: #007f73;
    color: #00bfa5;
    transform: translateY(-2px);
}

/* Sidebar available badge */
.sidebar-availability {
    margin: 0 24px 20px;
    padding: 10px 14px;
    background: rgba(76, 175, 79, 0.08);
    border: 1px solid rgba(76, 175, 79, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-availability .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.sidebar-availability span:last-child {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        padding: 15px 40px;
    }

    .logo img {
        max-height: 30px;
        margin-left: 0;
    }

    .nav-links {
        display: none;
        /* Hide links on smaller screens */
    }

    .menu-icon {
        font-size: 30px;
        color: white;
        cursor: pointer;
        display: block;
    }

    /* Hide the navbar language dropdown on mobile — it's inside the sidebar */
    .nav-bar-dropdown {
        display: none;
    }
}

/* When the menu icon is clicked */
.sidebar.open .nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 1rem;
}

.sidebar .language-dropdown {
    align-self: center;
    margin-top: 20px;
    display: none;
    /* We use the new button-based language selector instead */
}

/* Overlay Styling */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    /* Black with 0.95 opacity */
    display: none;
    /* Hide by default */
    z-index: 999;
    /* Ensure it is below the sidebar */
}

.sidebar.open~.overlay {
    display: block;
    /* Show overlay when sidebar is open */
}

/* -------------------------------- Main Section Styling -------------------------------- */
.main-section {
    position: relative;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    background-image: url('images/main-section-background.jpg');
    background-size: cover;
    background-position: bottom center;
    /* Focus on the bottom part of the image */
    background-attachment: fixed;
    /* Enable parallax effect */
    display: flex;
    align-items: center;
    /* Center content vertically */
    justify-content: center;
    /* Center content horizontally if needed */
}

/* Text Container Styling */
.main-section .text-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    /* Limit the section width to prevent overflow */
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 auto;
    /* Center the container horizontally */
    padding: 20px;
    /* Optional: add padding for extra spacing */
    color: white;
    text-align: left;
    /* Align text to the left */
    flex-direction: column;
    justify-content: center;
    /* Center text vertically */
    align-items: flex-start;
}

/* First Name Styling */
.main-section .firstName {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

/* Last Name Styling */
.main-section .lastName {
    font-size: 7rem;
    font-weight: 900;
    color: #007f73;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: -15px 0 10px;
    line-height: 1;
}

/* Job Position Styling */
.main-section .jobPosition {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 30px;
    position: relative;
    display: inline-block;
}

.main-section .jobPosition::after {
    content: "";
    display: block;
    width: 60px;
    height: 2px;
    background: #007f73;
    margin-top: 12px;
}

/* Main Section Button Container Styling */
.buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.firstName.animate,
.lastName.animate,
.jobPosition.animate {
    animation: zoomOut 0.5s ease forwards;
}

.main-section .buttons button.animate {
    animation: slideInLeftToRight 1.5s ease forwards;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-section {
        height: auto;
        background-position: top center;
        padding-top: 80px;
        background-attachment: scroll;
        /* fixed attachment breaks on iOS mobile */
    }

    .main-section .firstName {
        font-size: 3rem;
        /* Adjust font sizes for smaller screens using viewport units */
    }

    .main-section .lastName {
        font-size: 5rem;
        /* Adjust font sizes for smaller screens */
    }

    .main-section .jobPosition {
        font-size: 0.9rem;
        /* Adjust font sizes for smaller screens */
        letter-spacing: 3px;
        /* Adjust letter spacing */
    }

    .buttons {
        flex-direction: column;
        /* Stack buttons vertically */
        gap: 10px;
        /* Adjust gap between buttons */
    }
}

/* -------------------------------- About Section -------------------------------- */
.about-section-new {
    width: 100%;
    padding: 100px 20px;
    background: linear-gradient(180deg, #010101 0%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle background accent */
.about-section-new::before {
    content: "";
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 127, 115, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ── Left: Image ── */
.about-image-wrapper {
    position: relative;
    opacity: 0;
    transform: translateX(-60px);
}

.about-image-wrapper.animate {
    animation: slideInFromLeft 1s ease-out 0.3s forwards;
}

/* Teal accent border */
.image-accent {
    position: absolute;
    top: -12px;
    left: -12px;
    width: calc(100% + 24px);
    height: calc(100% + 24px);
    border: 2px solid rgba(0, 127, 115, 0.25);
    border-radius: 20px;
    z-index: -1;
}

.about-image-wrapper video {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease;
}

.about-image-wrapper:hover video {
    transform: scale(1.02);
}

.video-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease;
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    /* Safari and Chrome */
    -moz-transform: rotateY(180deg);
    /* Firefox */
}

.video-wrapper:hover video {
    transform: scale(1.02);
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    /* Safari and Chrome */
    -moz-transform: rotateY(180deg);
    /* Firefox */
}

.sound-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.72rem;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    transition: opacity 0.4s ease;
    white-space: nowrap;
}


/* ── Right: Content ── */
.about-content {
    opacity: 0;
    transform: translateY(40px);
}

.about-content.animate {
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.about-header {
    margin-bottom: 24px;
}

.about-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: #007f73;
    margin-bottom: 8px;
}

.about-content h2 {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0 0 6px 0;
    line-height: 1.3;
    overflow: visible;
    padding-bottom: 0.2em;
    margin-bottom: -0.14em;
    background: linear-gradient(90deg, #ffffff, #b0b0b0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-role {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.about-description {
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.7);
    margin: 24px 0 32px 0;
    text-align: justify;
}

/* ── Stats Grid ── */
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 36px;
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(24px) scale(0.85);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-item:hover {
    cursor: pointer;
}

.stat-item.visible:hover {
    transform: scale(1.08);
}

.stat-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.stat-item.visible:hover .stat-number {
    color: #007f73;
    transform: scale(1.08);
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: #007f72b1;
    transition: color 0.3s ease, transform 0.3s ease;
}


.stat-item.visible .stat-number {
    animation: statPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes statPop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    65% {
        transform: scale(1.18);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.stat-item:hover .stat-number {
    color: #007f73;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

.stat-item:hover .stat-label {
    color: white;
}

/* ── Action Buttons ── */
.about-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.about-actions button {
    padding: 12px 32px;
}

/* ── Responsive ── */
@media (max-width: 968px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }

    .about-image-wrapper {
        max-width: 350px;
        margin: 0 auto;
    }

    .about-content h2 {
        font-size: 2.2rem;
    }

    .about-description {
        margin-left: auto;
        margin-right: auto;
    }

    .about-stats {
        justify-content: center;
    }

    .about-actions {
        justify-content: center;
    }
}

/* Desktop: hint hidden by default, fades in on hover */
@media (hover: hover) {
    .sound-hint {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .video-wrapper:hover .sound-hint {
        opacity: 1;
    }
}

/* Mobile: hint always visible, stats always full color (no hover state) */
@media (hover: none) {
    .sound-hint {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .stat-number {
        color: #007f73;
    }
}

/* ════════════════════════════════════════
   RTL (Arabic) — comprehensive overrides
   ════════════════════════════════════════ */

/* Arabic font override — Cairo matches the modern feel of Montserrat */
[dir="rtl"] * {
    font-family: 'Cairo', 'Montserrat', sans-serif;
}

/* ── Main Hero: keep text on the LEFT, flip the background image ── */
[dir="rtl"] .main-section {
    transform: scaleX(-1);
    /* mirror the whole section (image flips) */
}

[dir="rtl"] .main-section .text-container {
    transform: scaleX(-1);
    /* un-mirror the text so it reads correctly */
}

[dir="rtl"] .main-section .jobPosition::after {
    margin-left: auto;
    margin-right: 0;
}

/* ── About section: image moves to right, text stays readable ── */
[dir="rtl"] .about-container {
    direction: rtl;
}

[dir="rtl"] .about-image-wrapper.animate {
    animation: slideInFromRight 1s ease-out 0.3s forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[dir="rtl"] .about-description {
    text-align: right;
}

[dir="rtl"] .stat-item {
    font-size: 0.8rem;
}

[dir="rtl"] .about-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .video-wrapper video {
    transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
    /* Safari and Chrome */
    -moz-transform: rotateY(0deg);
    /* Firefox */
}

/* ── Skills ── */
[dir="rtl"] .skills-group-title {
    text-align: right;
    font-size: 0.85rem;
    /* slightly larger than LTR 0.75rem to compensate Cairo rendering */
    letter-spacing: 0 !important;
}

/* ── Projects: check icons flip, badge moves to left ── */
[dir="rtl"] .feature-list {
    text-align: right;
    direction: rtl;
}


[dir="rtl"] .project-links {
    flex-direction: row-reverse;
}

/* ── Experience timeline ── */
[dir="rtl"] .timeline-content {
    border-left: none;
    border-right: 4px solid #007f73;
    text-align: right;
}

[dir="rtl"] .timeline-item:hover .timeline-content {
    border-right-width: 6px;
}

[dir="rtl"] .timeline-item:hover .timeline-title {
    transform: translateX(-4px);
}

[dir="rtl"] .timeline-title,
[dir="rtl"] .timeline-company,
[dir="rtl"] .timeline-date {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .timeline-highlight div {
    text-align: right;
}


/* ── Education ── */
[dir="rtl"] .education-card {
    text-align: right;
    direction: rtl;
}



/* ── Contact form ── */
[dir="rtl"] .contact-form {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .form-group label {
    text-align: right;
    display: block;
}

[dir="rtl"] .form-group input,
[dir="rtl"] .form-group select,
[dir="rtl"] .form-group textarea {
    text-align: right;
    direction: rtl;
}

/* ── Subject dropdown arrow: force it back to the left in RTL ── */
[dir="rtl"] #subject {
    direction: rtl;
    /* Reset the arrow to the left side */
    background-position: left 12px center;
    padding-right: 16px;
    padding-left: 40px;
}


/* ── Contact info card (Other Ways to Connect) ── */
[dir="rtl"] .contact-info-card {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .contact-info-card h3,
[dir="rtl"] .contact-intro {
    text-align: right;
}

[dir="rtl"] .contact-method>div {
    text-align: right;
}

[dir="rtl"] .availability-badge {
    text-align: right;
    direction: rtl;
}

/* ── RTL Navbar ── 
[dir="rtl"] nav {
       flex-direction: row-reverse;
}

[dir="rtl"] .nav-links {
    order: 2;
}

[dir="rtl"] .logo {
    order: 3;
    /* after nav + language 
}

[dir="rtl"] .language-dropdown {
    order: 1;
     margin-left:0;
    margin-right:auto;
}

[dir="rtl"] .navbar{
    flex-direction: row-reverse;
}*/

/* ── RTL Navbar (scoped to navbar only so sidebar is NOT affected) ── */
[dir="rtl"] nav.navbar {
    flex-direction: row-reverse;
}

[dir="rtl"] nav.navbar .nav-links {
    order: 2;
}

[dir="rtl"] nav.navbar .logo {
    order: 3;
}

[dir="rtl"] nav.navbar .language-dropdown {
    order: 1;
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] nav.navbar .menu-icon {
    order: 0;
}

/* ── RTL Sidebar fixes ── */
[dir="rtl"] .sidebar {
    right: auto;
    left: -100%;
    border-left: none;
    border-right: 1px solid rgba(0, 127, 115, 0.15);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
}

[dir="rtl"] .sidebar.open {
    left: 0;
    right: auto;
}

[dir="rtl"] .sidebar .close-btn {
    right: auto;
    left: 20px;
}

[dir="rtl"] .sidebar .nav-links {
    align-items: flex-start;
    text-align: right;
    padding-right: 24px !important;
    padding-left: 0 !important;
}

[dir="rtl"] .sidebar .nav-links li a.menu-item {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .sidebar-socials {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar-lang-section {
    align-items: flex-end;
}

[dir="rtl"] .sidebar-lang-options {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar-availability {
    flex-direction: row-reverse;
}


@media (max-width: 768px) {
    .about-section-new {
        padding: 60px 20px;
    }

    .about-container {
        gap: 40px;
    }

    .about-content h2 {
        font-size: 1.8rem;
    }

    .about-description {
        font-size: 0.95rem;
    }

    /* Stats: keep 3 columns but make them more impactful */
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        padding: 0;
        border-top: none;
        border-bottom: none;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.07);
        overflow: hidden;
    }

    .stat-item {
        padding: 16px 10px;
        border-right: 1px solid rgba(255, 255, 255, 0.07);
        opacity: 0;
        transform: translateY(24px) scale(0.85);
    }

    .stat-item:last-child {
        border-right: none;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }

    .about-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .about-content h2 {
        font-size: 2rem;
        color: white;
    }

    .about-role {
        font-size: 0.72rem;
        letter-spacing: 1.5px;
    }
}

/* -------------------------------- Skills Section Styling -------------------------------- */
.skills-section {
    width: 100%;
    max-width: 1200px;
    /* Limit the section width to prevent overflow */
    margin: 0 auto;
    /* Center the section horizontally */
    padding: 60px 20px;
    /* Padding for top and sides */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content horizontally */
    justify-content: flex-start;
    box-sizing: border-box;
    /* Include padding and border in element's total width and height */
}

/* Skills Cards Container */
.skills-cards-container {
    display: grid;
    /* Use CSS Grid for layout */
    grid-template-columns: repeat(auto-fit, minmax(140px, 160px));
    gap: 15px;
    /* Gap between cards */
    width: 100%;
    /* Ensure it covers the container width */
    margin: auto 0;
    /* Center it with space above */
    justify-content: center;
}

/* Individual Card */
.skills-card {
    background-color: #1d1e20;
    /* Gray background */
    border-radius: 20px;
    /* Rounded corners */
    border: 1px solid #1d1e20;
    /* border */
    display: flex;
    flex-direction: column;
    /* Stack items vertically */
    justify-content: center;
    /* Center content vertically */
    align-items: center;
    /* Center content horizontally */
    text-align: center;
    /* Center text alignment */
    padding: 10px;
    /* Consistent padding inside cards */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Optional shadow for better look */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.35s ease;
    /* Smooth scaling transition */
    box-sizing: border-box;
    /* Include padding and border in element's total width and height */
    overflow: hidden;
}


.skills-card:hover {
    filter: brightness(1.15);
    border-color: #007f73;
    /* Add subtle lift and glow */
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 127, 115, 0.3);
    background: #22252a;
}

/* Image inside the Card */
.skills-card img {
    width: 3vw;
    /* Fixed width */
    height: 3vw;
    /* Fixed height */
    object-fit: contain;
    /* Ensures the image fits within the specified size */
    margin-bottom: 20px;
    /* Space below the image */
}


.skills-card:hover img {
    transform: scale(1.1);
}

.skills-card:hover .skills-card-text {
    transform: scale(1.02);
    line-height: 1.2;
    width: 100%;
    font-weight: 700;
    background: linear-gradient(90deg, #007f73, #007f73);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* Text inside the Card */
.skills-card-text {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    width: 100%;
    /* Full width of the card for consistent alignment */
    text-transform: uppercase;
    /* Make text uppercase */
    text-align: center;
    /* Center text alignment */
    margin-top: 0;
    /* No additional margin at the top */
    margin-bottom: 0;
    /* No additional margin at the bottom */
}

/* Animation for the card to slide in (only once when it first appears) */
.skills-card.animate {
    animation: slideInLeftToRight 1s ease-out forwards;
    opacity: 1;
    transform: translateY(0) scale(1);

}

/* Apply staggered delay for each card */
.skills-card:nth-child(1) {
    animation-delay: 0s;
    /* No delay for the first card */
}

.skills-card:nth-child(2) {
    animation-delay: 0.15s;
    /* Delay of 0.25s for the second card */
}

.skills-card:nth-child(3) {
    animation-delay: 0.3s;
    /* Delay of 0.5s for the third card */
}

.skills-card:nth-child(4) {
    animation-delay: 0.45s;
    /* No delay for the first card */
}

.skills-card:nth-child(5) {
    animation-delay: 0.6s;
    /* Delay of 0.25s for the second card */
}

.skills-card:nth-child(6) {
    animation-delay: 0.75s;
    /* Delay of 0.5s for the third card */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .skills-section {
        padding: 30px 20px;
        /* Adjust padding for smaller screens */
    }

    .skills-cards-container {
        grid-template-columns: repeat(2, 1fr);
        /* Two cards per row */
        grid-template-rows: auto;
        /* Adjust to automatic height */
    }

    .skills-card {
        width: 100%;
        /* Full width for cards */
        height: auto;
    }

    .skills-card img {
        width: 8vw;
        height: 8vw;
    }

    .skills-card-text {
        font-size: 3.5vw;
        /* Adjust font size for smaller screens */
    }

    .info-cards-container {
        flex-direction: column;
        /* Stack cards vertically for small screens */
        width: 100%;
        /* Full width for containers */
        gap: 10px;
        /* Adjust gap for smaller screens */
    }

    .info-card {
        width: 100%;
        /* Full width for cards */
        max-width: 100%;
        /* Ensure no horizontal overflow */
    }

    .info-card-title {
        font-size: 5vw;
    }

    .info-card-list li {
        font-size: 3.5vw;
    }
}

/* Very Small Devices Adjustments */
@media (max-width: 350px) {
    .skills-section {
        padding: 30px 20px;
        /* Adjust padding for smaller screens to match other sections */
    }

    .skills-cards-container {
        grid-template-columns: 1fr;
        /* One card per row for very small screens */
    }

    .skills-card {
        width: 100%;
        /* Full width for cards */
        height: auto;
        /* Adjust height to content */
    }

    .skills-card img {
        width: 10vw;
        height: 10vw;
    }

    .skills-card-text {
        font-size: 5vw;
        /* Adjust font size for smaller screens */
    }

    .info-cards-container {
        flex-direction: column;
        /* Stack cards vertically for small screens */
        width: 100%;
        /* Full width for containers */
        gap: 10px;
        /* Adjust gap for smaller screens */
    }

    .info-card {
        width: 100%;
        /* Full width for cards */
        max-width: 100%;
        /* Ensure no horizontal overflow */
    }

    .info-card-title,
    .info-card-list {
        font-size: 7vw;
        /* Adjust font size for smaller screens */
    }

    .info-card-list li {
        font-size: 5vw;
        /* Adjust font size for smaller screens */
    }
}


.skills-group {
    width: 100%;
    margin-top: 40px;
}

.skills-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    text-align: left;
}

/* Let each group's grid auto-fit rather than force 6 columns */
.skills-group .skills-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.skills-card:not(:has(img)) {
    justify-content: center;
    min-height: 80px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}


/* -------------------------------- Projects Section Styles -------------------------------- */
.projects-section {
    width: 100%;
    max-width: 1200px;
    /* Limit the section width to prevent overflow */
    margin: 0 auto;
    /* Center the section horizontally */
    padding: 60px 20px;
    /* Padding for top and sides */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content horizontally */
    justify-content: flex-start;
    box-sizing: border-box;
    /* Include padding and border in element's total width and height */
    text-align: center;
}

.projects-section {
    padding: 80px 20px;
}

.section-title {
    font-size: 32px;
    text-align: center;
    margin-bottom: 10px;
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: auto;
    margin-bottom: 40px;
    opacity: 0.8;
}


.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
    align-items: stretch;
    /* ← makes sure children stretch to same height */
}

.project-card {
    background: #111;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #ffffff10;
    position: relative;
    display: flex;
    /* ← important */
    flex-direction: column;
    /* ← stack image → content → buttons */
    height: 100%;
    /* ← makes all cards same height in grid */
    opacity: 0;
    animation: projectCardAppear 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-play-state: paused;
    transform: translateY(50px) scale(0.95);
    filter: blur(6px);
    transition: box-shadow 0.3s ease, border-color 0.3s ease, filter 0.3s ease;
}


/* Hover state — main magic happens here */
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 30px 5px rgba(0, 127, 115, 0.4);
    filter: brightness(1.15);
    border-color: #007f73;
}

/* Title */
.project-card:hover .project-content h3 {
    transform: translateY(-2px);
    transition: all 0.4s ease;
    font-size: 1.7rem;
    font-weight: 900;
    background: linear-gradient(90deg, #007f73, #007f73);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
}

/* Description text */
.project-card:hover .project-content>p {
    color: rgba(255, 255, 255, 0.95);
}

/* Tech tags */
.project-card:hover .tech-tags span {
    background: #007f7322;
    color: #007f73;
    border: 1px solid #007f7344;
    transform: scale(1.05);
}

/* Features list */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 18px auto 24px auto;
    /* centered + good vertical spacing */
    max-width: 90%;
    /* prevents it from touching edges on wide cards */
    width: fit-content;
    /* shrinks to content width when short */
    text-align: left;
    /* important: text inside stays left-aligned */
    flex-grow: 1;
    /* stretch to fill available card space so buttons align */
}

.feature-list li {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    /* key: icon aligns to top of text */
    gap: 10px;
    line-height: 1.5;
    /* better readability when wrapping */
}

/* The icon stays nicely aligned even on wrapped lines */
.feature-list li i {
    color: #00bfa5;
    font-size: 1rem;
    /* slightly bigger → more visible */
    margin-top: 4px;
    /* fine-tune vertical position */
    flex-shrink: 0;
    /* icon never shrinks */
    line-height: 1;
    /* prevents icon from being affected by text line-height */
}

/* Optional: subtle hover effect (only if you already have card hover) */
.project-card:hover .feature-list li {
    color: white;
}

.project-card:hover .feature-list i {
    color: #007f73;
    transform: scale(1.15);
    transition: all 0.2s ease;
}

/* Meta info */
.project-card:hover .project-meta {
    color: #007f73;
    opacity: 1;
}

/* Project Buttons */
.project-card:hover .project-links button {
    background: #007f73;
    border-color: #007f73;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 127, 115, 0.35);
}

.project-card:hover .project-links button:hover {
    background: #009688;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 150, 136, 0.45);
}

/* Optional: nice micro-animation on image */
.project-card:hover .project-image {
    transform: scale(1.06);
    transition: transform 0.45s ease;
}

/* Optional: subtle overlay gradient on hover */
.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 127, 115, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}


.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: top center;
    flex-shrink: 0;
    transition: transform 0.45s ease, object-position 0.45s ease;
}

@media (max-width: 768px) {
    .project-image {
        height: 220px;
        object-fit: contain;
        object-position: center;
    }

    .project-content h3 {
        background: none;
        -webkit-text-fill-color: white;
        color: white;
    }
}

@media (max-width: 480px) {
    .project-image {
        height: 200px;
        object-fit: contain;
        object-position: center;
    }
}

.project-meta span {
    transition: all 0.3s ease;
}

.project-card:hover .project-meta span {
    background-color: rgba(0, 127, 115, 0.15) !important;
    color: #e0fffa;
}

.project-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* ← allows content to take available space */
}

.project-content h3 {
    font-size: 1.7rem;
    font-weight: 900;
    background: linear-gradient(90deg, #ffffff, #e0e0e0);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
}

.project-content p {
    font-size: 1rem;
    margin-bottom: 12px;
}

.tech-tags {
    margin: 10px 0;
}

.tech-tags span {
    display: inline-block;
    background: #222;
    padding: 5px 10px;
    margin: 3px;
    border-radius: 6px;
    font-size: 12px;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.7;
    margin-top: 10px;
    margin-bottom: 10px;
}

.project-links {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    gap: 8px;
}

.project-links button {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: #2a2a2a;
    color: white;
    cursor: pointer;
}

.project-links .store-btn {
    min-width: unset;
    /* remove the 160px floor */
    width: 100%;
    /* stretch to fill */
    flex: 1;
    /* each button takes equal share of the row */
    justify-content: center;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    min-width: 160px;
}

.store-btn:hover {
    background: #007f73;
    transform: scale(1.02);
}

.store-btn:active {
    transform: scale(0.98);
}

.store-btn svg {
    flex-shrink: 0;
}

.store-btn .btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.store-btn .btn-label {
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    opacity: 0.85;
}

.store-btn .btn-store {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Live Demo button — slightly different background to stand out */
.store-btn.btn-demo {
    background: #222;
}

.store-btn.btn-demo:hover {
    background: #007f73;
}

/* Live Demo button — slightly different background to stand out */
.store-btn.btn-gallery {
    background: #222;
}

.store-btn.btn-gallery:hover {
    background: #007f73;
}


/* GALLERY OVERLAY - full-screen, body scroll disabled when open */
.gallery-overlay {
    position: fixed;
    inset: 0;
    /* Covers entire viewport */
    background: rgba(0, 0, 0, 0.98);
    z-index: 9999;
    /* Super high to stay on top */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px 20px;
    /* Top padding for close btn + bottom space */
    overflow: hidden;
    /* NO scroll on the overlay itself - we'll handle it in .gallery-grid */
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease forwards;
}

/* Main image area - fixed height, centered, NO scroll here */
.gallery-main {
    position: relative;
    width: 92%;
    max-width: 920px;
    height: 62vh;
    /* Fixed viewport-relative height for main image */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    flex-shrink: 0;
    /* Prevents shrinking */
}

/* The main image */
.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.hidden {
    display: none;
}

.gallery-content {
    position: relative;
    width: 90%;
    max-width: 850px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-content img {
    width: 100%;
    max-height: 65vh;
    /* important */
    object-fit: contain;
    border-radius: 12px;
}

/* Gallery arrows*/
.gallery-nav {
    position: fixed;
    /* Fixed = always on screen edges */
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;

    font-size: 28px;
    width: 58px;
    height: 58px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    /* Above everything */
}

.gallery-nav:hover {
    background: transparent;
    color: #007f73;
    transform: translateY(-50%) scale(1.08);
}

.gallery-nav.prev {
    left: 28px;
    /* Left edge of screen */
}

.gallery-nav.next {
    right: 28px;
    /* Right edge of screen */
}

.gallery-nav i {
    font-size: 22px;
    color: white;
}

/* Close button: Always visible + fixed (never moves on scroll) */
.close-btn {
    position: fixed;
    top: 24px;
    right: 32px;
    font-size: 42px;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.2s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    /* ← prevents clicking when hidden */
}

.close-btn:hover {
    color: #007f73;
    transform: scale(1.15);
    transform: rotate(90deg);
    /* Subtle animation */
}

.gallery-overlay:not(.hidden) .close-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Gallery grid: Independent vertical scroll (no double scrollbars) */
.gallery-grid {
    width: 92%;
    max-width: 92%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 12px;
    padding: 20px 0;
    overflow-y: auto;
    /* ONLY this scrolls */
    max-height: calc(100vh - 280px);
    /* Keeps it from overflowing screen */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Chrome scrollbar styling */
.gallery-grid::-webkit-scrollbar {
    width: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
}

.gallery-grid img {
    width: 100%;
    height: 78px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.gallery-grid img:hover {
    transform: scale(1.04);
    border-color: #007f73;
}

/* Scroll lock — applied via JS inline styles, no class needed */
/* These rules are now handled entirely in JS — remove modal-open, scroll-locked, no-scroll */
body[style*="position: fixed"] {
    overflow-y: scroll;
    /* prevent scrollbar jump on all browsers */
}

/* Make sure overlay takes full viewport even with locked body */
#galleryOverlay {
    position: fixed;
    /* Fixed to viewport, not affected by body scroll lock */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    /* High z-index to stay on top */
    /* Your existing overlay styles (background, etc.) */
}

/* Image container – needed for absolute badge positioning */
.project-image-container {
    position: relative;
    width: 100%;
}

@media (max-width: 768px) {
    .project-image-container {
        background: #b4b4b4;
    }

    .gallery-nav.prev {
        left: 2px;
    }

    .gallery-nav.next {
        right: 2px;
    }

    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 20px;
        background: transparent;
        border-radius: 0;
    }
}

/* Project type badge – kept as is, but refined colors per type */
.project-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(94, 234, 212, 0.2);
    background: #007f73;
    z-index: 2;
}

/* Staggered delays */
.project-card:nth-child(1) {
    animation-delay: 0s;
}

.project-card:nth-child(2) {
    animation-delay: 0.08s;
}

.project-card:nth-child(3) {
    animation-delay: 0.16s;
}

.project-card:nth-child(4) {
    animation-delay: 0.24s;
}

.project-card:nth-child(5) {
    animation-delay: 0.32s;
}

.project-card:nth-child(6) {
    animation-delay: 0.40s;
}

.project-card:nth-child(7) {
    animation-delay: 0.48s;
}

.project-card:nth-child(8) {
    animation-delay: 0.56s;
}

.project-card:nth-child(9) {
    animation-delay: 0.64s;
}


/* -------------------------------- Experience -------------------------------- */
.experience-timeline-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    text-align: center;
}

.timeline-container {
    width: 100%;
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: stretch;
    /* Makes cards in same row equal height */
}



.timeline-item {
    opacity: 0;
    transform: translateX(-50px) scale(0.95);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    /* Makes the item a flex container */
    flex-direction: column;
    /* Stacks content vertically */
}

/* Content card */
.timeline-content {
    background: #1d1e20;
    border-radius: 16px;
    padding: 24px;
    border-left: 4px solid #007f73;
    text-align: left;
    flex: 1;
    /* Makes content fill full height */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.timeline-item:hover .timeline-content::before {
    opacity: 1;
}

.timeline-item:hover .timeline-content {
    border-left-width: 6px;
    background: #22252a;
    transform: translateY(-12px) translateZ(20px);
    box-shadow: 0 20px 50px rgba(0, 127, 115, 0.3);
}

/* Header with badge and date */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-badge {
    padding: 5px 13px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.3s ease;
    color: white;
}

.timeline-item:hover .timeline-badge {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timeline-badge.freelance {
    background: #4caf4ff6;
}

.timeline-badge.internship {
    background: #ff9900f6;
}

.timeline-badge.personal {
    background: #9c27b0dd;
}

.timeline-badge.professional {
    background: #007f73f6;
}

.timeline-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Title and company */
.timeline-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-title {
    color: #00bfa5;
    transform: translateX(4px);
}

.timeline-company {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Description section with icon highlights */
.timeline-description {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-highlight {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.timeline-highlight i {
    color: #00bfa5;
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:hover .timeline-highlight i {
    color: #007f73;
    transform: scale(1.2) rotate(5deg);
}

.timeline-highlight div {
    flex: 1;
}

.timeline-highlight strong {
    display: block;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.timeline-item:hover .timeline-highlight strong {
    color: #00bfa5;
}

.timeline-highlight p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
    transition: color 0.3s ease;
}

.timeline-item:hover .timeline-highlight p {
    color: rgba(255, 255, 255, 0.95);
}

/* Slide in animation */
.timeline-item.animate {
    animation: slideUpFadeIn 0.6s ease forwards;
    opacity: 1;
    transform: translateX(0) scale(1);
}

.timeline-item:nth-child(1) {
    animation-delay: 0s;
    transition-delay: 0s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.15s;
    transition-delay: 0.15s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
    transition-delay: 0.3s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.45s;
    transition-delay: 0.45s;
}

.timeline-item:nth-child(odd) {
    transform: translateX(-50px) scale(0.95);
}

.timeline-item:nth-child(even) {
    transform: translateX(50px) scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .experience-timeline-section {
        max-width: 100%;
    }

    .timeline-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .timeline-content {
        padding: 18px;
    }

    .timeline-title {
        font-size: 1.3rem;
    }

    .timeline-highlight {
        gap: 12px;
    }

    .timeline-highlight i {
        font-size: 1.1rem;
    }

    .timeline-highlight strong {
        font-size: 0.9rem;
    }

    .timeline-highlight p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .timeline-content {
        padding: 16px;
        border-left-width: 3px;
    }

    .timeline-title {
        font-size: 1.2rem;
    }

    .timeline-badge {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    .timeline-date {
        font-size: 0.8rem;
    }
}

/* -------------------------------- Education -------------------------------- */
.education-section {
    width: 100%;
    max-width: 1200px;
    /* Changed from 800px to accommodate 3 columns */
    margin: 0 auto;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    text-align: center;
}

.education-container {
    width: 100%;
    margin-top: 40px;
    display: grid;
    /* Changed from flex */
    grid-template-columns: repeat(3, 1fr);
    /* 3 equal columns */
    gap: 20px;
    align-items: stretch;
    /* Equal height cards */
}

.education-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #1a1c20;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: start;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.education-card.animate {
    animation: slideUpFadeIn 0.6s ease forwards;
}

.education-card:nth-child(1) {
    animation-delay: 0s;
}

.education-card:nth-child(2) {
    animation-delay: 0.3s;
}

.education-card:nth-child(3) {
    animation-delay: 0.6s;
}

.education-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 127, 115, 0.15);
    background: #1d2025;
    border-color: rgba(0, 127, 115, 0.2);
}

/* Badge styling */
.education-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.education-badge.masters {
    background: rgba(0, 127, 115, 0.15);
    color: #00bfa5;
    border: 1px solid rgba(0, 127, 115, 0.3);
}

.education-badge.bachelors {
    background: rgba(33, 150, 243, 0.15);
    color: #42a5f5;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.education-badge.diploma {
    background: rgba(156, 39, 176, 0.15);
    color: #ab47bc;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.education-card:hover .education-badge {
    transform: scale(1.05);
}

.education-card:hover .education-badge.masters {
    background: rgba(0, 127, 115, 0.25);
    box-shadow: 0 4px 12px rgba(0, 127, 115, 0.2);
}

.education-card:hover .education-badge.bachelors {
    background: rgba(33, 150, 243, 0.25);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.education-card:hover .education-badge.diploma {
    background: rgba(156, 39, 176, 0.25);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.2);
}

/* Degree title */
.education-degree {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.education-card:hover .education-degree {
    color: #00bfa5;
}

/* School name */
.education-school {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.education-card:hover .education-school {
    color: rgba(255, 255, 255, 0.9);
}

/* Date */
.education-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 0;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .education-section {
        max-width: 100%;
        padding: 40px 20px;
    }

    /* Stack education cards as a single column on small screens */
    .education-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .education-card {
        padding: 24px 20px;
    }

    .education-degree {
        font-size: 1.3rem;
    }

    .education-school {
        font-size: 0.95rem;
    }

    .education-date {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .education-card {
        padding: 20px 16px;
    }

    .education-degree {
        font-size: 1.2rem;
    }

    .education-badge {
        font-size: 0.65rem;
        padding: 5px 12px;
    }

    .education-school {
        font-size: 0.9rem;
    }

    .education-date {
        font-size: 0.8rem;
    }
}


/* -------------------------------- Certifications Styling -------------------------------- */
/* General Section Styling */
.certifications-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: block !important;
    opacity: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    text-align: center;
}

/* Certificates Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    /* Increased gap for breathing room */
    width: 100%;
    margin-top: 40px;
    /* Space below title/description */
}

/* Certificate Card */
.certificate-card {
    background: #1d1e20;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    /* Subtle border */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* Better vertical distribution */
    position: relative;
    min-height: 320px;
    /* Indicate clickability for fullscreen */
    transition: all 0.3s ease;
    /* Smooth hover */
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    z-index: 1;
}

.certificate-card:hover {
    border-color: rgba(0, 127, 115, 0.3);
    /* Teal glow to match theme */
    box-shadow: 0 12px 32px rgba(0, 127, 115, 0.18);
    /* Elevated shadow */
    transform: translateY(-8px);
    /* Slight lift for engagement */
}

/* Certificate Badge (New: Adds color-coded category like in Education) */
.certificate-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    background: rgba(0, 127, 115, 0.3);
    /* Subtle teal, like other chips */
    margin-bottom: 8px;
}

.certificate-card:hover .certificate-badge {
    background: rgba(0, 127, 115, 0.4);
}

/* Customize badges for different types (add classes like .flutter, .google in HTML) */
.certificate-card.flutter .certificate-badge {
    background: rgba(33, 150, 243, 0.25);
    color: #2196f3;
}

/* Blue for Flutter/Google */
.certificate-card.aws .certificate-badge {
    background: rgba(255, 152, 0, 0.25);
    color: #ff9800;
}

/* Certificate Header (Title and Giver) */
.certificate-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    /* Space for badge */
    margin-bottom: 16px;
}

.certificate-title {
    font-size: 1.35rem;
    /* Slightly larger for emphasis */
    font-weight: 800;
    color: white;
    margin: 4px 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.certificate-card:hover .certificate-title {
    color: #00bfa5;
    /* Teal accent on hover */
}

.certificate-giver {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 2px 0;
}

.certificate-card:hover .certificate-giver {
    color: rgba(255, 255, 255, 0.9);
}

/* New: Certificate Date (Add this for recruiter appeal) */
.certificate-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Category colors */
.certificate-badge.design {
    background: rgba(33, 150, 243, 0.3);
}

/* Blue */
.certificate-badge.leadership {
    background: rgba(156, 39, 176, 0.3);
}

/* Purple */
.certificate-badge.communication {
    background: rgba(255, 152, 0, 0.3);
}

/* Orange */
.certificate-badge.soft-skills {
    background: rgba(76, 175, 79, 0.3);
}

/* Certificate Preview Image */
.certificate-preview {
    position: relative;
    height: auto;
    max-height: 150px;
    /* Limit height to fit card */
    object-fit: contain;
    /* Preserve aspect ratio */
    margin-top: auto;
    /* Push to bottom */
    /* Make the preview image look clickable */
    transition: all 0.25s ease;
    border: 2px solid transparent;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.clickable-preview:hover {
    transform: scale(1.04);
    border-color: #007f73;
    /* your theme teal */
    box-shadow: 0 6px 20px rgba(0, 127, 115, 0.25);
}

.clickable-preview:active {
    transform: scale(0.98);
}

.clickable-preview::after {
    content: "View full certificate";
    position: absolute;
    inset: 0;
    background: rgba(0, 127, 115, 0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 8px;
    pointer-events: none;
}

.clickable-preview:hover::after {
    opacity: 1;
}

.certificate-card:hover .certificate-preview {
    transform: scale(1.05);
    /* Subtle zoom on hover */
    cursor: pointer;
}

/* New: View Button/Icon (Appears on hover for interactivity) */
.view-certificate-btn {
    opacity: 0;
    margin-top: auto;
    /* Push to bottom */
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.certificate-card:hover .view-certificate-btn {
    opacity: 1;
}

.view-certificate-btn:hover {
    background: #007f73;
    border-color: #007f73;
}


.certificate-card.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .certificates-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .certificate-card {
        padding: 24px;
        min-height: 280px;
    }

    .certificate-title {
        font-size: 1.2rem;
    }

    .certificate-preview {
        max-height: 130px;
    }
}

/* -------------------------------- Footer (Contact Me) Styling -------------------------------- */
.contact-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    text-align: center;
    height: 100%;
}

.contact-container {
    width: 100%;
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: stretch;
    /* ← This makes them equal height */
}

.contact-form-wrapper,
.contact-info-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-form,
.contact-info-card {
    flex: 1;
    /* ← Makes them fill available height */
}

/* Form Wrapper */
.contact-form-wrapper {
    opacity: 0;
    transform: translateY(20px);
}

.contact-form-wrapper.animate {
    animation: slideUpFadeIn 0.6s ease forwards;
}

.contact-form {
    background: #1d1e20;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-form:hover {
    border-color: rgba(0, 127, 115, 0.2);
    box-shadow: 0 8px 24px rgba(0, 127, 115, 0.1);
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #0f1012;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007f73;
    background: #141618;
    box-shadow: 0 0 0 3px rgba(0, 127, 115, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    cursor: pointer;
    padding: 12px 40px 12px 16px;
    /* top right bottom left */
    appearance: none;
    /* Hide default arrow */
    -webkit-appearance: none;
    /* For WebKit browsers */
    -moz-appearance: none;
    /* For Firefox */
    padding-right: 35px;
    /* Add desired space for the custom arrow */
    background-image: url('images/chevron-down.svg');
    /* Custom arrow image */
    background-repeat: no-repeat;
    background-position: right 10px center;
    /* Position the custom arrow with a 10px right gap */
    background-size: 20px;
    /* Adjust size as needed */
}

.form-group select:focus {
    appearance: none;
    /* Hide default arrow */
    -webkit-appearance: none;
    /* For WebKit browsers */
    -moz-appearance: none;
    /* For Firefox */
    padding-right: 35px;
    /* Add desired space for the custom arrow */
    background-image: url('images/chevron-down-focus.svg');
    /* Custom arrow image */
    background-repeat: no-repeat;
    background-position: right 10px center;
    /* Position the custom arrow with a 10px right gap */
    background-size: 20px;
    /* Adjust size as needed */
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: #007f73;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    /* Pushes button to bottom */
}

/* Add spacing above button if form fields don't fill space */
.form-group:last-of-type {
    margin-bottom: auto;
    /* Pushes button down if there's extra space */
}


.btn-submit:hover {
    background: #009688;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 127, 115, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit i {
    font-size: 1rem;
}

/* Form Status Messages */
.form-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    display: none;
}

.form-status.success {
    background: rgba(76, 175, 79, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 79, 0.3);
    display: block;
}

.form-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
    display: block;
}

/* Contact Info Wrapper */
.contact-info-wrapper {
    opacity: 0;
    transform: translateY(20px);
}

.contact-info-wrapper.animate {
    animation: slideUpFadeIn 0.6s ease 0.15s forwards;
}

.contact-info-card {
    background: #1d1e20;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.contact-info-card:hover {
    border-color: rgba(0, 127, 115, 0.2);
    box-shadow: 0 8px 24px rgba(0, 127, 115, 0.1);
}

.contact-info-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    text-align: left;
}

.contact-intro {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: left;
}

/* Contact Methods */
.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #0f1012;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-method:hover {
    background: #141618;
    border-color: rgba(0, 127, 115, 0.3);
    transform: translateX(4px);
}

.contact-method i {
    font-size: 1.5rem;
    color: #00bfa5;
    transition: all 0.3s ease;
}

.contact-method:hover i {
    color: #007f73;
    transform: scale(1.1);
}

/* Keep phone number always LTR (numbers read same in both directions) */
#phone-display {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

.contact-method div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.contact-method strong {
    font-size: 0.95rem;
    color: white;
    font-weight: 600;
}

.contact-method span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Availability Badge */
.availability-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(76, 175, 79, 0.1);
    border: 1px solid rgba(76, 175, 79, 0.3);
    border-radius: 10px;
    margin-top: auto;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.availability-badge span {
    font-size: 0.85rem;
    color: #4caf50;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 968px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .contact-form,
    .contact-info-card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 40px 20px 60px;
    }

    .contact-form,
    .contact-info-card {
        padding: 20px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .btn-submit {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .contact-info-card h3 {
        font-size: 1.3rem;
    }
}


/* -------------------------------- Scroll to Top Button Styling -------------------------------- */
/* Styles specifically for  */
#back-to-top {
    position: fixed;
    bottom: 40px;
    right: 20px;
    width: 45px;
    height: 45px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* -------------------------------- Image Modal Styles -------------------------------- */
.image-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    /* Above everything, including sidebar/gallery */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: black;
    padding-top: 60px;
    /* Space for close button */
    padding-bottom: 20px;
    /* Extra space */
    z-index: 9999;
}


.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 80vw;
    /* Limit size for large images */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: zoomIn 0.6s;
    align-self: center;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    transition: color 0.3s ease;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #007f73;
    transform: rotate(90deg);
}

/* Chrome scrollbar styling */
.image-modal::-webkit-scrollbar {
    width: 8px;
}

.image-modal::-webkit-scrollbar-track {
    background: transparent;
}

.image-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
    }

    .modal-close {
        font-size: 30px;
        top: 15px;
        right: 25px;
    }
}

/* -------------------------------- Animation -------------------------------- */
.animated-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animated-element.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideInLeftToRight {
    0% {
        transform: translateX(-50px);
        /* Start from the left */
        opacity: 0;
        /* Initially hidden */
    }

    100% {
        transform: translateX(0);
        /* End at the normal position */
        opacity: 1;
        /* Fully visible */
    }
}

@keyframes slideRightToleft {
    0% {
        transform: translateX(100%);
        /* Start off-screen to the right */
        opacity: 0;
        /* Start invisible */
    }

    100% {
        transform: translateX(0);
        /* Slide into its normal position */
        opacity: 1;
        /* Fully visible */
    }
}

/* Keyframes for Animation */
@keyframes slideLeftToRightAboutMe {
    0% {
        opacity: 0;
        /* Completely transparent */
        transform: translateX(-300px);
        /* Initial position and rotation */
    }

    100% {
        opacity: 1;
        /* Fully visible */
        transform: translateX(0px);
        /* Final position and rotation */
    }
}

/* Keyframes for Right Column Animation */
@keyframes rotateRightToLeft {
    0% {
        opacity: 0;
        /* Completely transparent */
        transform: translateX(300px) scale(1) rotate(360deg);
        /* Start with two full rotations */
    }

    100% {
        opacity: 1;
        /* Fully visible */
        transform: translateX(0px) scale(1) rotate(0deg);
        /* Final position with no rotation */
    }
}

/* Animation for zoom and fade-in */
@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
        /* Start with zoom level of 30% */
    }

    100% {
        opacity: 1;
        /* Fully visible */
        transform: scale(1);
        /* End at full size */
    }
}

/* Text Zoom-Out Animation */
@keyframes zoomOut {
    0% {
        transform: scale(1.3);
        /* Start with a zoom-in effect */
        opacity: 0;
        /* Initially hidden */
    }

    100% {
        transform: scale(1);
        /* End with normal size */
        opacity: 1;
        /* Fully visible */
    }
}

/* Text Zoom-Out Animation */
@keyframes goBackToDefault {
    0% {
        transform: scale(1.1);
        /* Start with a zoom-in effect */
        opacity: 1;
        /* Initially hidden */
    }

    100% {
        transform: scale(1);
        /* End with normal size */
        opacity: 1;
        /* Fully visible */
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0deg);
        /* Start facing front */
        opacity: 0;
        /* Start invisible */
    }

    100% {
        transform: rotateX(360deg);
        /* End facing front */
        opacity: 1;
        /* Fully visible */
    }
}

@keyframes fadeInOut {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(76, 175, 79, 0.7);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(76, 175, 79, 0);
    }
}

@keyframes slideUpFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes projectCardAppear {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
        filter: blur(6px);
    }

    60% {
        opacity: 1;
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes slideUpFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


.animate-on-scroll,
.animated-element,
.timeline-item,
.project-card,
.certificate-card,
.education-card {
    will-change: transform, opacity;
}

/* Once animation is done, release the GPU layer to free memory */
.animate-on-scroll.active,
.animated-element.animate {
    will-change: auto;
}