/* ──────────────────────────────────────────────
   Design tokens & Variables
   ────────────────────────────────────────────── */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #faf9f6;
    --bg-glass: rgba(255, 255, 255, 0.75);
    
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #888888;
    
    --accent-blue: #0078d4;
    --accent-blue-light: #e6f0fa;
    --accent-blue-hover: #005a9e;
    --accent-blue-glow: rgba(0, 120, 212, 0.25);
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glass: rgba(255, 255, 255, 0.4);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 120, 212, 0.08);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sidebar-width: 320px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
}

/* ──────────────────────────────────────────────
   Reset & Base Styles
   ────────────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ──────────────────────────────────────────────
   Ambient Light Glows (Sleek Concept 1 feel)
   ────────────────────────────────────────────── */
.ambient-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

.glow-top-right {
    top: -150px;
    right: -150px;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.35) 0%, rgba(0, 120, 212, 0) 70%);
}

.glow-bottom-left {
    bottom: -200px;
    left: -200px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.25) 0%, rgba(0, 242, 254, 0) 70%);
}

/* ──────────────────────────────────────────────
   App Layout
   ────────────────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    width: 95vw;
    max-width: 1280px;
    height: 90vh;
    max-height: 850px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* ──────────────────────────────────────────────
   Left Sidebar Panel
   ────────────────────────────────────────────── */
.sidebar-panel {
    width: var(--sidebar-width);
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.45);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.profile-header {
    text-align: center;
    margin-bottom: 25px;
}

.avatar-container {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 15px auto;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.15);
}

.status-pulse-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    background-color: #2ec4b6;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(46, 196, 182, 0.7);
    animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(46, 196, 182, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 196, 182, 0);
    }
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.profile-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}

.decor-diamonds {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-top: 5px;
}

.profile-bio {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
}

.sidebar-actions {
    margin-bottom: 30px;
}

/* Glowing Accent Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-glowing {
    box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-footer p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.sidebar-footer .copyright {
    margin-top: 8px;
}

/* ──────────────────────────────────────────────
   Right Chat Panel
   ────────────────────────────────────────────── */
.chat-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.65);
    height: 100%;
}

.chat-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-bot-info h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bot-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #2ec4b6;
    box-shadow: 0 0 6px #2ec4b6;
}

.status-indicator.offline {
    background-color: #ff5252;
}

.btn-clear-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-clear-chat:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #ff5252;
}

/* ──────────────────────────────────────────────
   Chat Scroll Area
   ────────────────────────────────────────────── */
.chat-messages-container {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Individual Message Layout */
.message {
    display: flex;
    gap: 15px;
    max-width: 80%;
    animation: fadeInMsg 0.3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.message-content {
    background-color: #ffffff;
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 0.92rem;
    line-height: 1.5;
    border: 1px solid var(--border-color);
}

/* User Message specific alignment */
.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-user .message-avatar {
    background-color: var(--accent-blue);
    color: #ffffff;
}

.message-user .message-content {
    background-color: var(--accent-blue);
    color: #ffffff;
    border-radius: var(--border-radius-md) 0 var(--border-radius-md) var(--border-radius-md);
    border: none;
    box-shadow: var(--shadow-lg);
}

/* ──────────────────────────────────────────────
   Reasoning <think> Logs (Sleek collapsible block)
   ────────────────────────────────────────────── */
.thought-container {
    margin: 8px 0 12px 0;
    border-left: 2px solid var(--accent-blue);
    background-color: var(--bg-secondary);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    overflow: hidden;
}

.thought-header {
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.thought-header:hover {
    background-color: rgba(0, 120, 212, 0.05);
}

.thought-body {
    padding: 0 12px 10px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace, monospace;
    white-space: pre-wrap;
    line-height: 1.4;
    max-height: 180px;
    overflow-y: auto;
}

.thought-container.collapsed .thought-body {
    display: none;
}

.thought-header i {
    transition: transform 0.2s ease;
}

.thought-container.collapsed .thought-header i {
    transform: rotate(-90deg);
}

/* Markdown styling inside messages */
.message-content p {
    margin-bottom: 10px;
}
.message-content p:last-child {
    margin-bottom: 0;
}
.message-content strong {
    font-weight: 600;
}
.message-content ul, .message-content ol {
    margin: 10px 0 10px 20px;
}
.message-content li {
    margin-bottom: 4px;
}

/* ──────────────────────────────────────────────
   Suggestion Chips
   ────────────────────────────────────────────── */
.suggestion-container {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.suggestion-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px !important;
    font-weight: 500;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.suggestion-chip:hover {
    background-color: var(--accent-blue);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ──────────────────────────────────────────────
   Chat Input Form
   ────────────────────────────────────────────── */
.chat-input-container {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.45);
}

.chat-input-form {
    display: flex;
    gap: 12px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 6px 6px 16px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.chat-input-form:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.chat-input-form input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    color: var(--text-primary);
    background: transparent;
}

.btn-send {
    background-color: var(--accent-blue);
    color: #ffffff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-send:hover {
    background-color: var(--accent-blue-hover);
    transform: scale(1.05);
}

/* Loading Stream Animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    height: 10px;
    padding: 0 5px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ──────────────────────────────────────────────
   Responsive Styles
   ────────────────────────────────────────────── */
@media (max-width: 820px) {
    .app-container {
        flex-direction: column;
        height: 95vh;
        max-height: none;
    }
    
    .sidebar-panel {
        width: 100%;
        height: auto;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }

    .profile-header {
        text-align: left;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .avatar-container {
        width: 65px;
        height: 65px;
        margin: 0;
    }

    .decor-diamonds, .profile-bio, .sidebar-nav, .sidebar-footer {
        display: none;
    }

    .sidebar-actions {
        margin-bottom: 0;
        margin-left: auto;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .chat-panel {
        height: calc(100% - 105px);
    }
    
    .chat-messages-container {
        padding: 20px;
    }
    
    .message {
        max-width: 90%;
    }
}
