/* ===== CSS Variables ===== */
:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --text-color: #2d2d2d;
    --text-light: #6b7280;
    --bg-color: #fff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --transition: all 0.25s ease;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

[data-theme="dark"] {
    --primary-color: #e0e0e0;
    --secondary-color: #b0b0b0;
    --text-color: #f1f5f9;
    --text-light: #94a3b8;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.35);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Fix for mobile browser address bar height */
    height: -webkit-fill-available;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Container ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Section Styles ===== */
section {
    padding: 50px 0;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 35px;
    color: var(--text-color);
}

/* ===== Hero Section ===== */
.hero {
    padding: 70px 0 40px;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.hero-text h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wave-emoji {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(-4deg); }
    50%, 70% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    80% { transform: rotate(-5deg); }
}

.hero-text .subtitle {
    font-size: 1.05rem;
    color: var(--text-light);
    font-style: italic;
    max-width: 420px;
    line-height: 1.6;
}

.profile-image {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--bg-color);
}

/* ===== About Section ===== */
.about {
    padding: 30px 0;
}

.about h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.about p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

.about strong {
    color: var(--text-color);
    font-weight: 600;
}

/* ===== Work Experience Section ===== */
.experience {
    padding: 40px 0;
}

.experience h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.experience-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.company-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-secondary);
    padding: 6px;
    flex-shrink: 0;
}

.experience-details {
    flex: 1;
}

.experience-details h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.experience-details .role {
    font-size: 0.82rem;
    color: var(--text-light);
}

.experience-details .location {
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-top: 2px;
}

.experience-date {
    font-size: 0.82rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Clickable company/education links */
.company-link,
.education-link {
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.company-link:hover,
.education-link:hover {
    transform: scale(1.05);
}

.experience-details h3 a,
.education-details h3 a {
    color: var(--text-color);
    transition: var(--transition);
}

.experience-details h3 a:hover,
.education-details h3 a:hover {
    color: #6366f1;
}

/* ===== Education Section ===== */
.education {
    padding: 40px 0;
}

.education h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.education-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.education-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-secondary);
    padding: 6px;
    flex-shrink: 0;
}

.education-details {
    flex: 1;
}

.education-details h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.education-details .degree {
    font-size: 0.82rem;
    color: var(--text-light);
}

.education-date {
    font-size: 0.82rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* ===== Projects Section ===== */
.projects {
    padding: 50px 0;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.project-content {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.project-info {
    flex: 1;
}

.project-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 14px;
    line-height: 1.6;
    font-size: 0.88rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
}

.project-link:hover {
    background: var(--bg-secondary);
}

.project-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-image {
    flex: 1;
    max-width: 320px;
    height: 180px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* ===== Skills Section ===== */
.skills {
    padding: 50px 0;
}

.skills-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background: var(--bg-secondary);
}

.tab-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 10px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

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

.skill-card span {
    font-size: 0.78rem;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.skill-card img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.skills-content {
    display: none;
}

.skills-content.active {
    display: block;
}

/* ===== Contact Section ===== */
.contact {
    padding: 50px 0 120px;
    text-align: center;
}

.contact p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.contact a {
    color: var(--text-color);
    text-decoration: underline;
}

.contact-form {
    max-width: 440px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

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

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ===== Floating Navigation ===== */
.floating-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
    list-style: none;
}

.nav-links a,
.nav-links button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--bg-color);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-links svg {
    width: 18px;
    height: 18px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    section {
        padding: 35px 0;
    }

    .hero {
        padding: 50px 0 30px;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text h1 {
        justify-content: center;
        font-size: 1.8rem;
    }

    .hero-text .subtitle {
        font-size: 0.95rem;
        max-width: 100%;
    }

    .profile-image {
        width: 110px;
        height: 110px;
    }

    .project-content {
        flex-direction: column-reverse;
        padding: 14px;
        gap: 14px;
    }

    .project-image {
        max-width: 100%;
        height: 200px;
    }

    .project-image img {
        border-radius: var(--radius-md);
    }

    .project-info h3 {
        font-size: 1rem;
    }

    .project-info p {
        font-size: 0.84rem;
    }

    .project-link {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .project-links-row {
        gap: 6px;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .skill-card {
        padding: 12px 6px;
    }

    .skill-card span {
        font-size: 0.72rem;
    }

    .skill-card img {
        width: 30px;
        height: 30px;
    }

    .experience-item,
    .education-item {
        flex-wrap: wrap;
    }

    .experience-date,
    .education-date {
        width: 100%;
        margin-left: 58px;
        margin-top: -3px;
        font-size: 0.78rem;
    }

    .section-title {
        font-size: 1.35rem;
        margin-bottom: 25px;
    }

    .contact {
        padding: 40px 0 100px;
    }

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

    .floating-nav {
        bottom: 10px;
        padding: 8px 14px;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-links a,
    .nav-links button {
        width: 30px;
        height: 30px;
    }

    .nav-links svg {
        width: 16px;
        height: 16px;
    }

    .lang-btn {
        padding: 4px 8px;
        font-size: 0.68rem;
    }
}

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

    .hero-text .subtitle {
        font-size: 0.88rem;
    }

    .profile-image {
        width: 95px;
        height: 95px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-tabs {
        gap: 4px;
    }

    .tab-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .project-image {
        height: 180px;
    }

    .about p {
        font-size: 0.88rem;
    }

    .floating-nav {
        padding: 7px 10px;
    }

    .nav-links {
        gap: 6px;
    }

    .nav-links a,
    .nav-links button {
        width: 28px;
        height: 28px;
    }

    .nav-links svg {
        width: 14px;
        height: 14px;
    }

    .lang-btn {
        padding: 3px 6px;
        font-size: 0.65rem;
    }

    .footer-link {
        font-size: 0.85rem;
        padding: 6px 8px;
    }
}

/* ===== Project Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95) translateY(15px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.modal.modal-large {
    max-width: 1100px;
    max-height: 90vh;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--border-color);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 16px;
    height: 16px;
    color: var(--text-color);
}

/* Modal Layout - Side by Side */
.modal-layout {
    display: flex;
    flex-direction: row-reverse;
    gap: 0;
    min-height: 500px;
}

/* Image Gallery Section */
.modal-gallery {
    flex: 1;
    min-width: 0;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    overflow: hidden;
}

/* Gallery Tabs */
.gallery-tabs {
    display: flex;
    gap: 0;
    padding: 12px 12px 0 12px;
    background: var(--bg-secondary);
}

.gallery-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 2px solid transparent;
}

.gallery-tab:hover {
    color: var(--text-color);
    background: rgba(0,0,0,0.05);
}

.gallery-tab.active {
    color: var(--text-color);
    background: var(--bg-color);
    border-bottom-color: var(--text-color);
}

/* Gallery Main Image */
.gallery-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 350px;
    background: var(--bg-color);
    touch-action: pan-y pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
}

.gallery-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

/* Mobile app images styling */
.gallery-main-image.mobile-image {
    max-height: 400px;
    max-width: 220px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 5;
}

.gallery-nav:hover {
    transform: translateY(-50%) scale(1.1);
    background: var(--bg-secondary);
}

.gallery-nav svg {
    width: 20px;
    height: 20px;
    color: var(--text-color);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

/* Gallery Counter */
.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Gallery Thumbnails */
.gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 14px 16px 18px 16px;
    background: var(--bg-secondary);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--text-light) transparent;
    scroll-behavior: smooth;
    position: relative;
}

/* Custom scrollbar styling */
.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 10px;
    margin: 0 16px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}

/* Scroll indicators - fade effect on edges */
.gallery-thumbnails::before,
.gallery-thumbnails::after {
    content: '';
    position: sticky;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 2;
    flex-shrink: 0;
}

.gallery-thumbnails::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-secondary) 0%, transparent 100%);
    margin-right: -30px;
}

.gallery-thumbnails::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-secondary) 0%, transparent 100%);
    margin-left: -30px;
}

.gallery-thumbnail {
    flex-shrink: 0;
    width: 70px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    opacity: 0.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gallery-thumbnail:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.gallery-thumbnail.active {
    border-color: var(--text-color);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Mobile thumbnail styling */
.gallery-thumbnail.mobile-thumb {
    width: 35px;
    height: 55px;
    border-radius: 6px;
}

/* Video thumbnail styling */
.gallery-thumbnail.video-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.gallery-thumbnail.video-thumb svg {
    width: 20px;
    height: 20px;
}

.gallery-thumbnail.video-thumb.mobile-thumb {
    width: 35px;
    height: 55px;
}

/* Video in gallery */
.gallery-main-video {
    width: 100%;
    max-height: 400px;
    border-radius: var(--radius-lg);
    background: #000;
}

.gallery-main-video.mobile-image {
    max-width: 220px;
    max-height: 400px;
    margin: 0 auto;
    display: block;
}

.modal-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-content {
    flex: 1;
    min-width: 0;
    padding: 24px;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-color);
    padding-right: 30px;
}

.modal-content > p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.modal-section {
    margin-bottom: 18px;
}

.modal-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.modal-features {
    list-style: none;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
}

.modal-features li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.85rem;
}

.modal-features li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-color);
    font-weight: bold;
}

.modal-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-color);
    font-weight: 500;
}

.tech-badge img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.modal-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex-direction: column;
}

.modal-link-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-color);
    width: fit-content;
}

.modal-link:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    border-color: var(--accent-color);
}

.modal-link svg {
    width: 18px;
    height: 18px;
}

.link-credentials {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: 28px;
    font-family: 'Courier New', monospace;
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    width: fit-content;
}

/* Modal scrollbar styling */
.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--border-color) 0%, var(--text-light) 100%);
    border-radius: 4px;
    border: 2px solid var(--bg-secondary);
}

.modal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--text-light) 0%, var(--text-color) 100%);
}

/* Modal content scrollbar */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Features list scrollbar */
.modal-features::-webkit-scrollbar {
    width: 4px;
}

.modal-features::-webkit-scrollbar-track {
    background: transparent;
}

.modal-features::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* ===== Lightbox - Full Screen Image Viewer ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

/* Mobile image in lightbox */
.lightbox-image.mobile-lightbox {
    max-height: 85vh;
    max-width: 400px;
    border-radius: 24px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

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

.lightbox-close svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 5;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.lightbox-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-align: center;
}

/* Click hint on gallery image */
.gallery-main-image {
    cursor: zoom-in;
}

@media (max-width: 768px) {
    .lightbox-image {
        max-height: 80vh;
        border-radius: var(--radius-sm);
    }

    .lightbox-image.mobile-lightbox {
        max-height: 75vh;
        max-width: 80vw;
        border-radius: 16px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox-prev {
        left: 6px;
    }
    
    .lightbox-next {
        right: 6px;
    }
    
    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }
    
    .lightbox-close svg {
        width: 18px;
        height: 18px;
    }

    .lightbox-counter {
        bottom: 20px;
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .lightbox-hint {
        bottom: 55px;
        font-size: 0.72rem;
    }
}

/* Body scroll lock when lightbox is open */
body.lightbox-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-height: 95vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .modal.modal-large {
        max-height: 95vh;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .modal-layout {
        flex-direction: column;
        min-height: auto;
    }

    /* Gallery stays at top, not scrollable independently */
    .modal-gallery {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: none;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .gallery-tabs {
        padding: 8px 8px 0 8px;
    }

    .gallery-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .gallery-main {
        min-height: 220px;
        max-height: 40vh;
        padding: 10px;
    }

    .gallery-main-image {
        border-radius: var(--radius-sm);
    }

    .gallery-main-image.mobile-image {
        max-height: 35vh;
        max-width: 170px;
        border-radius: 14px;
    }

    .gallery-nav {
        width: 34px;
        height: 34px;
    }

    .gallery-nav svg {
        width: 16px;
        height: 16px;
    }

    .gallery-prev {
        left: 4px;
    }

    .gallery-next {
        right: 4px;
    }

    .gallery-counter {
        bottom: 8px;
        padding: 4px 10px;
        font-size: 0.72rem;
    }

    .gallery-thumbnails {
        padding: 8px 10px 10px 10px;
        gap: 6px;
    }

    .gallery-thumbnail {
        width: 50px;
        height: 38px;
    }

    .gallery-thumbnail.mobile-thumb {
        width: 28px;
        height: 42px;
    }

    .modal-image {
        height: 140px;
    }

    /* Content flows below gallery - all scrollable together */
    .modal-content {
        padding: 16px 16px 30px;
        max-height: none;
        overflow-y: visible;
        flex-shrink: 0;
    }

    .modal-content h2 {
        font-size: 1.1rem;
        padding-right: 25px;
    }

    .modal-content > p {
        font-size: 0.84rem;
        line-height: 1.6;
        margin-bottom: 14px;
    }

    .modal-section {
        margin-bottom: 16px;
    }

    .modal-section h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .modal-features {
        max-height: none;
        overflow-y: visible;
    }

    .modal-features li {
        font-size: 0.82rem;
        margin-bottom: 5px;
    }

    .tech-badge {
        padding: 5px 10px;
        font-size: 0.75rem;
        gap: 4px;
    }

    .tech-badge img {
        width: 14px;
        height: 14px;
    }

    .modal-links {
        gap: 8px;
    }

    .modal-link {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .modal-link svg {
        width: 16px;
        height: 16px;
    }

    .link-credentials {
        font-size: 0.7rem;
        margin-left: 0;
        padding: 3px 8px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        background: rgba(0, 0, 0, 0.5);
        z-index: 20;
        position: sticky;
        float: right;
        margin-top: -42px;
        margin-right: 10px;
        margin-bottom: 0;
    }

    .modal-close svg {
        color: #fff;
        width: 14px;
        height: 14px;
    }

    .modal-close:hover {
        background: rgba(0, 0, 0, 0.7);
    }

    /* Video in gallery mobile */
    .gallery-main-video {
        max-height: 35vh;
    }

    .gallery-main-video.mobile-image {
        max-width: 170px;
        max-height: 35vh;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0;
    }

    .modal.modal-large {
        max-height: 95vh;
    }

    .gallery-main {
        min-height: 180px;
        max-height: 35vh;
    }

    .gallery-main-image.mobile-image {
        max-height: 30vh;
        max-width: 140px;
    }

    .gallery-thumbnail {
        width: 42px;
        height: 32px;
    }

    .gallery-thumbnail.mobile-thumb {
        width: 22px;
        height: 36px;
    }

    .modal-content {
        padding: 14px 14px 24px;
    }

    .modal-content h2 {
        font-size: 1rem;
    }

    .modal-content > p {
        font-size: 0.8rem;
    }

    .modal-features li {
        font-size: 0.78rem;
    }

    .tech-badge {
        padding: 4px 8px;
        font-size: 0.72rem;
    }
}

/* ===== Language Toggle Button ===== */
.lang-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', 'Inter', sans-serif;
}

.lang-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-light);
}

/* ===== RTL Support for Arabic ===== */
[dir="rtl"] body {
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[dir="rtl"] .hero-content {
    flex-direction: row-reverse;
}

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

[dir="rtl"] .hero-text h1 {
    justify-content: flex-end;
}

[dir="rtl"] .about-content {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .experience-item,
[dir="rtl"] .education-item {
    text-align: right;
}

[dir="rtl"] .experience-info,
[dir="rtl"] .education-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .experience-header,
[dir="rtl"] .education-header {
    flex-direction: row-reverse;
}

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

[dir="rtl"] .skill-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .contact-form {
    direction: rtl;
}

[dir="rtl"] .contact-form input,
[dir="rtl"] .contact-form textarea {
    text-align: right;
}

[dir="rtl"] .modal-content {
    text-align: right;
}

[dir="rtl"] .modal-layout {
    flex-direction: row;
}

[dir="rtl"] .modal-gallery {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

[dir="rtl"] .modal-features li {
    padding-left: 0;
    padding-right: 16px;
}

[dir="rtl"] .modal-features li::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .modal-close {
    right: auto;
    left: 12px;
}

[dir="rtl"] .modal-content h2 {
    padding-right: 0;
    padding-left: 30px;
}

[dir="rtl"] .link-credentials {
    margin-left: 0;
    margin-right: 28px;
}

[dir="rtl"] .gallery-prev {
    left: auto;
    right: 10px;
}

[dir="rtl"] .gallery-next {
    right: auto;
    left: 10px;
}

[dir="rtl"] .floating-nav {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* RTL mobile overrides */
@media (max-width: 768px) {
    [dir="rtl"] .hero-content {
        flex-direction: column-reverse;
    }

    [dir="rtl"] .experience-date,
    [dir="rtl"] .education-date {
        margin-left: 0;
        margin-right: 58px;
    }

    [dir="rtl"] .modal-layout {
        flex-direction: column;
    }

    [dir="rtl"] .modal-gallery {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    [dir="rtl"] .modal-close {
        left: 10px;
        right: auto;
        float: left;
        margin-left: 10px;
        margin-right: 0;
    }

    [dir="rtl"] .modal-content h2 {
        padding-left: 25px;
        padding-right: 0;
    }
}

/* ===== Footer ===== */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.footer-link:hover {
    color: var(--text-color);
    background-color: var(--bg-color);
    transform: translateY(-2px);
}

.footer-link svg {
    flex-shrink: 0;
}

.footer-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-text p {
    margin: 0;
}

/* Footer RTL Support */
[dir="rtl"] .footer-link {
    flex-direction: row-reverse;
}

/* Footer Mobile Responsive */
@media (max-width: 768px) {
    .footer {
        padding: 25px 0 80px;
        margin-top: 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-link {
        width: 100%;
        justify-content: center;
        max-width: 280px;
        font-size: 0.88rem;
    }

    .footer-text {
        font-size: 0.82rem;
    }
}
