* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    display: flex;
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #c084fc, #e4e7a0);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: pulse 2s infinite;
}

.chat-toggle:hover {
    background: linear-gradient(135deg, #a855f7, #d4dc80);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#chat-widget-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-height: 80vh;
    background: linear-gradient(135deg, #c084fc, #e4e7a0);
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
    z-index: 1000;
}

#chat-widget-container.hidden {
    display: none;
}

#chat-widget-container:not(.hidden) {
    display: block;
}

.chat-header {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    color: #fff;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
}

#chat-close {
    font-size: 24px;
    cursor: pointer;
}

.chat-messages {
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px;
    background: rgba(255, 255, 255, 0.95);
}

.chat-message {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 10px;
    max-width: 85%;
    font-size: 15px;
}

.chat-message.user {
    background: #1F3A93;
    color: #fff;
    margin-left: auto;
}

.chat-message.bot {
    background: #f0f4c3;
    color: #333;
}

.chat-input {
    display: flex;
    padding: 12px;
    border-top: 1px solid #ccc;
}

#chat-input-text {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: none;
    height: 48px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

#chat-send {
    background: linear-gradient(135deg, #1F3A93, #00C4B4);
    color: #fff;
    border: none;
    padding: 10px 14px;
    margin-left: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

#chat-send:hover {
    background: linear-gradient(135deg, #003087, #00a896);
}

@media (max-width: 640px) {
    #chat-widget-container {
        width: 95%;
        bottom: 70px;
        right: 10px;
    }

    .chat-toggle {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .chat-message {
        font-size: 13px;
    }

    .chat-header h3 {
        font-size: 16px;
    }
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #1F3A93;
}

.nav-links a.active {
    color: #4861ff;
    border-bottom: 2px solid #4861ff;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.section {
    padding: 80px 50px;
    min-height: 100vh; /* Full height for desktop */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #f9f9f9;
}

.home {
    background: linear-gradient(135deg, #1F3A93, #00C4B4);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 80px 20px;
}

.home-window {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.top-window {
    background: linear-gradient(135deg, #d4a5ff, #f0f4c3);
    color: #333;
    transform: translateY(-20px);
    margin-top: 40px;
}

.bottom-window {
    background: linear-gradient(135deg, #1F3A93, #00C4B4);
    color: #fff;
}

.about, .experience, .education, .technologies, .projects, .contact {
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
    color: #333;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.home-content {
    max-width: 600px;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5rem;
}

p {
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #1F3A93;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background 0.3s;
    touch-action: manipulation; /* Improve touch interaction */
}

.btn:hover {
    background: #003087;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1000px;
    margin: 20px auto;
}

.tech-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    background: #f9f9f9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.timeline-header {
    cursor: pointer;
}

.timeline-content {
    display: none;
    margin-top: 10px;
}

.timeline-content.active {
    display: block;
}

.toggle-btn {
    background: #1F3A93;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    touch-action: manipulation;
}

.toggle-btn:hover {
    background: #003087;
}

.education-item {
    background: #f9f9f9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: left;
    max-width: 800px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.project-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.social-links a {
    color: #fff;
    margin: 0 10px;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #1F3A93;
}



@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px; /* Reduced padding for mobile */
    }

    .logo {
        font-size: 1.2rem; /* Smaller logo on mobile */
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px; /* Adjusted for smaller navbar */
        left: 0;
        width: 100%;
        background: #fff;
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 10px 0;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    .section {
        padding: 50px 10px; /* Reduced padding for mobile */
        min-height: auto; /* Compact sections on mobile */
    }

    .home {
        padding: 50px 10px;
    }

    .home-window {
        padding: 15px;
        max-width: 90%; /* Responsive width */
    }

    .top-window {
        transform: translateY(-10px); /* Reduced transform */
        margin-top: 20px;
    }

    .home-content {
        max-width: 90%;
    }

    .profile-pic {
        width: 100px;
        height: 100px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1rem;
    }

    p {
        font-size: 0.85rem;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .tech-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
        gap: 8px;
    }

    .tech-item {
        padding: 8px;
        font-size: 0.8rem;
    }

    .timeline {
        max-width: 90%;
    }

    .timeline-item {
        padding: 10px;
        margin: 10px 0;
    }

    .toggle-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .education-item {
        padding: 10px;
        margin: 10px 0;
        max-width: 90%;
    }

    .project-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
        gap: 15px;
        max-width: 90%;
    }

    .project-card {
        padding: 10px;
    }

    .social-links a {
        margin: 0 8px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }

    .menu-toggle {
        font-size: 1rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }
}