/* Chat page styles - Side-by-Side Layout */
.chat-content {
    padding-top: 80px;
    min-height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: var(--background-color);
}

.chat-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem;
    background: var(--glass-bg);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    display: flex;
    height: calc(100vh - 200px);
    overflow: hidden;
}

/* Sidebar (Left Panel) */
.chat-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--background-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.chat-sidebar-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
}

.chat-sidebar-header p {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mode-card:hover {
    background: rgba(217, 119, 87, 0.1);
    border-color: rgba(217, 119, 87, 0.2);
}

.mode-card.active {
    background: rgba(217, 119, 87, 0.15);
    border-color: var(--primary-color);
}

.mode-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(217, 119, 87, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.mode-card.active .mode-icon {
    background: var(--primary-color);
    color: white;
}

.mode-info h3 {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.mode-info p {
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.8rem;
}

/* Chat Tips */
.chat-tips {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.chat-tips h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-tips li {
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.chat-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Main Chat Area (Right Panel) */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-main .chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.chat-main .chat-header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.chat-main .chat-header p {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

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

.message {
    max-width: 70%;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    animation: messageAppear 0.3s ease;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
}

.message.ai {
    align-self: flex-start;
    background: var(--background-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* Input Area */
.chat-input-container {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--background-secondary);
}

#chat-input {
    flex: 1;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: var(--text-color);
    resize: none;
    max-height: 120px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    min-height: 45px;
}

#chat-input:focus {
    outline: 1px solid var(--primary-color);
}

#send-button {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    min-height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.1s ease;
    flex-shrink: 0;
    position: relative;
}

#send-button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

#send-button.stop {
    background: var(--primary-color);
}

#send-button.stop::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 3px;
    transition: all 0.1s ease;
}

#send-button.stop:hover::before {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.9);
}

#send-button i {
    color: white;
    font-size: 1.1rem;
    transition: all 0.1s ease;
}

#send-button.stop i {
    display: none;
}

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

/* Scrollbar styles */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 87, 0.3);
    border-radius: 3px;
}

/* Loading message styles */
.message.loading {
    background: var(--background-secondary);
    color: var(--primary-color);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Disabled button state */
#send-button:disabled {
    display: none;
}

/* Mobile responsive styles */
@media (max-width: 900px) {
    .chat-content {
        padding-top: 70px;
    }

    .chat-container {
        margin: 1rem;
        height: calc(100vh - 120px);
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        align-items: center;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .chat-sidebar-header {
        display: none;
    }

    .mode-selector {
        flex-direction: row;
        gap: 0.75rem;
    }

    .mode-card {
        flex: 1;
        padding: 0.75rem;
    }

    .mode-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .mode-info h3 {
        font-size: 0.85rem;
    }

    .mode-info p {
        display: none;
    }

    .chat-tips {
        display: none;
    }

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

    .chat-main .chat-header h1 {
        font-size: 1.2rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message {
        max-width: 85%;
        padding: 0.75rem 1rem;
    }

    .chat-input-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .mode-info {
        display: none;
    }

    .mode-card {
        justify-content: center;
    }
}
