:root {
    /* Light Theme Colors - ChatGPT Style */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #ececf1;
    --text-primary: #202123;
    --text-secondary: #6e6e80;
    --text-tertiary: #8e8ea0;
    --border-light: #d9d9e3;
    --border-medium: #c5c5d2;
    
    --accent-primary: #19c37d;
    --accent-hover: #16a869;
    --accent-light: #e7f7ef;
    
    --sidebar-bg: #f9f9f9;
    --sidebar-item-hover: #ececf1;
    
    --message-user-bg: #f7f7f8;
    --message-ai-bg: #ffffff;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: var(--bg-secondary);
}

.new-chat-btn i {
    font-size: 16px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-item:hover {
    background: var(--sidebar-item-hover);
}

.chat-item.active {
    background: var(--sidebar-item-hover);
    font-weight: 500;
}

.sidebar-footer {
    border-top: 1px solid var(--border-light);
    padding: 12px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.sidebar-link:hover {
    background: var(--sidebar-item-hover);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.user-info:hover {
    background: var(--sidebar-item-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-plan {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.chat-header {
    height: 60px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    background: var(--bg-primary);
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.guest-badge {
    padding: 4px 10px;
    background: var(--accent-light);
    color: var(--accent-primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ============ CHAT CONTAINER ============ */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

/* ============ WELCOME SCREEN ============ */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 20px;
}

.welcome-content {
    max-width: 800px;
    text-align: center;
}

.logo-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--accent-primary), #16a869);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 40px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.suggestion-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.suggestion-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.suggestion-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ============ MESSAGES ============ */
.messages-list {
    display: flex;
    flex-direction: column;
}

.message {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.message.user-message {
    background: var(--message-user-bg);
}

.message.ai-message {
    background: var(--message-ai-bg);
}

.message-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.message.user-message .message-avatar {
    background: var(--accent-primary);
    color: white;
}

.message.ai-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-primary), #16a869);
    color: white;
}

.message-content {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.message-content p {
    margin-bottom: 12px;
}

.message-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* ============ INPUT AREA ============ */
.input-area {
    padding: 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.input-container:focus-within {
    border-color: var(--text-tertiary);
    box-shadow: var(--shadow-md);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    background: transparent;
    color: var(--text-primary);
}

#messageInput::placeholder {
    color: var(--text-tertiary);
}

#messageInput::-webkit-scrollbar {
    width: 6px;
}

#messageInput::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--text-primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--accent-primary);
}

.send-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.input-footer {
    max-width: 800px;
    margin: 12px auto 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .welcome-content h1 {
        font-size: 24px;
    }
    
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
    
    .message-wrapper {
        padding: 0 16px;
    }
}

/* ============ LOADING ============ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Send button başlangıç durumu */
.send-btn {
    opacity: 0.4;
    transition: all 0.2s ease;
}

.send-btn:not(:disabled) {
    opacity: 1;
}

/* Mobile overlay */
@media (max-width: 768px) {
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}