:root {
    /* Base Theme Variables - Light Mode */
    --accent-teal: #1a73e8;
    --accent-teal-light: #e8f0fe;
    --bg-cream: #f8f9fa;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-teal: #1967d2;
    
    --google-blue: #4285F4;
    --google-red: #EA4335;
    --google-yellow: #FBBC05;
    --google-green: #34A853;

    --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(218, 220, 224, 0.8);
    --header-bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.95);
    
    --shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --glow: 0 1px 3px 0 rgba(60,64,67,0.3);
    --shadow-deep: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    
    --border: #dadce0;
    --border-radius-lg: 12px;
    --input-bg: #ffffff;
    --msg-user-bg: linear-gradient(135deg, #f0fdfc 0%, #f9fdfd 100%);
    --msg-assistant-bg: #ffffff;
    --code-bg: #f8f9fa;
    --pill-bg: #f1f3f4;
    --dot-color: rgba(0, 0, 0, 0.08);
}

.dark-theme {
    /* Dark Mode Overrides */
    --accent-teal: #8ab4f8;
    --accent-teal-light: rgba(138, 180, 248, 0.1);
    --bg-cream: #202124;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-teal: #8ab4f8;

    --bg-gradient: linear-gradient(135deg, #202124 0%, #171717 100%);
    --glass-bg: rgba(40, 40, 40, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --header-bg: #2d2e31;
    --card-bg: rgba(45, 46, 50, 0.95);
    
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.5);
    --glow: 0 1px 3px 0 rgba(0,0,0,0.5);
    --shadow-deep: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    
    --border: #3c4043;
    --input-bg: #303134;
    --msg-user-bg: linear-gradient(135deg, #162424 0%, #1a2a2a 100%);
    --msg-assistant-bg: #2d2e30;
    --code-bg: #1e1e1e;
    --pill-bg: #303134;
    --dot-color: rgba(255, 255, 255, 0.05);
}

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

body {
    font-family: 'Outfit', 'Google Sans', sans-serif;
    background-color: var(--bg-cream);
    /* Image-inspired technical dot grid */
    background-image: radial-gradient(var(--dot-color) 1.5px, transparent 1.5px);
    background-size: 35px 35px;
    background-position: 0 0;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.nebula-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: float-particle 15s infinite alternate ease-in-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* Sharp shadows like the reference image */
}

/* Sharp colored data nodes inspired by the reference image */
.blob-1 {
    width: 24px;
    height: 24px;
    background: var(--google-blue);
    top: 15%;
    left: 12%;
}

.blob-2 {
    width: 16px;
    height: 16px;
    background: var(--google-red);
    bottom: 25%;
    right: 18%;
    animation-delay: -2s;
}

.blob-3 {
    width: 32px;
    height: 32px;
    background: var(--google-yellow);
    top: 22%;
    right: 14%;
    animation-delay: -5s;
}

.blob-4 {
    width: 20px;
    height: 20px;
    background: var(--google-green);
    bottom: 18%;
    left: 22%;
    animation-delay: -8s;
}

/* Extra data nodes to complete the constellation look */
.blob-5 {
    width: 12px;
    height: 12px;
    background: var(--google-blue);
    top: 45%;
    right: 8%;
    animation-delay: -11s;
}

.blob-6 {
    width: 18px;
    height: 18px;
    background: var(--google-red);
    top: 12%;
    left: 45%;
    animation-delay: -4s;
}

.blob-7 {
    width: 14px;
    height: 14px;
    background: var(--google-yellow);
    bottom: 35%;
    left: 8%;
    animation-delay: -7s;
}

.blob-8 {
    width: 22px;
    height: 22px;
    background: var(--google- সবুজ); /* fallback */
    background: var(--google-green);
    top: 65%;
    right: 25%;
    animation-delay: -1s;
}

@keyframes float-particle {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -40px) scale(1.15);
    }

    100% {
        transform: translate(-20px, 30px) scale(0.9);
    }
}

.container {
    width: 100%;
    max-width: 1400px;
    height: 95vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

#chat-screen {
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    box-shadow: var(--shadow-deep);
}

.chat-left-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    min-width: 0;
    position: relative;
    height: 100%;
}

.context-tools-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 24px;
    overflow-y: auto;
}

.context-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-teal);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.context-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.context-section h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.context-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.15rem;
}

.context-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.1rem;
    resize: vertical;
}

.context-textarea.large {
    min-height: 250px;
}

.context-hint {
    font-size: 1.0rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 10px;
}

.chat-header {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
}

.codelab-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.codelab-title h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-teal);
}

.emoji {
    font-size: 1.4rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-teal);
    background: var(--accent-teal-light);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--accent-teal);
    backdrop-filter: blur(5px);
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 131, 143, 0.05);
    white-space: nowrap;
}

.premium-select {
    background: var(--pill-bg);
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    background: transparent;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 80%;
}

.message.user {
    align-self: flex-start;
    flex-direction: row;
}

.message.assistant {
    align-self: flex-start;
    flex-direction: row;
}

.msg-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    color: white;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.message.user .msg-icon {
    background: linear-gradient(135deg, var(--google-blue) 0%, #b2dfdb 100%);
}

.message.assistant .msg-icon {
    background: linear-gradient(135deg, var(--accent-teal) 0%, #00acc1 100%);
}

.glow-btn:hover {
    background: #1967d2;
}

/* Redesigned Login Screen */
.login-card {
    width: 100%;
    max-width: 760px;
    padding: 56px 48px;
    border-radius: var(--border-radius-lg);
    background: var(--card-bg);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-deep);
    animation: slideUp 1s cubic-bezier(0.19, 1, 0.22, 1);
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-teal);
    margin-bottom: 8px;
}

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

.login-tips {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.tip-item {
    background: var(--accent-teal-light);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    border: 1px solid transparent;
    text-align: left;
}

.tip-item:hover {
    background: var(--accent-teal-light);
    border-color: var(--accent-teal);
    transform: translateX(4px);
}

.tip-item span {
    color: var(--text-primary);
    font-weight: 500;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

input[type="text"] {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--input-bg);
    transition: border-color 0.2s;
    outline: none;
}

input[type="text"]:focus {
    border: 2px solid var(--accent-teal);
    padding: 12px 14px;
    /* Maintain height with thicker border */
}

.premium-select-login {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--input-bg);
    cursor: pointer;
}

.premium-select-login:focus {
    border: 2px solid var(--accent-teal);
    padding: 11px 15px;
}

.glow-btn {
    align-self: center;
    background: var(--input-bg);
    color: var(--text-teal);
    border: 2px solid var(--accent-teal-light);
    border-radius: 32px;
    padding: 14px 48px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 12px;
    box-shadow: 0 4px 15px rgba(0, 131, 143, 0.05);
}

.glow-btn:hover {
    background: var(--accent-teal-light);
    border-color: var(--accent-teal);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 131, 143, 0.1);
}

.glass-card .premium-text {
    font-size: 1.75rem;
    color: #202124;
    font-weight: 500;
}

.glass-card .input-group input {
    border-radius: 4px;
    background: #fff;
    border: 1px solid #dadce0;
    padding: 12px 16px;
}

.preview-area {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.preview-item {
    background: var(--pill-bg);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
}

.remove-btn {
    background: none;
    border: none;
    color: #5f6368;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
}

.remove-btn:hover {
    color: #EA4335;
}

.message.assistant .msg-icon {
    background: linear-gradient(135deg, #ce93d8 0%, #f48fb1 100%);
}

.msg-bubble {
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.msg-bubble:hover {
    transform: translateY(-1px);
}

.user .msg-bubble {
    background: var(--msg-user-bg);
    color: var(--text-teal);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 131, 143, 0.05);
}

.assistant .msg-bubble {
    background: var(--msg-assistant-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

/* Markdown and nested styles */
.msg-bubble p:not(:last-child) {
    margin-bottom: 12px;
}

.msg-bubble b,
.msg-bubble strong {
    font-weight: 700;
    color: var(--text-teal);
}

.msg-bubble pre {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 8px;
    max-width: 100%;
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid var(--border);
    position: relative;
    white-space: pre-wrap;
    word-break: break-all;
}

.msg-bubble code {
    background: var(--accent-teal-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-teal);
}

.msg-bubble pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.suggestions-container {
    padding: 0 48px 12px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.suggestion-chip {
    background: var(--input-bg);
    border: 1px solid var(--accent-teal);
    color: var(--text-teal);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 131, 143, 0.05);
}

.suggestion-chip:hover {
    background: var(--accent-teal-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 131, 143, 0.1);
}

.paste-hint {
    padding: 0 48px 12px;
    display: flex;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.hint-content {
    width: 100%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.02);
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.hint-content:hover {
    background: rgba(0, 131, 143, 0.03);
    border-color: var(--accent-teal);
}

.hint-content pre {
    margin: 0;
    pointer-events: none;
}

.hint-content code {
    color: #999;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
}

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

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

.chat-footer {
    padding: 0 48px 24px;
    background: transparent;
    display: flex;
    justify-content: center;
}

.input-pill {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--pill-bg);
    border-radius: 28px;
    padding: 6px 16px;
    min-height: 56px;
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    resize: none;
    font-family: inherit;
    padding: 8px 0;
    max-height: 150px;
    line-height: 1.5;
    align-self: center;
}

#chat-input.code-mode {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-teal);
    background: rgba(0, 131, 143, 0.02);
}

.action-btn,
.send-btn,
.icon-btn,
.text-btn {
    cursor: pointer;
    color: #5f6368;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.text-btn {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.text-btn:hover {
    background: var(--pill-bg);
    color: var(--google-blue);
}

.send-btn {
    background: #dee1e6;
    border-radius: 8px;
    padding: 6px;
}

.action-btn:hover,
.send-btn:hover {
    color: var(--google-blue);
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

pre:hover .copy-code-btn {
    opacity: 1;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 1.4rem;
}

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

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

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

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

/* Theme Toggle styles */
.theme-toggle-btn {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-deep);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--pill-bg);
    color: var(--accent-teal);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.dark-theme .sun-icon {
    display: block;
    animation: rotateIn 0.5s ease;
}

.dark-theme .moon-icon {
    display: none;
}

.sun-icon {
    display: none;
    pointer-events: none;
}

.moon-icon {
    display: block;
    animation: dropIn 0.5s ease;
    pointer-events: none;
}

@keyframes rotateIn {
    from { transform: rotate(-90deg) scale(0.5); opacity: 0; }
    to { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes dropIn {
    from { transform: translateY(-20px) scale(0.5); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}


/* Validation styles */
.error-text {
    color: var(--google-red);
    font-size: 0.85rem;
    margin-top: -8px;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}