:root {
    --bg-color: #0f111a;
    --chat-bg: #1a1d2d;
    --primary: #4e5eff;
    --primary-gradient: linear-gradient(135deg, #4e5eff 0%, #a64eff 100%);
    --text-color: #ffffff;
    --text-dim: #a0a0b0;
    --input-bg: #22263a;
    --banana-gradient: linear-gradient(135deg, #ffe259 0%, #ffa751 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, rgba(78, 94, 255, 0.1), transparent 40%);
}

header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.badge {
    background: var(--primary-gradient);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.model-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background: var(--banana-gradient);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-message {
    text-align: center;
    margin-top: 20%;
    opacity: 0.8;
}

.welcome-message h2 {
    font-size: 2rem;
    background: linear-gradient(to right, #fff, #a0a0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 20px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

.message.user {
    align-self: flex-end;
    background: var(--input-bg);
    border-bottom-right-radius: 5px;
}

.message.ai {
    align-self: flex-start;
    background: rgba(78, 94, 255, 0.1);
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(78, 94, 255, 0.2);
}

.message.ai.nanabanana {
    background: rgba(255, 226, 89, 0.1);
    border-color: rgba(255, 226, 89, 0.3);
}

footer {
    padding: 20px;
    background: rgba(15, 17, 26, 0.8);
    backdrop-filter: blur(20px);
}

.input-area {
    display: flex;
    gap: 10px;
    background: var(--input-bg);
    padding: 10px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    align-items: flex-end;
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    max-height: 150px;
    padding: 10px 0;
}

button {
    background: var(--primary-gradient);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    transform: scale(1.05);
}

/* Nanabanana active state */
body.nanabanana-active .badge {
    background: var(--banana-gradient);
    color: #1a1d2d;
}

body.nanabanana-active button {
    background: var(--banana-gradient);
    color: #1a1d2d;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Markdown Styles */
.message h1,
.message h2,
.message h3 {
    margin-bottom: 10px;
}

.message p {
    margin-bottom: 10px;
}

.message code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.message pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 10px;
}

.message pre code {
    background: transparent;
    padding: 0;
}

/* File Upload Styles */
.file-preview {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 10px;
    background: rgba(34, 38, 58, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
}

.file-preview.hidden {
    display: none;
}

#file-name {
    font-size: 0.9rem;
    color: var(--text-color);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#remove-file-btn {
    background: rgba(255, 255, 255, 0.1);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

#remove-file-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.input-area {
    position: relative;
    /* For preview absolute positioning */
}