/* Neural Chat AI Concept - Generated by Pony Alpha */
:root {
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --warning: #f59e0b;
    --bg-primary: #0c0c14;
    --bg-secondary: #12121c;
    --bg-tertiary: #1a1a28;
    --bg-card: #15151f;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --glass-bg: rgba(139, 92, 246, 0.05);
    --glass-border: rgba(139, 92, 246, 0.1);
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-glow: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Back to Gallery Button */
.back-to-gallery {
    position: fixed;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 50px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.back-to-gallery:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary-light);
    border-color: rgba(139, 92, 246, 0.4);
}

.back-to-gallery svg {
    transition: transform 0.2s ease;
}

.back-to-gallery:hover svg {
    transform: translateX(-3px);
}

/* Neural Network Background */
.neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

#neural-canvas {
    width: 100%;
    height: 100%;
}

/* Main Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    height: 100vh;
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(12, 12, 20, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-card);
    color: var(--primary-light);
    border-color: var(--primary);
}

.icon-btn.small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: messageIn 0.3s ease-out;
}

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar.ai {
    background: var(--gradient-primary);
    color: white;
}

.message-avatar.user {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.message-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.thinking-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--primary-light);
    animation: thinking 1.5s infinite;
}

@keyframes thinking {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.thinking-badge .dot {
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: dotPulse 1.5s infinite;
}

.thinking-badge .dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-badge .dot:nth-child(3) { animation-delay: 0.4s; }

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

.message-text {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.message.user .message-text {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
    border-color: rgba(139, 92, 246, 0.2);
    color: var(--text-primary);
}

.message-text p {
    margin-bottom: 0.75rem;
}

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

.message-text strong {
    color: var(--primary-light);
    font-weight: 600;
}

.message-text ol, .message-text ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.message-text li {
    margin-bottom: 0.5rem;
}

.message-text li strong {
    color: var(--accent);
}

/* Code Block */
.code-block {
    margin-top: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--glass-border);
}

.code-header span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-code {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-code:hover {
    background: var(--bg-card);
    color: var(--primary-light);
    border-color: var(--primary);
}

.code-block pre {
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: rgba(139, 92, 246, 0.3);
}

.action-btn.positive:hover {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Input Area */
.chat-input-area {
    padding: 1rem 1.5rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-actions {
    display: flex;
    gap: 0.25rem;
}

.input-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.input-btn:hover {
    background: var(--bg-card);
    color: var(--primary-light);
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    padding: 0.5rem;
    max-height: 120px;
    line-height: 1.5;
}

#message-input::placeholder {
    color: var(--text-muted);
}

#message-input:focus {
    outline: none;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding: 0 0.25rem;
}

.model-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--primary-light);
}

.disclaimer {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.conversation-item:hover {
    background: var(--bg-tertiary);
}

.conversation-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-light);
}

.conversation-item svg {
    flex-shrink: 0;
}

.conversation-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
}

.usage-stats {
    margin-bottom: 0.5rem;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.usage-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.usage-value {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.usage-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.3);
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 600px) {
    .chat-container {
        border: none;
    }

    .chat-header {
        padding: 0.75rem 1rem;
    }

    .logo-text {
        display: none;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message {
        max-width: 95%;
    }

    .chat-input-area {
        padding: 0.75rem 1rem 1rem;
    }
}
