/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #0a0a0a;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 1100px;
    height: 100vh;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    justify-content: center;
    align-items: center;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Chat started state - switch to normal layout */
.chat-container.chat-started {
    justify-content: flex-start;
    align-items: stretch;
}

/* Subtle background gradient overlay */
.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

/* Welcome Screen Wrapper - absolutely centered */
.welcome-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    text-align: center;
    opacity: 1;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    pointer-events: none;
}

.chat-container.chat-started .welcome-message {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-30px);
}

.welcome-title {
    font-size: 56px;
    font-weight: 300;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    padding: 0;
    animation: fadeInScale 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInInput {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Header */
.chat-header {
    background: linear-gradient(to bottom, #0a0a0a 60%, #0a0a0a 20%, transparent 100%);
    color: #ffffff;
    padding: 0 0 40px 0;
    border-bottom: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    opacity: 1;
    transition: all 0.3s;
    height: auto;
    display: flex;
    align-items: flex-start;
}

/* Adjust header when sidebar is open */
.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 16px 0 16px;
    transition: padding-left 0.3s;
}

/* Hide main header logo when sidebar is open */
.app-container.sidebar-open .header-content-inner {
    display: none;
}

.app-container.sidebar-open .header-content {
    padding-left: 16px;
}

.header-nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.app-container.sidebar-open .header-nav-group {
    opacity: 0;
    pointer-events: none;
}

.header-content-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 36px;
    width: auto;
    filter: invert(1);
    object-fit: contain;
}

.header-logo {
    height: 42px;
    width: auto;
    filter: invert(1);
    object-fit: contain;
}

.header-name {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.2px;
}

.chat-header h1 {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 0;
    letter-spacing: -0.3px;
    color: #ffffff;
}

.chat-header .subtitle {
    font-size: 13px;
    opacity: 0.4;
    font-weight: 300;
    letter-spacing: 0.2px;
    color: #ffffff;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 120px 40px 200px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: transparent;
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    transition: max-width 0.3s, padding 0.3s;
    scroll-padding-top: 120px;
    scroll-padding-bottom: 200px;
}

.app-container.sidebar-open .messages-container {
    max-width: 800px;
    padding-left: 24px;
    padding-right: 24px;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Message Bubbles */
.message {
    display: flex;
    margin-bottom: 0;
    gap: 12px;
    width: 100%;
}

.user-message {
    animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gemini-style fade in from top-left to bottom-right */
.gemini-fade-in {
    animation: geminiReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes geminiReveal {
    0% {
        opacity: 0;
        clip-path: inset(0 100% 100% 0);
    }
    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

.message-content {
    flex: 1;
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    line-height: 1.7;
    font-size: 15px;
    white-space: pre-wrap; /* Preserve whitespace and line breaks from Claude */
    word-wrap: break-word;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    margin-left: auto;
    padding: 12px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.assistant-message .message-content {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    padding: 16px 0;
}

/* Markdown formatting in assistant messages */
.assistant-message .message-content h1,
.assistant-message .message-content h2,
.assistant-message .message-content h3 {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.assistant-message .message-content h1 { font-size: 1.5em; }
.assistant-message .message-content h2 { font-size: 1.3em; }
.assistant-message .message-content h3 { font-size: 1.1em; }

.assistant-message .message-content p {
    margin-bottom: 1em;
}

.assistant-message .message-content ul,
.assistant-message .message-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.assistant-message .message-content li {
    margin-bottom: 0.5em;
}

.assistant-message .message-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.assistant-message .message-content pre {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.assistant-message .message-content pre code {
    background: transparent;
    padding: 0;
}

.assistant-message .message-content strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.assistant-message .message-content em {
    font-style: italic;
}

.assistant-message .message-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    padding-left: 16px;
    margin-left: 0;
    margin-bottom: 1em;
    color: rgba(255, 255, 255, 0.6);
}

.assistant-message .message-content a {
    color: rgba(120, 119, 198, 0.9);
    text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 0;
    background: transparent;
    border: none;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Input Container - positioned below welcome message initially */
.input-container {
    padding: 0;
    background: transparent;
    border-top: none;
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    max-width: 520px;
    width: 100%;
    flex-shrink: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    animation: fadeInInput 0.8s cubic-bezier(0.16, 1, 0.3, 1) 2.2s forwards;
}

/* Input container when chat started - moves to bottom */
.chat-container.chat-started .input-container {
    padding: 40px 40px 32px 40px;
    max-width: 900px;
    margin: 0 auto;
    border-top: none;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    animation: none;
    opacity: 1;
    transition: max-width 0.3s, padding 0.3s;
    background: linear-gradient(to top, #0a0a0a 70%, #0a0a0a 30%, transparent 100%);
    pointer-events: none;
}

.app-container.sidebar-open .chat-container.chat-started .input-container {
    max-width: 800px;
    padding-left: 24px;
    padding-right: 24px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 12px 12px 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    pointer-events: auto;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    opacity: 0;
    pointer-events: none;
    border-radius: 12px;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3),
                0 4px 16px rgba(255, 255, 255, 0.1);
}

.input-wrapper:focus-within::before {
    animation: borderShoot 0.8s ease-out forwards;
}

@keyframes borderShoot {
    0% {
        opacity: 1;
        top: 0;
        left: 0;
        width: 0;
        height: 2px;
    }
    25% {
        opacity: 1;
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
    }
    26% {
        opacity: 1;
        top: 0;
        left: auto;
        right: 0;
        width: 2px;
        height: 0;
    }
    50% {
        opacity: 1;
        top: 0;
        left: auto;
        right: 0;
        width: 2px;
        height: 100%;
    }
    51% {
        opacity: 1;
        top: auto;
        bottom: 0;
        right: 0;
        left: auto;
        width: 0;
        height: 2px;
    }
    75% {
        opacity: 1;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 2px;
    }
    76% {
        opacity: 1;
        top: auto;
        bottom: 0;
        left: 0;
        width: 2px;
        height: 0;
    }
    100% {
        opacity: 0;
        top: 0;
        bottom: auto;
        left: 0;
        width: 2px;
        height: 100%;
    }
}

#messageInput {
    flex: 1;
    resize: none;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.2s;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    align-items: center;
}

#messageInput:focus {
    outline: none;
}

#messageInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.send-button {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
}

.send-button:active:not(:disabled) {
    transform: scale(0.92);
}

.send-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.04);
}

/* Active state when input has text */
.input-wrapper:has(#messageInput:not(:placeholder-shown)) .send-button:not(:disabled) {
    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
}

.input-wrapper:has(#messageInput:not(:placeholder-shown)) .send-button:hover:not(:disabled) {
    background: #ffffff;
}

.send-button svg {
    width: 18px;
    height: 18px;
}

.input-info {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

/* Show hint when chat not started */
.chat-container:not(.chat-started) .input-info {
    opacity: 0;
}

.hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.3px;
}

/* Error State */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(252, 165, 165, 0.9);
    padding: 14px 18px;
    border-radius: 12px;
    margin: 8px 0;
    font-size: 13px;
    letter-spacing: 0.2px;
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .chat-container {
        height: 100vh;
        max-height: none;
        max-width: 100%;
    }

    .welcome-title {
        font-size: 36px;
        padding: 0 24px;
        letter-spacing: -1px;
    }

    .welcome-message {
        margin-bottom: 40px;
    }

    .chat-header {
        padding: 16px 12px;
        height: 60px;
    }

    .header-content {
        padding: 12px;
        gap: 12px;
    }

    .header-nav-group {
        padding-right: 12px;
    }

    .header-logo {
        height: 28px;
    }

    .header-name {
        font-size: 14px;
    }

    .sidebar-logo {
        height: 28px;
    }

    .sidebar-brand-name {
        font-size: 14px;
    }

    .chat-header h1 {
        font-size: 20px;
    }

    .chat-header .subtitle {
        font-size: 12px;
    }

    .messages-container {
        padding: 120px 20px 200px 20px;
        gap: 20px;
        max-width: 100%;
        scroll-padding-top: 120px;
        scroll-padding-bottom: 200px;
    }

    .app-container.sidebar-open .messages-container {
        max-width: 100%;
    }

    .message-content {
        max-width: 90%;
        font-size: 15px;
    }

    .input-container {
        padding: 0 20px;
        max-width: 100%;
    }

    .chat-container.chat-started .input-container {
        padding: 30px 20px 24px 20px;
        max-width: 100%;
    }

    .app-container.sidebar-open .chat-container.chat-started .input-container {
        max-width: 100%;
    }

    .input-wrapper {
        gap: 10px;
        padding: 10px 10px 10px 16px;
    }

    #messageInput {
        font-size: 16px;
    }

    .send-button {
        width: 30px;
        height: 30px;
    }

    .send-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============= Authentication Modal ============= */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex; /* Show by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-modal.hidden {
    display: none; /* Hide when authenticated */
}

.auth-modal-content {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* Auth Branding */
.auth-branding {
    position: fixed;
    top: 32px;
    left: 32px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-modal.hidden + .auth-branding,
.auth-modal.hidden ~ .auth-branding {
    display: none;
}

.auth-logo {
    height: 140px;
    width: auto;
    object-fit: contain;
    filter: invert(1);
}

.auth-brand-name {
    font-size: 26px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-brand-tagline {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    letter-spacing: 0.3px;
}

.auth-modal-content h2 {
    font-size: 24px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.auth-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-submit-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
    background: #ffffff;
    transform: translateY(-1px);
}

.auth-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(252, 165, 165, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 16px;
}

.auth-success {
    display: none;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: rgba(134, 239, 172, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 16px;
}

.auth-toggle {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.auth-toggle-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 6px;
    text-decoration: underline;
    transition: color 0.2s;
}

.auth-toggle-btn:hover {
    color: #ffffff;
}

/* ============= App Layout with Sidebar ============= */
.app-container {
    display: none; /* Hidden by default, shown after login */
    width: 100%;
    height: 100vh;
    background: #0a0a0a;
    position: relative;
}

.app-container.authenticated {
    display: block;
}

/* Top Navigation Buttons */
.top-nav-buttons {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
    display: none;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.2s;
    padding-right: 16px;
}

.top-nav-buttons::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Hide top nav buttons when sidebar is open */
.app-container.sidebar-open .top-nav-buttons {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-toggle-btn svg {
    display: block;
}

/* New Chat Button (Collapsed State) */
.new-chat-btn-collapsed {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

.new-chat-btn-collapsed:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.new-chat-btn-collapsed svg {
    display: block;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(15, 15, 15, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.sidebar-open .sidebar {
    transform: translateX(0);
}

/* Sidebar Branding */
.sidebar-branding {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    height: 32px;
    width: auto;
    filter: invert(1);
    object-fit: contain;
}

.sidebar-brand-name {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.2px;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.new-conversation-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.new-conversation-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.conversations-empty {
    padding: 24px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
}

.conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.conversation-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.conversation-title {
    flex: 1;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.conversation-item:hover .conversation-delete-btn {
    opacity: 1;
}

.conversation-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: rgba(252, 165, 165, 0.9);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px;
}

.user-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-info {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.user-email {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    word-break: break-all;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 10px 16px;
    color: rgba(252, 165, 165, 0.9);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.app-container.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Update chat container to work within app layout */
.app-container .chat-container {
    width: 100%;
    height: 100vh;
    max-width: none;
}

/* Mobile responsiveness for sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: 85%;
        max-width: 320px;
    }

    .app-container.sidebar-open .header-content {
        padding-left: 0;
    }

    .auth-modal-content {
        margin: 20px;
        padding: 32px 24px;
        max-width: 100%;
    }

    .auth-logo {
        height: 100px;
        width: auto;
    }

    .auth-branding {
        top: 20px;
        left: 20px;
    }

    .auth-modal-content h2 {
        font-size: 22px;
    }
}
