/* Base Styles & Variables */
:root {
    --bg-color: #0d0f14;
    --panel-bg: rgba(26, 28, 35, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent-color: #ff3b0a;
    --accent-hover: #e63509;
    --success-color: #10b981;
    --error-color: #ef4444;
    --chat-user-bg: #ff3b0a;
    --chat-ai-bg: rgba(45, 55, 72, 0.85);
    --font-family: 'Inter', sans-serif;
    --blur-amt: 20px;
}

.logo-white {
    filter: brightness(0) invert(1);
    transition: opacity 0.3s ease;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.role-admin {
    background: var(--accent-color);
    color: white;
}

.role-employee {
    background: #4b5563;
    color: white;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: #050608;
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 59, 10, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(255, 122, 13, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 59, 10, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(255, 122, 13, 0.05) 0px, transparent 50%);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(var(--blur-amt));
    -webkit-backdrop-filter: blur(var(--blur-amt));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Authentication Overlay */
.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    /* Darken bg slightly more for overlay */
}

.login-box {
    text-align: center;
    padding: 40px;
}

.login-box h2 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff3b0a, #ff7a0d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.google-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: white;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.google-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.google-login-btn img {
    width: 20px;
}


/* App Container Layout */
.app-container {
    display: flex;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    gap: 20px;
}

.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.role-selector {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.role-selector label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.role-selector select {
    width: 100%;
    padding: 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    outline: none;
    font-family: var(--font-family);
}

.mt-2 {
    margin-top: 20px;
}

.secondary-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.agent-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: white;
}

.ai-avatar {
    background: linear-gradient(135deg, #ff3b0a, #ff7a0d);
    box-shadow: 0 4px 15px rgba(255, 59, 10, 0.4);
}

.user-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
}

.chat-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    display: inline-block;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 15px;
    max-width: 80%;
    margin-bottom: 25px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

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

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-message .bubble {
    background: linear-gradient(135deg, var(--accent-color), #ff7a0d);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .bubble {
    background: var(--chat-ai-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

#advanced-settings {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-sm {
    font-size: 0.8rem;
}

.suggestions {
    padding: 10px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    min-height: 45px;
}

.suggestion-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 4px 15px rgba(255, 59, 10, 0.3);
}

.chat-input-container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

#chat-form {
    display: flex;
    gap: 10px;
}

#message-input {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#message-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 59, 10, 0.15);
}

#send-btn,
.mic-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, transform 0.2s;
}

.mic-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.mic-btn.active {
    background: #ef4444;
    color: white;
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

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

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: var(--chat-ai-bg);
    border-radius: 18px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 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 typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}