:root {
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #202124;
    --text-secondary: #5f6368;

    /* Google Colors */
    --google-blue: #4285f4;
    --google-red: #ea4335;
    --google-yellow: #fbbc05;
    --google-green: #34a853;

    --card-bg: #ffffff;
    --card-border: #dadce0;
    --card-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    --card-shadow-hover: 0 4px 8px rgba(60, 64, 67, 0.15);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* Navigation Bar */
.nav-header {
    display: flex;
    justify-content: flex-end;
    /* Top Right */
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.95);
    /* backdrop-filter: blur(5px); */
    /* Optional, kept clean */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--google-blue);
    border-bottom-color: var(--google-blue);
}


/* Hero Section */
.hero {
    height: 20vh;
    /* Reduced height to lift text strictly above snake */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
    /* Removing extra padding */
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#typing-text {
    font-weight: 500;
    color: var(--google-blue);
}

.cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--text-primary);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Filter Nav */
.filter-nav {
    position: sticky;
    top: px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 6rem 0 0.5rem 0;
    /* Moving down: High top pad, low bottom pad */
    /* increased padding for snake space */
    margin-top: 0.01rem;
    /* Exactly 0.25 inches (24px) */
    margin-bottom: 3rem;
    overflow: hidden;
    /* Ensure snake doesn't overflow */
}

#snake-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to buttons */
    z-index: 1;
}

.snake-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    /* transition: transform 0.1s linear;  -- Removing transition for direct JS control */
    /* Smooth movement */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.filter-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    justify-content: center;
}

.filter-item {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.filter-item:hover {
    color: var(--text-primary);
    background-color: #f1f3f4;
}

.filter-item.active {
    color: var(--google-blue);
    background-color: #e8f0fe;
    font-weight: 600;
}

/* Projects Grid */
.projects-section {
    padding-bottom: 4rem;
    background-color: var(--bg-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 280px;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: transparent;
}

.card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.card-content a,
.card-content button {
    pointer-events: auto;
}

.tag {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--google-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    color: var(--google-blue);
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    flex-grow: 1;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 24px;
    width: fit-content;
    z-index: 10;
    pointer-events: auto;
}

.github-link:hover {
    color: var(--google-blue);
    border-color: var(--google-blue);
    background-color: #f1f3f4;
    text-decoration: none;
}

.fab {
    font-size: 1.1em;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(32, 33, 36, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background-color: #ffffff;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--text-primary);
    background-color: #f1f3f4;
}

.modal-title {
    font-size: 1.75rem;
    color: var(--google-blue);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.modal-tag {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: #f1f3f4;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.modal-body {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
}

.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

/* Contact Page Form */
.contact-container {
    max-width: 600px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    /* Box shadow optional, trying to keep flat google look */
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-primary);
    background: #f8f9fa;
    transition: all 0.2s;
}

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

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--google-blue);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.required-star {
    color: var(--google-red);
}

.btn-primary {
    background-color: var(--google-blue);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.btn-primary:hover {
    background-color: #3367d6;
    /* Darker blue */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    background-color: #a0c0f0;
    cursor: not-allowed;
    box-shadow: none;
}

.form-status {
    margin-top: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    min-height: 1.5rem;
}

.form-status.success {
    color: var(--google-green);
}

.form-status.error {
    color: var(--google-red);
}

/* CV Page */
.cv-container {
    height: 85vh;
    margin-top: 1rem;
}

.cv-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

/* Footer */
footer {
    background-color: #f2f2f2;
    border-top: 1px solid var(--card-border);
    padding: 3rem 0;
    color: var(--text-secondary);
    margin-top: auto;
    /* Push to bottom */
}

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

.contact-links {
    display: flex;
    gap: 2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 0.5rem;
    transition: color 0.2s;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.contact-item:hover {
    color: var(--google-blue);
}

.contact-item:hover i {
    color: var(--google-blue);
}

@media (max-width: 768px) {
    .filter-list {
        justify-content: flex-start;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-header {
        justify-content: center;
    }
}

.code-style {
    background-color: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
    color: var(--text-primary);
    border: 1px solid #e0e0e0;
}

/* Chat Page Styles */
.chat-layout {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    height: 80vh;
    /* Fixed height for chat window */
}

.chat-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    text-align: center;
}

.chat-header h2 {
    font-size: 1.5rem;
    color: var(--google-blue);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.chat-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.chat-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
}

.bot-message,
.system-message {
    align-self: flex-start;
}

.message-content {
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message .message-content {
    background-color: var(--google-blue);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content,
.system-message .message-content {
    background-color: #f1f3f4;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid var(--card-border);
}

.chat-form {
    display: flex;
    gap: 0.8rem;
}

.chat-input {
    flex-grow: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.chat-input:focus {
    border-color: var(--google-blue);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.send-btn {
    background-color: var(--google-blue);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1.1rem;
}

.send-btn:hover {
    background-color: #3367d6;
}

.send-btn:disabled {
    background-color: #a0c0f0;
    cursor: default;
}

.disclaimer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Typing Indicator Style */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.2rem;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background-color: #5f6368;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .chat-layout {
        height: 75vh;
        margin-top: 1rem;
    }

    .chat-header h2 {
        font-size: 1.25rem;
    }

    .message {
        max-width: 90%;
    }
}