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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Urbanist', sans-serif;
    line-height: 1.6;
    color: #2D3748;
    background-color: #F7FAFC;
    overflow-x: hidden;
    padding-top: 70px; /* Account for fixed navbar */
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #2D3748;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #9CA3AF;
    background: rgba(156, 163, 175, 0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #A5A8B0;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

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

/* Hero Section */
.hero {
        height: 100vh;
        background-image: url('image4.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.1s ease-out;
        /* Fallback for mobile browsers that don't support background-attachment: fixed */
        -webkit-background-attachment: scroll;
        background-attachment: fixed;
}

@media (max-width: 768px) {
    .hero {
        background-attachment: scroll !important;
        -webkit-background-attachment: scroll !important;
        /* Optional: add a solid color overlay for better text contrast on mobile */
    }
}

/* Optional: Add a ::before overlay for better contrast and performance */
.hero::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.25);
        z-index: 1;
        pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
    backdrop-filter: blur(1px);
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
    animation: fadeInUp 1s ease-out;
}

.name-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2rem 3rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.name-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: #ffffff;
    position: relative;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-title {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 400;
    color: #e2e8f0;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 300;
    color: #f7fafc;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border: 2px solid #ffffff;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg);
    opacity: 0.8;
}

/* Projects Section */
.projects {
    padding: 5rem 0;
    min-height: 100vh;
    background: linear-gradient(to bottom, #f8fafc 0%, #edf2f7 100%);
    position: relative;
}

.projects-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(26, 32, 44, 0.1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a202c;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    z-index: 10;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-arrow:active {
    transform: scale(0.95);
}

.nav-arrow-left {
    margin-right: 0.5rem;
}

.nav-arrow-right {
    margin-left: 0.5rem;
}

.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(26, 32, 44, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dot.active {
    background: #1a202c;
    transform: scale(1.2);
}

.pagination-dot:hover {
    background: #1a202c;
    transform: scale(1.1);
}

/* About Section */
.about {
    padding: 5rem 0;
    background: linear-gradient(to bottom, #edf2f7 0%, #e2e8f0 100%);
    background-attachment: fixed;
    position: relative;
    z-index: 10;
    transition: transform 0.1s ease-out;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    text-align: center;
}

.about-text p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #2d3748;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.social-icon {
    color: #4D2C59;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.social-icon:hover {
    color: #8C6BA1;
    transform: translateY(-3px);
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: 3rem;
    color: #1a202c;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.projects-grid {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    flex: 1;
}

.projects-grid::-webkit-scrollbar {
    display: none;
}

.projects-grid::-webkit-scrollbar {
    height: 8px;
}

.projects-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.projects-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.projects-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Project Tiles */
.project-tile {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08), 0 10px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: calc((100% - 4rem) / 3);
    min-width: calc((100% - 4rem) / 3);
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
}

.project-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 16px 40px rgba(0, 0, 0, 0.1);
}

.project-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4D2C59 0%, #F2E6F5 50%, #2D1B36 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project-tile:hover::before {
    transform: scaleX(1);
}

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #48BB78, #68D391);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
    /* Improve rendering performance */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: auto;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)" /></svg>');
}

.project-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.project-link {
    color: #4D2C59;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.project-link:hover {
    color: #5D3C69;
    border-bottom-color: #4D2C59;
}

.project-link.secondary {
    color: #4D2C59;
}

.project-link.secondary:hover {
    color: #5D3C69;
    border-bottom-color: #4D2C59;
}

.project-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #E5E7EB, transparent);
    margin: 1rem 0;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1a202c;
}

.project-description {
    color: #2d3748;
    margin-bottom: 0;
    line-height: 1.5;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0;
    flex-shrink: 0;
    justify-content: center;
}

.tag {
    background: #9CA3AF;
    color: #F9FAFB;
    padding: 0.2rem 0.6rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(156, 163, 175, 0.3);
}









/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.close {
    color: #aaa;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.2s ease;
}

.close:hover {
    color: #2D3748;
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2D3748;
}

.modal-description {
    color: #4A5568;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.modal-tech {
    margin-bottom: 2rem;
}

.modal-tech h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2D3748;
}

.modal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-links-top {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    color: #1a202c;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-link:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-link.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-link.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-link-top {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #4D2C59;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(77, 44, 89, 0.3);
}

.modal-link-top:hover {
    background: #5D3C69;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 44, 89, 0.3);
}

.modal-link-top.secondary {
    background: rgba(77, 44, 89, 0.2);
    color: #4D2C59;
    border: 1px solid rgba(77, 44, 89, 0.4);
}

.modal-link-top.secondary:hover {
    background: rgba(77, 44, 89, 0.3);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .project-tile {
        width: calc((100% - 3rem) / 2.5);
        min-width: calc((100% - 3rem) / 2.5);
    }
}

@media (max-width: 768px) {
    .navbar {
        height: 60px;
    }
    
    body {
        padding-top: 60px;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .hero {
        padding: 2rem;
        background-attachment: scroll; /* Fix parallax issues on mobile */
    }
    
    .name-box {
        padding: 1.5rem 2rem;
        margin-bottom: 1.5rem;
    }
    
    .projects {
        padding: 3rem 0;
    }
    
    .projects-container {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .nav-arrow {
        display: flex;
        width: 40px;
        height: 40px;
        position: relative;
        z-index: 20;
    }
    
    .pagination-dots {
        display: flex;
        margin-top: 1.5rem;
    }
    
    .projects-grid {
        flex-direction: row;
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        gap: 0;
        padding: 1rem 0;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scrollbar-width: none; /* Hide scrollbar on Firefox */
        -ms-overflow-style: none; /* Hide scrollbar on IE/Edge */
    }
    
    .projects-grid::-webkit-scrollbar {
        display: none; /* Hide scrollbar on WebKit browsers */
    }
    
    .project-tile {
        padding: 1.5rem;
        min-width: calc(100vw - 140px); /* Full width minus arrows and padding */
        width: calc(100vw - 140px);
        flex-shrink: 0;
        scroll-snap-align: center;
        margin-right: 1rem;
        /* Improve rendering performance */
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        will-change: transform;
    }
    
    .project-tile:last-child {
        margin-right: 0;
    }
    
    .about {
        padding: 3rem 0;
    }
    
    .about-text p {
        font-size: 1rem;
        text-align: left;
    }
    
    .social-icons {
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-links {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem 0;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .navbar {
        height: auto;
        min-height: 60px;
    }
    
    .name-box {
        padding: 1rem 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .project-image {
        height: 150px;
        font-size: 2rem;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .project-tile {
        min-width: calc(100vw - 100px); /* Adjust for smaller arrows */
        width: calc(100vw - 100px);
    }
    
    .nav-arrow {
        width: 35px;
        height: 35px;
    }
    
    .projects-container {
        gap: 0.25rem;
    }
}