/* Jodi - Employee Assistant | Modern Chat UI */

:root {
    /* Brand colors - warm, energetic for climbing gym */
    --primary: #e85d04;
    --primary-dark: #dc2f02;
    --primary-light: #f48c06;

    /* Neutral colors */
    --bg-dark: #1a1a2e;
    --bg-sidebar: #16213e;
    --bg-main: #f8f9fa;
    --bg-white: #ffffff;

    /* Text colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #adb5bd;
    --text-white: #ffffff;
    --text-sidebar: #e9ecef;

    /* Accents */
    --success: #2ecc71;
    --error: #e74c3c;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);

    /* Sizing */
    --sidebar-width: 280px;
    --header-height: 70px;
    --input-height: 80px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
}

/* App Layout */
.app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.nav-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.nav-section + .nav-section {
    margin-top: 1.5rem;
}

/* Dropdown Toggle Header */
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.2s;
    user-select: none;
}

.nav-dropdown-toggle:hover {
    color: var(--text-white);
}

.dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    color: var(--text-light);
}

.nav-dropdown-toggle.collapsed .dropdown-arrow {
    transform: rotate(-90deg);
}

/* Dropdown Content */
.nav-dropdown-content {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease-out, opacity 0.2s ease;
    opacity: 1;
}

.nav-dropdown-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-sidebar);
    text-decoration: none;
    transition: all 0.2s;
    /* Button reset for when used on <button> elements */
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(232, 93, 4, 0.2);
    color: var(--primary-light);
}

.explorer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-sidebar);
    cursor: default;
    transition: background 0.2s;
}

.sidebar-nav li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-icon {
    font-size: 1.1rem;
}

/* Add Knowledge Link */
.add-knowledge-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition: all 0.2s ease;
}

.add-knowledge-link:hover {
    border-color: var(--primary);
    background: rgba(232, 93, 4, 0.1);
}

.add-knowledge-icon {
    color: var(--text-light);
    flex-shrink: 0;
    transition: color 0.2s;
}

.add-knowledge-link:hover .add-knowledge-icon {
    color: var(--primary-light);
}

.add-knowledge-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.add-knowledge-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sidebar);
}

.add-knowledge-hint {
    font-size: 0.75rem;
    color: var(--text-light);
}

.add-knowledge-arrow {
    color: var(--text-light);
    opacity: 0.5;
    transition: all 0.2s;
}

.add-knowledge-link:hover .add-knowledge-arrow {
    opacity: 1;
    color: var(--primary-light);
    transform: translateX(2px);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--text-light);
    transition: background 0.3s;
}

.status-dot.online {
    background: var(--success);
}

.status-dot.error {
    background: var(--error);
}

#status-text {
    font-size: 0.8rem;
    color: var(--text-light);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.logout-btn .nav-icon {
    font-size: 1rem;
}

.chunk-count {
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.chunk-count #chunk-count {
    font-weight: 600;
    color: var(--primary);
}

.powered-by {
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.7;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-main);
}

/* Chat Header */
.chat-header {
    height: var(--header-height);
    padding: 0 1.5rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-title p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Header Actions Group */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Model Selector */
.model-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

#model-select {
    padding: 0.4rem 0.75rem;
    padding-right: 1.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    min-width: 140px;
}

#model-select:hover {
    border-color: var(--primary-light);
}

#model-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.1);
}

/* Session Cost Display */
.session-cost {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.session-cost .cost-tokens {
    color: var(--text-secondary);
}

.session-cost .cost-separator {
    color: var(--border);
}

.session-cost .cost-amount {
    color: var(--primary);
    font-weight: 500;
}

.new-chat-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: var(--bg-main);
    color: var(--primary);
    border-color: var(--primary);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Welcome Message */
.welcome-message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    max-width: 700px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.welcome-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.welcome-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.welcome-content > p {
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Quick Questions */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-label {
    width: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.quick-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(232, 93, 4, 0.05);
}

/* Chat Messages */
.message {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.message.user .message-avatar {
    background: var(--bg-sidebar);
    color: white;
}

.message-content {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    max-width: 600px;
}

.message.assistant .message-content {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.message.user .message-content {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.message-content p {
    margin-bottom: 0.75rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul, .message-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin-bottom: 0.5rem;
}

.message-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
}

.message.user .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.message-content a {
    color: var(--primary);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message.user .message-content a {
    color: white;
    text-decoration: underline;
}

/* Feedback Buttons */
.feedback-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.feedback-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.feedback-label.submitted {
    color: var(--success);
}

.feedback-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(232, 93, 4, 0.05);
}

.feedback-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

.feedback-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.feedback-btn.selected[data-rating="up"] {
    background: var(--success);
    border-color: var(--success);
}

.feedback-btn.selected[data-rating="down"] {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
}

/* Sources */
.sources {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.sources-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sources ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sources li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.sources li::before {
    content: "";
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

.sources a {
    color: var(--primary);
    text-decoration: none;
}

.sources a:hover {
    text-decoration: underline;
}

.source-score {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
    cursor: help;
}

/* Attribution Sources */
.attribution-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.attribution-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.attribution-analyst {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.attribution-gate {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.attribution-editor {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Loading Message */
.message.loading .message-content {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: var(--radius-full);
    animation: bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Error Message */
.message.error .message-content {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error);
}

/* Input Area */
.input-area {
    padding: 1rem 1.5rem 1.5rem;
    background: var(--bg-main);
    border-top: 1px solid var(--border);
}

#chat-form {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

#message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    padding: 0.5rem;
    background: transparent;
}

#message-input::placeholder {
    color: var(--text-light);
}

#send-button {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#send-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

#send-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.5rem;
}

/* Scrollbar */
.messages-container::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* ============================================
   Shared Login Modal (auth.js)
   ============================================ */
.login-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.login-modal-overlay.active {
    display: flex;
}

.login-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-modal-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.login-form-group input {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.login-error {
    display: none;
    padding: 0.75rem 1rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.875rem;
}

.login-submit-btn {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.3);
}

.login-submit-btn:active {
    transform: translateY(0);
}

/* Microsoft Sign-in Button */
.login-content {
    padding: 0;
}

.microsoft-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #ffffff;
    border: 1px solid #8c8c8c;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: #5e5e5e;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.microsoft-login-btn:hover {
    background: #f3f3f3;
    border-color: #666;
}

.microsoft-login-btn:active {
    background: #e5e5e5;
}

.microsoft-logo {
    flex-shrink: 0;
}

.login-help {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
    }

    .chat-area {
        width: 100%;
    }

    .welcome-message {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin: 1rem;
        padding: 1rem;
    }

    .welcome-content h2 {
        font-size: 1.25rem;
    }

    .quick-questions {
        justify-content: center;
    }

    .message {
        gap: 0.75rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .message-content {
        padding: 0.875rem 1rem;
    }

    .input-area {
        padding: 0.75rem 1rem 1rem;
    }

    .input-hint {
        display: none;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}

/* Clarifying Question Options */
.clarifying-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.option-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(232, 93, 4, 0.05);
    color: var(--primary);
}

.option-btn:disabled,
.option-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-main);
}

.option-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Mobile adjustments for option buttons */
@media (max-width: 768px) {
    .clarifying-options {
        gap: 0.4rem;
    }

    .option-btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }
}

/* Dig Deeper Section */
.dig-deeper-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.dig-deeper-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.dig-deeper-section .clarifying-options {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* ===============================================
   EA CONFIRMATION BUTTONS
   =============================================== */

.ea-confirmation-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.ea-confirm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.ea-confirm-yes {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.ea-confirm-yes:hover:not(:disabled) {
    background: #2e7d32;
    border-color: #2e7d32;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.ea-confirm-no {
    background: white;
    color: var(--error);
    border-color: var(--error);
}

.ea-confirm-no:hover:not(:disabled) {
    background: rgba(211, 47, 47, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.2);
}

.ea-confirm-btn:disabled,
.ea-confirm-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.ea-confirm-btn.selected {
    opacity: 1;
}

.ea-confirm-yes.selected {
    background: #1b5e20;
    border-color: #1b5e20;
}

.ea-confirm-no.selected {
    background: rgba(211, 47, 47, 0.2);
    border-color: #b71c1c;
    color: #b71c1c;
}

.ea-confirm-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Mobile adjustments for EA confirmation buttons */
@media (max-width: 768px) {
    .ea-confirmation-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ea-confirm-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        width: 100%;
    }
}

/* ===============================================
   DEBUG PANEL STYLES
   =============================================== */

/* Main content wrapper for split layout */
.main-content {
    flex: 1;
    display: flex;
    min-width: 0;
    overflow: hidden;
}

.main-content .chat-area {
    flex: 1;
    min-width: 0;
}

/* Debug Panel */
.debug-panel {
    width: 550px;
    background: var(--bg-dark);
    color: var(--text-sidebar);
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.debug-panel.open {
    display: flex;
}

.debug-header {
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.debug-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    margin: 0;
}

.debug-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.debug-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
}

.debug-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.debug-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.debug-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

.debug-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.debug-box.expandable {
    max-height: 300px;
}

.debug-box pre {
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-light);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* Processing Steps */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.step.active {
    background: rgba(232, 93, 4, 0.15);
    border-left: 3px solid var(--primary);
}

.step.completed {
    background: rgba(46, 204, 113, 0.1);
    opacity: 0.7;
}

.step.completed .step-icon::after {
    content: "✓";
    font-size: 0.6rem;
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon {
    position: relative;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-sidebar);
}

.step.active .step-text {
    color: var(--text-white);
    font-weight: 500;
}

.step-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-light);
}

/* Timing Grid */
.timing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.timing-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.timing-label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.timing-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-light);
}

/* Loading Status Indicator */
.loading-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(232, 93, 4, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.loading-text .step-name {
    font-weight: 500;
    color: var(--primary);
}

/* Debug Panel Scrollbar */
.debug-content::-webkit-scrollbar,
.debug-box::-webkit-scrollbar {
    width: 6px;
}

.debug-content::-webkit-scrollbar-track,
.debug-box::-webkit-scrollbar-track {
    background: transparent;
}

.debug-content::-webkit-scrollbar-thumb,
.debug-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Mobile - hide debug panel */
@media (max-width: 1024px) {
    .debug-panel {
        display: none !important;
    }

    #toggle-debug-btn {
        display: none;
    }
}

/* ===============================================
   ONENOTE AUTH CODE COPY BUTTON
   =============================================== */

.onenote-auth-code {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white !important;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    user-select: all;
    position: relative;
}

.onenote-auth-code:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.4);
}

.onenote-auth-code:active {
    transform: scale(0.98);
}

.onenote-auth-code.copied {
    background: var(--success);
}

.onenote-auth-code::after {
    content: " (click to copy)";
    font-size: 0.7em;
    opacity: 0.8;
    letter-spacing: 0;
    font-weight: 400;
}
