:root {
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    --silver: #c0c0c0;
    --platinum: #e5e4e2;
    --gunmetal: #2c2f33;

    /* Dark Theme */
    --bg-color: var(--gray-900);
    --card-bg: var(--gray-800);
    --text-color: #eaeaea;
    --input-bg: #2f2f2f;
    --button-bg: linear-gradient(to right, #bfbfbf, #8a8a8a);
    --button-hover: linear-gradient(to right, #a3a3a3, #6f6f6f);
    --border-color: #555;

    --tagline-color: #aaa;
    --bot-text-dark: #ffe680;
    --bot-text-light: #7a5e00;
    --user-text-dark: #00ff95;
    --user-text-light: #008a5a;
}

body.light-theme {
    --bg-color: var(--gray-100);
    --card-bg: var(--platinum);
    --text-color: var(--gray-800);
    --input-bg: var(--gray-200);
    --button-bg: linear-gradient(to right, #d1d1d1, #a6a6a6);
    --button-hover: linear-gradient(to right, #b8b8b8, #888888);
    --border-color: #bbb;
}

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

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    transition:
        background-color 0.3s,
        color 0.3s;
}

.theme-toggle {
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    color: var(--text-color);
    transition: transform 0.3s ease, color 0.3s ease;

    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover,
.theme-toggle:active {
    background: none;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

/* Remove the flash/outline on focus */
.theme-toggle:focus {
    outline: none;
    box-shadow: none;
}

/* Remove active state background flash */
.theme-toggle:active {
    transform: scale(1);
}

#theme-icon {
    transition: transform 0.3s ease;
}

.theme-toggle:hover #theme-icon {
    transform: rotate(20deg);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

p.tagline {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 1.5rem;
}

.section {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
}

/* Chatbox */
.chat-box {
    height: 250px;
    overflow-y: auto;
    background-color: transparent;
    padding: 10px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar for chat-box (Webkit browsers) */
#chat-box::-webkit-scrollbar {
    width: 18px !important;
    /* Increased width */
}

#chat-box::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 8px;
    border: 4px solid red;
    background-clip: padding-box;
}

#chat-box::-webkit-scrollbar-track {
    background: transparent;
}

/* For Firefox */
#chat-box {
    scrollbar-width: thick;
    scrollbar-color: var(--border-color) transparent;
}

.chat-container {
    position: relative;
}

.chat-blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 8px;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
}

.chat-blur-overlay.hide {
    opacity: 0;
    backdrop-filter: blur(0px);
    pointer-events: none;
}

.chat-blur-text {
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 0 2px 8px #000, 0 0 2px #fff;
    letter-spacing: 1px;
}

/* User message: aligned right */
.user {
    position: relative;
    color: var(--user-text-dark);
    background: none;
    border: none;
    font-weight: 500;
    margin: 6px 0;
    max-width: 70%;
    line-height: 1.4;
    word-wrap: break-word;
    text-align: center;
}


body:not(.light-theme) .user::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid rgba(0, 255, 149, 0.5);
    /* same as bubble background */
    border-right: 10px solid transparent;
}

/* Light theme user bubble */
body.light-theme .user {
    background: var(--user-text-light);
    color: #e0f2e9;
    border-radius: 12px 12px 0 12px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 138, 90, 0.4);
}

body.light-theme .user::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid var(--user-text-light);
    border-right: 10px solid transparent;
}

body:not(.light-theme) .user {
    color: var(--user-text-dark);
    border: 1px solid var(--user-text-dark);
    border-radius: 12px 12px 0 12px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 255, 149, 0.2);
}

body.light-theme .user {
    color: var(--user-text-light);
    background: none;
    border: none;
}



/* Bot message: aligned left */
.bot {
    position: relative;
    text-align: left;
    background-color: rgba(255, 255, 160, 0.1);
    border: 1px solid var(--bot-text-dark);
    color: var(--bot-text-dark);
    border-radius: 12px 12px 12px 0;
    padding: 10px 14px;
    margin: 6px 0;
    max-width: 70%;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(255, 230, 128, 0.4);
}

body:not(.light-theme) .bot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid rgba(255, 255, 160, 1);
    /* same as bubble bg */
    border-left: 10px solid transparent;
}

/* Light theme overrides for bot background & tail */
body.light-theme .bot {
    color: var(--bot-text-light);
    background: rgba(255, 223, 100, 0.2);
    border: 1px solid #c19e00;
    box-shadow: 0 1px 3px rgba(255, 223, 100, 0.4);
}

body.light-theme .bot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid #c19e00;
    /* Matches bubble background */
    border-left: 10px solid transparent;
}

body:not(.light-theme) .bot {
    color: var(--bot-text-dark);
    background: rgba(255, 255, 160, 0.1);
    border: 1px solid var(--bot-text-dark);
}

/* Chat Form */
#chat-form {
    display: flex;
    width: 100%;
    margin-top: 8px;
}

#user-input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px 0 0 4px;
    background: var(--input-bg);
    color: var(--text-color);
    width: 100%;
}

.btn {
    background: var(--button-bg);
    color: #000;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn:hover {
    background: var(--button-hover);
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 0 4px 4px 0;
    background: var(--button-bg);
    color: black;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Tally Contact Form */
iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .section {
        padding: 1rem;
    }
}

.links {
    display: inline-block;
    /* margin-right: 1rem; */
    transition: transform 0.6s ease;
    color: var(--button-bg);
    text-decoration: none;
}

.linksIcon {
    font-size: 32px;
}

.links:hover {
    cursor: pointer;
    color: var(--button-hover);
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.visually-hidden {
    position: absolute;
    clip: rect(0 0 0 0);
    width: 1px;
    height: 1px;
    margin: -1px;
}

.dots {
    display: inline-block;
    font-size: 24px;
    letter-spacing: 4px;
}

.dot {
    opacity: 0.2;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 0.2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0.2;
    }
}

.availability {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background-color: var(--platinum);
    font-weight: 700;
    font-size: 1.1rem;
    border: 1.5px solid #c2c2c8;
    border-radius: 8px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

body:not(.light-theme) .availability {
    background-color: var(--gray-800);
    /* dark card bg */
    color: var(--text-color);
    /* light text */
    border-color: var(--border-color);
}

.availability a:hover,
.availability a:focus {
    transform: scale(1.1);
    outline: none;
}

.btn-hire {
    color: var(--bot-text-light);
    padding: 10px 18px;
    border-radius: 8px;
    background-color: transparent;
    font-weight: 700;
    margin-top: 0.6rem;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffe680;
    transition: all 0.25s ease, color 0.25s ease;
}

.btn-hire:hover {
    transform: translateY(-2px) scale(1.04);
    cursor: pointer;
}

.btn-hire-animate {
    animation: hire-pulse 0.5s alternate 4;
    box-shadow: 0 0 0 4px #ffe680, 0 0 10px 2px #ffe680;
    outline: 2px solid #ffe680;
}

@keyframes hire-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 4px #ffe680, 0 0 10px 2px #ffe680;
    }

    100% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px #ffe680, 0 0 20px 4px #ffe680;
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Work with me modal styles */
.work-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 30, 30, 0.45);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.work-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.work-modal-content {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
    color: var(--text-color);
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: 400px;
    width: 90vw;
    text-align: center;
    position: relative;
    animation: fadeIn 0.5s;
}

.work-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.work-modal-close:hover {
    color: #ff5252;
}

.work-modal-title {
    font-size: 2em;
    color: var(--text-color);
    font-weight: 800;
    margin-bottom: 0.2em;
    letter-spacing: -1.5px;
}

.work-modal-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.work-modal-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 0.7em;
    box-shadow: 0 4px 16px rgba(231, 111, 81, 0.13);
    background: var(--button-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-modal-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.work-modal-desc {
    font-size: 1.13em;
    color: var(--text-color);
    margin: 1em 0 0.5em 0;
    line-height: 1.7;
    text-align: center;
}

.work-modal-desc b {
    color: var(--border-color);
}

.work-modal-desc-2 {
    font-size: 1.08em;
    color: var(--text-color);
    margin: 0.5em 0 1.2em 0;
    text-align: center;
}

/* Chatbox Navbar */
.chatbox-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.5rem;
    background: var(--input-bg);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0.5rem;
}

.chatbox-navbar-left {
    display: flex;
    gap: 0.3rem;
}

.chatbox-navbar-right {
    display: flex;
}

.chatbox-navbar-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.chatbox-navbar-btn:hover {
    background: var(--button-hover);
}

.chatbox-navbar-btn.disabled,
.chatbox-navbar-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.summary {
    font-style: italic;
    color: var(--bot-text-dark);
    background: rgba(255, 255, 0, 0.08);
    border-left: 3px solid var(--bot-text-dark);
    padding-left: 0.5em;
}

@media (max-width: 600px) {
    .work-modal-content {
        max-width: 98vw;
        width: 98vw;
        min-height: 60vh;
        max-height: 90vh;
        padding: 1.2rem 0.5rem 1.2rem 0.5rem;
        font-size: 1em;
        border-radius: 12px;
        overflow-y: auto;
        box-sizing: border-box;
    }

    .work-modal-message {
        max-height: 65vh;
        overflow-y: auto;
        padding-bottom: 1.5em;
    }

    .work-modal-title {
        font-size: 1.3em;
    }

    .work-modal-avatar {
        width: 50px;
        height: 50px;
    }

    .work-modal-avatar img {
        width: 44px;
        height: 44px;
    }

    .work-modal-close {
        font-size: 1.5rem;
        top: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .work-modal-content {
        max-height: 98vh;
        min-height: 60vh;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        overflow-y: auto;
    }

    .work-modal-message {
        max-height: 80vh;
        overflow-y: auto;
    }

    .work-modal-avatar {
        min-width: 44px;
        min-height: 44px;
        width: 50px;
        height: 50px;
        margin-bottom: 0.5em;
        flex-shrink: 0;
    }

    .work-modal-avatar img {
        min-width: 40px;
        min-height: 40px;
        width: 44px;
        height: 44px;
    }
}

/* Make modal scrollable on all screens if needed */
.work-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.work-modal-message {
    overflow-y: auto;
}

body.modal-open {
    overflow: hidden;
}