* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: #fff;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: #333;
    margin: 0 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: #007bff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

section {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.profile-section {
    text-align: center;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

h1 {
    margin: 20px 0;
    font-size: 2.5em;
}

h2 {
    margin-bottom: 20px;
    font-size: 2em;
    color: #007bff;
}

.about-me p {
    max-width: 800px;
    margin: 0 auto 20px;
    color: #666;
}

.education ul {
    max-width: 800px;
    margin: 0 auto;
    padding-left: 20px;
    color: #666;
}

.education li {
    margin-bottom: 10px;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    color: #333;
}

.contact-form textarea {
    height: 100px;
    resize: vertical;
}

.contact-form .buttons {
    display: flex;
    gap: 10px;
}

.contact-form button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contact-form button[type="submit"] {
    background: #007bff;
    color: #fff;
}

.contact-form button[type="submit"]:hover {
    background: #0056b3;
}

.contact-form button[type="button"] {
    background: #ddd;
    color: #333;
}

.contact-form button[type="button"]:hover {
    background: #ccc;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.skill-item {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.skill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card h3 {
    padding: 15px;
    font-size: 1.2em;
}

.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: #fff;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.chat-bubble:hover {
    transform: scale(1.05);
}

.chat-overlay {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 100%;
    max-width: 400px;
    height: 500px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    z-index: 1001;
    flex-direction: column;
}

.chat-header {
    background: #007bff;
    color: #fff;
    padding: 15px;
    border-radius: 15px 15px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.chat-header h3 {
    flex-grow: 1;
    margin-left: 10px;
}

.chat-exit {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.3s ease;
}

.chat-exit:hover {
    color: #ff4444;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.sent {
    background: #007bff;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.received {
    background: #e9ecef;
    border-bottom-left-radius: 0;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px;
    max-width: 80%;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.chat-input {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.chat-input button {
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chat-input button:hover {
    background: #0056b3;
}

.theme-toggle {
    padding: 10px 15px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

footer {
    background: #fff;
    color: #333;
    padding: 30px;
    margin-top: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

footer:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

footer .footer-left,
footer .footer-middle,
footer .footer-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

footer .footer-left a,
footer .footer-middle a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

footer .footer-left a:hover,
footer .footer-middle a:hover {
    color: #0056b3;
}

footer .footer-middle h3,
footer .footer-left h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #007bff;
}

footer .footer-middle h3 {
    text-decoration: underline;
}

footer .back-to-top {
    background: #007bff;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

footer .back-to-top:hover {
    background: #0056b3;
    transform: translateY(-3px);
}

footer .map iframe {
    width: 100%;
    height: 150px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Dark Theme with instant shift */
body.dark {
    background: #1a1a1a;
    color: #fff;
    transition: none;
}

body.dark header,
body.dark section,
body.dark .project-card,
body.dark .chat-overlay,
body.dark .skill-item,
body.dark footer {
    background: #2d2d2d;
    transition: none;
}

body.dark .skill-item {
    border-color: #444;
}

body.dark .nav a {
    color: #fff;
}

body.dark .about-me p,
body.dark .education ul,
body.dark .contact-form label {
    color: #ccc;
}

body.dark .contact-form input,
body.dark .contact-form select,
body.dark .contact-form textarea {
    background: #3d3d3d;
    border-color: #555;
    color: #fff;
}

body.dark .contact-form button[type="button"] {
    background: #555;
    color: #fff;
}

body.dark .contact-form button[type="button"]:hover {
    background: #666;
}

body.dark .chat-input {
    border-top: 1px solid #444;
    transition: none;
}

body.dark .chat-input input {
    background: #3d3d3d;
    border-color: #555;
    color: #fff;
    transition: none;
}

body.dark .received {
    background: #3d3d3d;
    transition: none;
}

body.dark .typing-indicator span {
    background: #ccc;
}

body.dark footer {
    color: #fff;
}

body.dark footer .footer-left a,
body.dark footer .footer-middle a {
    color: #66b0ff;
}

body.dark footer .footer-left a:hover,
body.dark footer .footer-middle a:hover {
    color: #99ccff;
}

body.dark footer .footer-middle h3,
body.dark footer .footer-left h3 {
    color: #66b0ff;
}

@media (max-width: 768px) {
    .projects, .skills-grid {
        grid-template-columns: 1fr;
    }

    .profile-pic {
        width: 120px;
        height: 120px;
    }

    .chat-overlay {
        width: 90%;
        height: 80vh;
        bottom: 70px;
        right: 5%;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .contact-form .buttons {
        flex-direction: column;
    }

    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    footer .map iframe {
        height: 200px;
    }
}