/* OnticBot Chat Interface Styles */
:root {
    --primary: #0066cc;
    --primary-dark: #004d99;
    --primary-light: #3388dd;
    --secondary: #00a86b;
    --accent: #ff6b35;
    --black: #0a0a0a;
    --white: #ffffff;
    --dark: #1a1a2e;
    --dark-light: #16213e;
    --dark-gray: #263036;
    --light-gray: #f6f6f6;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(0, 102, 204, 0.3);
    backdrop-filter: blur(10px);
}

.back-link {
    color: var(--white);
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 102, 204, 0.3);
    transition: var(--transition);
}

.back-link:hover {
    background-color: rgba(0, 102, 204, 0.1);
    border-color: var(--primary);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.bot-avatar {
    width: 45px;
    height: 45px;
    overflow: hidden;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-info h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.header-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

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

.header-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.header-btn:hover {
    background-color: rgba(0, 102, 204, 0.1);
    border-color: var(--primary);
}

/* Messages Area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}

.welcome-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-screen h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.welcome-screen > p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Suggestion Grid */
.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: var(--white);
    cursor: pointer;
    text-align: left;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
}

.suggestion-btn:hover {
    background-color: rgba(0, 102, 204, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.suggestion-btn i {
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tier-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: rgba(0, 168, 107, 0.1);
    border: 1px solid rgba(0, 168, 107, 0.3);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.tier-notice i {
    color: var(--secondary);
}

/* Messages List */
#messagesList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-avatar.user-avatar {
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-avatar.user-avatar i {
    color: var(--white);
    font-size: 1rem;
}

.message-content {
    padding: 1rem 1.25rem;
    line-height: 1.6;
}

.message.assistant .message-content {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: var(--white);
}

.message.user .message-content {
    background-color: var(--primary);
    color: var(--white);
}

/* Code Blocks in Messages */
.message-content pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.message-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
}

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

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 1rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 102, 204, 0.3);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Input Area */
.input-area {
    padding: 1rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(0, 102, 204, 0.3);
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    padding: 0.875rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 102, 204, 0.3);
    color: var(--white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    resize: none;
    max-height: 150px;
    transition: var(--transition);
}

.input-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.send-btn {
    width: 48px;
    height: 48px;
    background-color: var(--primary);
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 102, 204, 0.4);
}

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

.input-footer {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.75rem;
}

.input-footer a {
    color: var(--primary);
    text-decoration: none;
}

.input-footer a:hover {
    text-decoration: underline;
}

/* Floating Action Button */
.chat-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.4);
    transition: var(--transition);
    z-index: 1000;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 102, 204, 0.5);
}

.chat-fab i {
    color: var(--white);
    font-size: 1.5rem;
}

.chat-fab.hidden {
    display: none;
}

/* Error Message */
.error-message {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    padding: 1rem;
    margin: 1rem 0;
    color: #ff6b6b;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
    }

    .suggestion-grid {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 95%;
    }

    .welcome-screen {
        padding: 1rem;
    }

    .welcome-screen h2 {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--primary);
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
