:root {
    --gradient-1: linear-gradient(135deg, #0066ff 0%, #00bfff 100%);
    --gradient-2: linear-gradient(135deg, #1e90ff 0%, #4169e1 100%);
    --gradient-3: linear-gradient(135deg, #000080 0%, #0066ff 100%);
    --primary-color: #0066ff;
    --secondary-color: #00bfff;
    --accent-color: #1e90ff;
    --background-color: #f8faff;
    --card-background: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    position: relative;
    min-height: 100vh;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #0066ff, #00bfff, #1e90ff, #4169e1, #000080);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    opacity: 0.2;
}

/* Header and Navigation */
header {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 1rem 2.5rem; /* Increased horizontal padding for better spacing */
    display: flex;
    justify-content: flex-start; /* Align items to the left */
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-start; /* Align nav links to the left after logo */
    max-width: 900px;
    margin: 0 auto;
}

nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    justify-content: flex-start;
}

nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

nav a:hover {
    background: var(--gradient-1);
    color: white;
    transform: translateY(-2px);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    margin-right: 40px; /* More space between logo and nav links */
}

.logo img {
    height: 48px;
    width: auto;
    border-radius: 8px; /* Optional: rounded corners for a modern look */
    box-shadow: 0 2px 8px rgba(0,0,0,0.07); /* Optional: subtle shadow */
}

/* Advanced Logo Styles */
.logo-advanced {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1100;
    margin-right: 48px;
    animation: logoFadeIn 1.2s cubic-bezier(.4,2,.6,1) 0.2s backwards;
}
.logo-advanced a {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo-glass {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45); /* More white for contrast */
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.22);
    border: 3px solid #fff; /* White border for clarity */
    transition: transform 0.3s, box-shadow 0.3s;
    margin-right: 20px;
}
.logo-glass img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff; /* White background for clarity */
    padding: 4px;
    object-fit: contain;
    filter: none; /* Remove drop-shadow for clarity */
}
.logo-advanced:hover .logo-glass {
    transform: scale(1.08) rotate(-6deg);
    box-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.22);
}
.logo-advanced:hover .logo-glass img {
    transform: scale(1.12) rotate(6deg);
}
.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0,102,255,0.08);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@keyframes logoFadeIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.8);}
    to   { opacity: 1; transform: none;}
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1.5rem;
    padding-right: 2rem;
}

.social-links a {
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* Sections */
section {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin: 2rem auto;
    padding: 3rem 2rem;
    max-width: 1200px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:first-of-type {
    margin-top: 6rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-top: 2rem;
}

.about-content img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid transparent;
    background: var(--gradient-2);
    background-clip: padding-box;
    position: relative;
}

.about-text {
    flex: 1;
}

.about-text .name {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project {
    background: var(--card-background);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s cubic-bezier(.4,2,.6,1), box-shadow 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.project:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0,102,255,0.10);
}

.project img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project:hover img {
    transform: scale(1.05);
}

.project h2 {
    padding: 1.5rem 1rem 1rem;
    color: var(--text-primary);
}

.project-summary {
    padding: 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.view-details-btn {
    margin: 0 1rem 1.5rem;
    display: inline-block;
}

/* Project Details Styles */
.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-details.show {
    max-height: 2000px;
    transition: max-height 1s ease-in;
}

.project-details h3 {
    color: var(--primary-color);
    margin: 1.5rem 1rem 1rem;
    font-size: 1.2rem;
}

.project-details ul {
    list-style-type: none;
    padding: 0 1rem 1rem 2rem;
}

.project-details li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    position: relative;
}

.project-details li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: -1rem;
}

.project-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.project-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease;
}

.project-images img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* Skills Section */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.skill:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.skill i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill h2 {
    margin-bottom: 2rem;
    font-size: 1.6rem;
    color: var(--text-primary);
}

.skill-category {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.skill-category:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.skill-category h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.skill-category p {
    color: var(--text-secondary);
}

/* Contact Section */
.contact-info {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.contact-info p:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.contact-info i {
    font-size: 1.8rem;
    margin-right: 1.5rem;
    color: var(--primary-color);
    min-width: 24px;
    text-align: center;
}

.contact-info span {
    font-weight: 600;
    margin-right: 1rem;
    color: var(--text-primary);
    min-width: 80px;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    word-break: break-all;
}

.contact-info a:hover {
    color: var(--secondary-color);
}

/* Updated Social Links Styles */
#contact h3 {
    text-align: center;
    margin: 3rem 0 2rem;
    color: var(--text-primary);
    font-size: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#contact .social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

#contact .social-links a {
    color: var(--primary-color);
    font-size: 2.2rem;
    transition: all 0.3s ease;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    box-shadow: var(--shadow-soft);
}

#contact .social-links a:hover {
    color: white;
    background: var(--gradient-1);
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Back to Top Button */
#top-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

#top-button.visible {
    opacity: 1;
    visibility: visible;
}

#top-button:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Buttons */
.btn {
    background: var(--gradient-1);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(.4,2,.6,1), box-shadow 0.2s;
    text-decoration: none;
    font-weight: 500;
}

.btn:hover {
    transform: scale(1.07) translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,102,255,0.12);
}

/* Welcome Overlay */
#welcome-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: linear-gradient(120deg, #0066ff 0%, #00bfff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.7s cubic-bezier(.4,2,.6,1);
    opacity: 1;
    pointer-events: all;
    box-shadow: 0 0 0 8px #00bfff44, 0 0 80px 10px #0066ff55 inset;
    animation: overlayGlow 2.5s infinite alternate;
    backdrop-filter: blur(8px);
}
@keyframes overlayGlow {
    from { box-shadow: 0 0 0 8px #00bfff44, 0 0 80px 10px #0066ff55 inset; }
    to   { box-shadow: 0 0 0 16px #00bfff88, 0 0 120px 20px #0066ff99 inset; }
}
#welcome-overlay.hide {
    opacity: 0;
    pointer-events: none;
}
.welcome-content {
    text-align: center;
    color: #fff;
    animation: fadeInWelcome 1.2s cubic-bezier(.4,2,.6,1);
    background: rgba(0,0,0,0.15);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    backdrop-filter: blur(2px);
}
@keyframes fadeInWelcome {
    from { opacity: 0; transform: translateY(40px) scale(0.95);}
    to   { opacity: 1; transform: none;}
}
.welcome-title {
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: 2.2rem;
    letter-spacing: 1px;
    min-height: 2.5em;
    text-shadow: 0 4px 24px #0066ff44;
    line-height: 1.2;
}
.niflex {
    background: linear-gradient(90deg, #fff 30%, #00bfff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    font-weight: 900;
}
.typewriter-bounce {
    display: inline-block;
    animation: bounceIn 0.45s cubic-bezier(.4,2,.6,1);
    text-shadow: 0 2px 8px #0066ff33;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 1px;
}
@keyframes bounceIn {
    0%   { transform: scale(0.5) translateY(-30px); opacity: 0; }
    60%  { transform: scale(1.2) translateY(10px); opacity: 1; }
    100% { transform: scale(1) translateY(0); }
}
.animated-btn {
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    background: #fff;
    color: #0066ff;
    font-weight: 700;
    box-shadow: 0 4px 24px rgba(0,102,255,0.13);
    transition: background 0.2s, color 0.2s, transform 0.2s;
    animation: bounceBtn 1.2s infinite alternate;
    margin-top: 1.5rem;
}
.animated-btn:hover {
    background: #0066ff;
    color: #fff;
    transform: scale(1.07);
}
@keyframes bounceBtn {
    from { transform: translateY(0);}
    to   { transform: translateY(-10px);}
}

/* Animations */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    section {
        margin: 2rem 1rem;
        padding: 2rem 1.5rem;
    }

    .about-content {
        gap: 2rem;
    }

    .project-grid,
    .skill-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem;
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    nav a {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }

    .social-links {
        padding-right: 0;
        justify-content: center;
    }

    section {
        padding: 2rem 1rem;
    }

    section:first-of-type {
        margin-top: 8rem;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-content img {
        width: 250px;
        height: 250px;
    }

    .about-text p {
        text-align: left;
    }

    .project-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .skill-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .contact-info p {
        padding: 1.5rem;
        margin-bottom: 1.2rem;
    }

    .contact-info i {
        font-size: 2rem;
        margin: 0 0 0.8rem 0;
    }

    .contact-info span {
        margin: 0 0 0.5rem 0;
        display: block;
        min-width: auto;
        font-size: 1.1rem;
    }

    #contact h3 {
        font-size: 1.8rem;
        margin: 2.5rem 0 1.5rem;
    }

    #contact .social-links {
        gap: 1.5rem;
        padding: 1.5rem;
    }

    #contact .social-links a {
        font-size: 2rem;
        width: 3.5rem;
        height: 3.5rem;
        padding: 0.8rem;
    }

    .project-images {
        grid-template-columns: 1fr;
    }
    
    .project-details h3 {
        font-size: 1.1rem;
    }
    
    .project-details li {
        font-size: 0.95rem;
    }

    .project {
        margin-bottom: 2rem;
    }

    .project-gallery .main-image {
        height: 220px;
    }

    .project h2 {
        font-size: 1.6rem;
        padding: 1.2rem 1rem 0.8rem;
    }

    .project-summary {
        font-size: 0.95rem;
        line-height: 1.6;
        padding: 0 1rem 1.2rem;
    }

    .project-thumbnails {
        padding: 0.8rem;
        gap: 0.8rem;
        justify-content: center;
    }

    .project-thumbnails img {
        width: 70px;
        height: 50px;
    }

    .project-links .btn {
        width: 100%;
        max-width: none;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    /* Responsive Logo for Tablets and Phones */
    .logo-advanced {
        margin-right: 0;
        margin-bottom: 0.5rem;
        justify-content: center;
        width: 100%;
    }
    .logo-glass {
        width: 56px;
        height: 56px;
        margin-right: 12px;
    }
    .logo-glass img {
        width: 36px;
        height: 36px;
        padding: 2px;
    }
    .logo-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .logo-advanced {
        flex-direction: row;
        align-items: center;
        margin-bottom: 0.3rem;
    }
    .logo-glass {
        width: 44px;
        height: 44px;
        margin-right: 8px;
    }
    .logo-glass img {
        width: 28px;
        height: 28px;
        padding: 1px;
    }
    .logo-text {
        font-size: 1rem;
    }

    body {
        font-size: 0.95rem;
    }

    header {
        padding: 0.6rem;
    }

    nav a {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-links a {
        font-size: 1.2rem;
    }

    .about-content img {
        width: 200px;
        height: 200px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .about-text .name {
        font-size: 1.4rem;
    }

    .project {
        margin-bottom: 1.5rem;
    }

    .project h2 {
        font-size: 1.3rem;
        padding: 1rem 1rem 0.5rem;
    }

    .project p {
        font-size: 0.9rem;
    }

    .skill {
        padding: 1.5rem;
    }

    .skill h2 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .skill-category {
        padding: 1rem;
    }

    .skill-category h3 {
        font-size: 1.1rem;
    }

    .contact-info p {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }

    .contact-info i {
        font-size: 1.8rem;
        margin-bottom: 0.6rem;
    }

    .contact-info span {
        font-size: 1rem;
    }

    .contact-info a {
        font-size: 0.95rem;
    }

    #contact h3 {
        font-size: 1.6rem;
        margin: 2rem 0 1.2rem;
    }

    #contact .social-links {
        gap: 1rem;
        padding: 1.2rem;
    }

    #contact .social-links a {
        font-size: 1.6rem;
        width: 3rem;
        height: 3rem;
        padding: 0.7rem;
    }

    .project-images {
        grid-template-columns: 1fr;
    }
    
    .project-details h3 {
        font-size: 1.1rem;
    }
    
    .project-details li {
        font-size: 0.9rem;
    }

    .project {
        margin-bottom: 2rem;
    }

    .project-gallery .main-image {
        height: 220px;
    }

    .project h2 {
        font-size: 1.6rem;
        padding: 1.2rem 1rem 0.8rem;
    }

    .project-summary {
        font-size: 0.95rem;
        line-height: 1.6;
        padding: 0 1rem 1.2rem;
    }

    .project-thumbnails {
        padding: 0.8rem;
        gap: 0.8rem;
        justify-content: center;
    }

    .project-thumbnails img {
        width: 70px;
        height: 50px;
    }

    .project-links .btn {
        width: 100%;
        max-width: none;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    /* Responsive Logo for Tablets and Phones */
    .logo-advanced {
        margin-right: 0;
        margin-bottom: 0.5rem;
        justify-content: center;
        width: 100%;
    }
    .logo-glass {
        width: 56px;
        height: 56px;
        margin-right: 12px;
    }
    .logo-glass img {
        width: 36px;
        height: 36px;
        padding: 2px;
    }
    .logo-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .logo-advanced {
        flex-direction: row;
        align-items: center;
        margin-bottom: 0.3rem;
    }
    .logo-glass {
        width: 44px;
        height: 44px;
        margin-right: 8px;
    }
    .logo-glass img {
        width: 28px;
        height: 28px;
        padding: 1px;
    }
    .logo-text {
        font-size: 1rem;
    }

    body {
        font-size: 0.9rem;
    }

    header {
        padding: 0.5rem;
    }

    nav a {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-links a {
        font-size: 1.2rem;
    }

    .about-content img {
        width: 180px;
        height: 180px;
    }

    section {
        padding: 1.2rem 0.8rem;
        margin: 0.8rem;
    }

    .project img {
        height: 160px;
    }

    .skill {
        padding: 1.2rem;
    }

    .contact-info p {
        padding: 1rem;
    }

    .contact-info i {
        font-size: 1.6rem;
    }

    .contact-info span {
        font-size: 0.95rem;
    }

    .contact-info a {
        font-size: 0.9rem;
    }

    #contact h3 {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem;
    }

    #contact .social-links {
        gap: 0.8rem;
        padding: 1rem;
    }

    #contact .social-links a {
        font-size: 1.4rem;
        width: 2.8rem;
        height: 2.8rem;
        padding: 0.6rem;
    }

    .project-images {
        grid-template-columns: 1fr;
    }
    
    .project-details h3 {
        font-size: 1.1rem;
    }
    
    .project-details li {
        font-size: 0.9rem;
    }

    .project {
        margin-bottom: 2rem;
    }

    .project-gallery .main-image {
        height: 220px;
    }

    .project h2 {
        font-size: 1.6rem;
        padding: 1.2rem 1rem 0.8rem;
    }

    .project-summary {
        font-size: 0.95rem;
        line-height: 1.6;
        padding: 0 1rem 1.2rem;
    }

    .project-thumbnails {
        padding: 0.8rem;
        gap: 0.8rem;
        justify-content: center;
    }

    .project-thumbnails img {
        width: 70px;
        height: 50px;
    }

    .project-links .btn {
        width: 100%;
        max-width: none;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    /* Responsive Logo for Tablets and Phones */
    .logo-advanced {
        margin-right: 0;
        margin-bottom: 0.5rem;
        justify-content: center;
        width: 100%;
    }
    .logo-glass {
        width: 56px;
        height: 56px;
        margin-right: 12px;
    }
    .logo-glass img {
        width: 36px;
        height: 36px;
        padding: 2px;
    }
    .logo-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .logo-advanced {
        flex-direction: row;
        align-items: center;
        margin-bottom: 0.3rem;
    }
    .logo-glass {
        width: 44px;
        height: 44px;
        margin-right: 8px;
    }
    .logo-glass img {
        width: 28px;
        height: 28px;
        padding: 1px;
    }
    .logo-text {
        font-size: 1rem;
    }

    body {
        font-size: 0.9rem;
    }

    header {
        padding: 0.5rem;
    }

    nav a {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-links a {
        font-size: 1.2rem;
    }

    .about-content img {
        width: 180px;
        height: 180px;
    }

    section {
        padding: 1.2rem 0.8rem;
        margin: 0.8rem;
    }

    .project img {
        height: 160px;
    }

    .skill {
        padding: 1.2rem;
    }

    .contact-info p {
        padding: 1rem;
    }

    .contact-info i {
        font-size: 1.6rem;
    }

    .contact-info span {
        font-size: 0.95rem;
    }

    .contact-info a {
        font-size: 0.9rem;
    }

    #contact h3 {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem;
    }

    #contact .social-links {
        gap: 0.8rem;
        padding: 1rem;
    }

    #contact .social-links a {
        font-size: 1.4rem;
        width: 2.8rem;
        height: 2.8rem;
        padding: 0.6rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    #top-button {
        right: 1rem;
        bottom: 1rem;
        padding: 0.8rem;
    }

    .project-details h3 {
        font-size: 1rem;
    }
    
    .project-details li {
        font-size: 0.9rem;
    }

    .project-images img {
        height: 120px;
    }

    .project-links {
        flex-direction: column;
        gap: 0.8rem;
    }

    .project-links .btn {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }

    .project-links i {
        font-size: 1rem;
    }

    section {
        padding: 1.5rem 1rem;
        margin: 1rem;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .project-gallery .main-image {
        height: 180px;
    }

    .project h2 {
        font-size: 1.4rem;
        padding: 1rem 0.8rem 0.6rem;
    }

    .project-summary {
        font-size: 0.9rem;
        padding: 0 0.8rem 1rem;
    }

    .project-thumbnails {
        padding: 0.6rem;
        gap: 0.6rem;
    }

    .project-thumbnails img {
        width: 60px;
        height: 45px;
    }

    .project-links {
        padding: 0 0.8rem 1.2rem;
    }

    .project-links .btn {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
}

/* Responsive Welcome Overlay */
@media (max-width: 600px) {
    #welcome-overlay .welcome-content {
        padding: 1.2rem 0.5rem;
        border-radius: 14px;
    }
    .welcome-title {
        font-size: 1.3rem;
        min-height: 2em;
        margin-bottom: 1.2rem;
        line-height: 1.2;
    }
    .typewriter-bounce {
        font-size: 1.1rem;
    }
    .niflex {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }
    .animated-btn {
        font-size: 1rem;
        padding: 0.7rem 1.5rem;
        margin-top: 1rem;
    }
}

/* Ensure smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
}

/* Optimize touch targets for mobile */
button,
a {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Improve tap highlighting */
a,
button {
    -webkit-tap-highlight-color: rgba(0, 102, 255, 0.2);
}

/* Optimize images for different screen sizes */
img {
    max-width: 100%;
    height: auto;
}

.project-links {
    display: flex;
    justify-content: center;
    padding: 0 1rem 1.5rem;
}

.project-links .btn {
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: var(--gradient-1);
    color: white;
    border-radius: 25px;
}

.project-links .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 102, 255, 0.3);
}

.project-links i {
    font-size: 1.2rem;
}

.project-gallery {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
}

.project-gallery .main-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    transition: opacity 0.2s ease-in-out;
}

.project-thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.project-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.project-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.project-thumbnails::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 6px;
}

.project-thumbnails img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.project-thumbnails img:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.project-thumbnails img.active {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

@media (max-width: 768px) {
    .project-gallery .main-image {
        height: 250px;
    }

    .project-thumbnails img {
        width: 70px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .project-gallery .main-image {
        height: 200px;
    }

    .project-thumbnails {
        gap: 0.3rem;
        padding: 0.3rem;
    }

    .project-thumbnails img {
        width: 60px;
        height: 45px;
    }

    .project-links .btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
    }

    .project-links i {
        font-size: 1.1rem;
    }
}

@media (max-width: 360px) {
    .project-links .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }

    .project-links i {
        font-size: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .project-thumbnails img {
        padding: 0.5rem;
    }

    .project-links .btn {
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.2s ease;
    }

    .project-links .btn:active {
        transform: scale(0.98);
    }
}

/* Smooth Transitions */
.project-gallery .main-image,
.project-thumbnails img,
.project-links .btn {
    will-change: transform;
    backface-visibility: hidden;
}

/* Loading States */
.project-gallery .main-image {
    transition: opacity 0.3s ease;
}

.project-gallery .main-image.loading {
    opacity: 0.7;
}

.section-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.4,2,.6,1);
}

.section-animate.visible {
    opacity: 1;
    transform: none;
}

/* Add to your index.css */
.portfolio-intro {
    text-align: center;
    margin: 2rem 0 1.5rem 0;
}
.portfolio-intro h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0066ff;
    margin-bottom: 0.5rem;
}
.portfolio-intro p {
    font-size: 1.15rem;
    color: #222;
}
