:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --bg-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #606060;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #ffffff;
    --user-msg: #2a2a2a;
    --ai-msg: #1a1a1a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.hamburger {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

.hamburger.hidden {
    opacity: 0;
    pointer-events: none;
}

.hamburger:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.hamburger-line {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

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

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.sidebar-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sidebar-close:hover {
    background: var(--bg-hover);
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.new-chat-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.new-chat-btn:hover::before {
    width: 300px;
    height: 300px;
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.new-chat-icon {
    font-size: 18px;
    transition: transform 0.3s;
}

.new-chat-btn:hover .new-chat-icon {
    transform: rotate(90deg);
}

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

.chat-list::-webkit-scrollbar {
    width: 4px;
}

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

.chat-item {
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInLeft 0.3s ease-out;
    position: relative;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s;
    border-radius: 0 3px 3px 0;
}

.chat-item:hover::before {
    transform: scaleY(1);
}

.chat-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.chat-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chat-item.active::before {
    transform: scaleY(1);
}

.chat-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-delete {
    opacity: 0;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
    font-size: 16px;
    border-radius: 4px;
}

.chat-item:hover .chat-delete {
    opacity: 1;
}

.chat-delete:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.top-bar {
    padding: 16px 24px 16px 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.8);
}

.app-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.model-badge {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.message-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

.message-wrapper {
    margin-bottom: 24px;
    display: flex;
    animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.message-wrapper.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    transition: transform 0.2s;
}

.message-bubble:hover {
    transform: translateY(-2px);
}

.message-wrapper.user .message-bubble {
    background: linear-gradient(135deg, var(--user-msg) 0%, #323232 100%);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.message-wrapper.assistant .message-bubble {
    background: linear-gradient(135deg, var(--ai-msg) 0%, #1f1f1f 100%);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.message-bubble p {
    margin: 0 0 12px 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble strong {
    font-weight: 600;
    color: var(--accent);
}

.message-bubble code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-bubble pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-bubble pre code {
    background: none;
    padding: 0;
    border: none;
}

.message-bubble ul,
.message-bubble ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin: 6px 0;
}

.thinking-indicator {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.thinking-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6) translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1) translateY(-10px);
        opacity: 1;
    }
}

.input-area {
    padding: 20px 24px 32px;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    position: relative;
    z-index: 10;
}

.input-container {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 10px; 
}

.input-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 10px 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.input-field {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    line-height: 24px; 
    padding: 4px 0;
}

.input-field::placeholder {
    color: var(--text-tertiary);
}

.send-btn {
    width: 36px;
    height: 36px;
    background: #333333;
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.send-btn:hover:not(:disabled)::before {
    width: 100px;
    height: 100px;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.3);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 60px 24px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}


.empty-title {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 12px;
    background: #ffffff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-text {
    font-size: 15px;
    color: var(--text-secondary);
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    max-width: 700px;
    margin: 32px auto 0;
}

.suggestion-card {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.suggestion-card:hover {
    background: var(--bg-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.suggestion-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.suggestion-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float-particle 20s infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

.message-actions {
    opacity: 0;
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-left: 56px;
    transition: opacity 0.2s;
}

.message-wrapper:hover .message-actions {
    opacity: 1;
}

.action-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.action-icon:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}

.attach-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 18px;
}

.attach-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(45deg);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 8px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@media (max-width: 768px) {
    .top-bar {
        padding-left: 76px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .suggestions {
        grid-template-columns: 1fr;
    }
}
.hamburger:hover,
.sidebar-close:hover,
.new-chat-btn:hover,
.chat-item:hover,
.message-bubble:hover,
.suggestion-card:hover,
.action-icon:hover,
.input-wrapper:focus-within {
    transform: none !important;
    box-shadow: none !important;
}
.new-chat-btn:hover .new-chat-icon,
.send-btn:hover:not(:disabled),
.attach-btn:hover {
    transform: none !important;
}
.hamburger,
.sidebar-close,
.new-chat-btn,
.chat-item,
.model-badge,
.suggestion-card,
.action-icon,
.send-btn {
    border-radius: 8px !important; 
}
.message-wrapper.user .message-bubble,
.message-wrapper.assistant .message-bubble {
    border-radius: 12px !important;
}
.input-wrapper {
    border-radius: 10px !important;
}
.message-wrapper.user .message-bubble,
.message-wrapper.assistant .message-bubble {
    border-radius: 4px !important;
}
.send-btn {
    border-radius: 4px !important;
}
.send-btn {
    border-radius: 8px !important;
    width: 40px;
    height: 32px;
}
.message-wrapper.user .message-bubble,
.message-wrapper.assistant .message-bubble {
    border-radius: 8px !important;
}