/* Root variables */
:root {
    --bs-primary: #5d87ff;
    --bs-secondary: #49beff;
    --bs-success: #13deb9;
    --bs-danger: #fa896b;
    --bs-warning: #ffae1f;
    --bs-info: #539bff;
    --bs-dark: #2a3547;
}

/* Gradients */
.bg-gradient-primary {
    background: linear-gradient(135deg, #5d87ff 0%, #4570ea 100%);
    box-shadow: 0 7px 22px rgba(93, 135, 255, 0.15);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #49beff 0%, #1e99d6 100%);
    box-shadow: 0 7px 22px rgba(73, 190, 255, 0.15);
}

/* Sidebar */
.sidebar {
    background-color: #f8f9fb;
    flex-shrink: 0;
    width: 260px;
    min-width: 260px;
    transition: all 0.3s ease;
}

.sidebar .nav-link {
    color: #5f6368;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(93, 135, 255, 0.08);
    color: var(--bs-primary);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, #5d87ff 0%, #4570ea 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(93, 135, 255, 0.25);
}

/* Cards */
.card {
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: rgba(145, 158, 171, 0.3) 0px 0px 2px 0px,
        rgba(145, 158, 171, 0.18) 0px 16px 32px -4px;
}

/* Message Layout */
.message {
    display: flex !important;
    flex-direction: row !important;
    margin-bottom: 1.5rem;
    gap: 1rem;
    align-items: flex-end;
    width: 100%;
}

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

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

/* Chat message bubbles (Gemini Style) */
.message .bubble {
    max-width: 80%;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.user .bubble {
    background: #f0f4f9;
    color: #1f2937;
    border-radius: 22px 22px 4px 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message.assistant .bubble {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 22px 22px 22px 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* Avatar styles with icons */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.avatar-user {
    background: linear-gradient(135deg, #49beff 0%, #1e99d6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(73, 190, 255, 0.25);
}

.avatar-assistant, .message.assistant .avatar {
    background: linear-gradient(135deg, #5d87ff 0%, #4570ea 100%);
    color: white !important;
    box-shadow: 0 4px 12px rgba(93, 135, 255, 0.25);
}
.avatar-assistant i, .message.assistant .avatar i {
    color: white !important;
}

/* Custom scrollbar */
#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#chatMessages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Input field */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(93, 135, 255, 0.15);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #5d87ff 0%, #4570ea 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(93, 135, 255, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4570ea 0%, #3861d8 100%);
    box-shadow: 0 6px 16px rgba(93, 135, 255, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, #49beff 0%, #1e99d6 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(73, 190, 255, 0.25);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1e99d6 0%, #0d85c1 100%);
    box-shadow: 0 6px 16px rgba(73, 190, 255, 0.35);
    color: white;
}

/* Logo box - Global styling for consistent logo across all pages */
.logo-box {
    background: linear-gradient(135deg, #5d87ff 0%, #4570ea 100%);
    box-shadow: 0 4px 12px rgba(93, 135, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

/* Border colors */
.border-end {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.border-bottom {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.border-top {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Icon-only Sidebar Styles */
.sidebar-icon-only {
    width: 80px !important;
    min-width: 80px !important;
}

.sidebar-icon-only .nav-text {
    display: none !important;
}

.sidebar-icon-only .logo-container {
    justify-content: center !important;
}

.sidebar-icon-only .logo-container .logo-box {
    margin: 0 auto;
}

.sidebar-icon-only .nav-link {
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: flex;
    justify-content: center;
}

.sidebar-icon-only .transition-icon {
    margin-right: 0 !important;
    font-size: 1.25rem;
}