@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Corporate Premium Palette */
    --primary-color: #0f172a;
    /* Slate 900 */
    --primary-hover: #1e293b;
    /* Slate 800 */
    --accent-color: #3b82f6;
    /* Blue 500 */
    --bg-color: #f8fafc;
    /* Slate 50 */
    --sidebar-bg: #0f172a;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: #1e293b;
    --chat-bg: #ffffff;
    --message-user-bg: #3b82f6;
    --message-user-text: #ffffff;
    --message-bot-bg: #f1f5f9;
    /* Slate 100 */
    --message-bot-text: #334155;
    /* Slate 700 */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #334155;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Jira Embedded Mode - Hide Sidebar */
body.jira-embedded .sidebar {
    display: none !important;
}

/* Sidebar */
.sidebar {
    width: 64px;
    /* Compact width */
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    z-index: 10;
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center content */
    gap: 0;
}

.sidebar-header h2 {
    display: none;
    /* Hide title */
}

/* Show a small logo or icon instead of title if needed, 
   but for now we'll just keep it empty or rely on nav icons */
.sidebar-header::after {
    content: "AI";
    font-weight: 700;
    color: white;
    font-size: 1.2rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center icons */
    padding: 0.875rem 0;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0;
    /* Hide text */
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--sidebar-hover);
    color: white;
}

.sidebar-nav i {
    margin-right: 0;
    /* Remove margin */
    width: auto;
    text-align: center;
    font-size: 1.25rem;
    /* Ensure icon size */
}

.sidebar-footer {
    padding: 1.5rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-weight: 500;
}

.user-info span {
    display: none;
    /* Hide username */
}

.user-info i {
    font-size: 1.5rem;
    margin-right: 0;
    color: #94a3b8;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0;
    /* Hide text */
    transition: color 0.2s;
    width: 100%;
}

.logout-btn:hover {
    color: #ef4444;
}

.logout-btn i {
    margin-right: 0;
    font-size: 1.25rem;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    position: relative;
}

.chat-header {
    padding: 1.25rem 2rem;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.messages-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.message.system {
    align-self: center;
    max-width: 100%;
    margin-bottom: 1rem;
}

.message .content {
    padding: 1rem 1.5rem;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.message.user .content {
    background-color: var(--message-user-bg);
    color: var(--message-user-text);
    border-bottom-right-radius: 4px;
    background-image: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.message.assistant .content {
    background-color: white;
    color: var(--message-bot-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message.system .content {
    background-color: transparent;
    color: #64748b;
    font-size: 0.875rem;
    text-align: center;
    box-shadow: none;
    border: 1px dashed var(--border-color);
}

/* Input Area */
.input-area {
    padding: 1.5rem 2rem;
    background-color: white;
    border-top: 1px solid var(--border-color);
}

#chat-form {
    display: flex;
    gap: 1rem;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

#message-input {
    flex: 1;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#chat-form button {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#chat-form button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Professional Table Styles */
.message table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-color);
}

.message th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.message td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: #334155;
    vertical-align: middle;
}

.message tr:last-child td {
    border-bottom: none;
}

.message tr:hover td {
    background-color: #f1f5f9;
    transition: background-color 0.15s ease;
}

/* Links in tables */
.message td a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.message td a:hover {
    text-decoration: underline;
}

/* Typing Indicator (Loader) */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}