/* Workspace Layout - After Login Sidebar and Grid */

/* Oceanic Intelligence Theme Variables */
:root {
    --theme-ocean-navy-deep: #0A192F;
    --theme-ocean-navy: #14213d;
    --theme-ocean-navy-light: #1e3a8a;
    --theme-ocean-teal: #10b981;
    --theme-ocean-accent: #f97316;
    --theme-ocean-accent-hover: #ea580c;
    
    --theme-ocean-bg-workspace: #f8fafc;
    --theme-ocean-bg-panel: #ffffff;
    
    --theme-ocean-text-primary: #1e293b;
    --theme-ocean-text-secondary: #64748b;
    --theme-ocean-border: #e2e8f0;
}

/* Tailwind Integration */
@import url('https://cdn.tailwindcss.com?plugins=forms,typography');

/* Workspace Grid Layout */
.workspace-layout {
    display: none; /* Hidden by default, shown when user is logged in */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theme-ocean-bg-workspace);
    z-index: 1000;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 64px 1fr;
    height: 100vh;
    width: 100vw;
    transition: grid-template-columns 0.3s ease;
}

.workspace-grid.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
}

/* Workspace Header */
.workspace-header {
    grid-column: 1 / 3;
    background: linear-gradient(90deg, var(--theme-ocean-navy-light) 0%, var(--theme-ocean-teal) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 50;
    transition: all 0.3s ease;
}

.workspace-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Sidebar Toggle Button */
.workspace-sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-sidebar-toggle:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.workspace-sidebar-toggle .material-symbols-outlined {
    font-size: 1.5rem;
}

.workspace-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workspace-logo-icon {
    position: relative;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-logo-icon .dot-1 {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #2563eb;
    border-radius: 50%;
    top: 0;
    left: 0;
}

.workspace-logo-icon .dot-2 {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #60a5fa;
    border-radius: 50%;
    bottom: 0;
    right: 0;
}

.workspace-logo-icon .dot-3 {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #1e40af;
    border-radius: 50%;
    top: 4px;
    right: 4px;
}

.workspace-logo-icon .ring {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1px solid #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-logo-icon .ring .center {
    width: 8px;
    height: 8px;
    background: #1e293b;
    border-radius: 50%;
}

.workspace-logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.workspace-logo-text .accent {
    color: #f97316;
}

.workspace-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 1.5rem;
}

.workspace-breadcrumb .current {
    color: #ffffff;
}

.workspace-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.workspace-header-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.workspace-header-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.workspace-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #fb923c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Sidebar */
.workspace-sidebar {
    background: var(--theme-ocean-navy-deep);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(0);
    opacity: 1;
}

.workspace-sidebar.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.sidebar-panel-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
}

/* Collapse Button (shown when sidebar expanded) */
.sidebar-collapse-btn {
    position: fixed;
    left: 260px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    border: none;
    border-radius: 0 0.375rem 0.375rem 0;
    color: #cbd5e1;
    cursor: pointer;
    padding: 1rem 0.375rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
}

.sidebar-collapse-btn:hover {
    background: #334155;
    padding-right: 0.5rem;
    opacity: 1;
}

.sidebar-collapse-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Hide collapse button when sidebar is collapsed */
.workspace-grid.sidebar-collapsed .sidebar-collapse-btn {
    display: none;
}

/* Expand Button (shown when sidebar collapsed) */
.sidebar-expand-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    border: none;
    border-radius: 0 0.375rem 0.375rem 0;
    color: #cbd5e1;
    cursor: pointer;
    padding: 1rem 0.375rem;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
}

.sidebar-expand-btn:hover {
    background: #334155;
    padding-right: 0.5rem;
    opacity: 1;
}

.sidebar-expand-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Show expand button when sidebar is collapsed */
.sidebar-collapsed .sidebar-expand-btn {
    display: flex;
}

.workspace-grid.sidebar-collapsed .sidebar-expand-btn {
    display: flex;
}

.sidebar-new-analysis {
    padding: 1.5rem 1rem;
    background: linear-gradient(180deg, var(--theme-ocean-navy-deep) 0%, rgba(15, 23, 42, 0.4) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-new-analysis-btn {
    width: 100%;
    background: var(--theme-ocean-accent);
    color: white;
    border: none;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.sidebar-new-analysis-btn:hover {
    background: var(--theme-ocean-accent-hover);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
    transform: translateY(-1px);
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    padding: 0 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #cbd5e1;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.sidebar-item:hover {
    background: rgba(51, 65, 85, 0.5);
}

.sidebar-item.active {
    background: #334155;
    color: white;
}

.sidebar-item.active .sidebar-item-icon {
    color: #60a5fa;
}

.sidebar-item-icon {
    font-size: 1.125rem;
    color: #64748b;
    transition: color 0.15s;
}

.sidebar-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.sidebar-item:hover .sidebar-item-actions {
    opacity: 1;
}

.sidebar-history {
    padding: 0 0.75rem;
}

.sidebar-history-date {
    font-size: 0.6875rem;
    color: #64748b;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
}

.sidebar-history-item {
    font-size: 0.75rem;
    padding: 0.375rem 0;
    padding-left: 0.75rem;
    border-left: 2px solid #334155;
    margin-bottom: 0.25rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.15s;
}

.sidebar-history-item:hover {
    color: white;
    border-left-color: #f97316;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #0f172a;
    background: rgba(15, 23, 42, 0.5);
}

.sidebar-quota {
    margin-bottom: 0.5rem;
}

.sidebar-quota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sidebar-quota-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
}

.sidebar-quota-value {
    font-size: 0.75rem;
    color: #cbd5e1;
    font-weight: 700;
}

.sidebar-quota-bar {
    width: 100%;
    height: 6px;
    background: #334155;
    border-radius: 3px;
    overflow: hidden;
}

.sidebar-quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Main Workspace Content Panel Container */
.workspace-main {
    display: grid;
    grid-template-columns: 450px 1fr;
    grid-template-rows: 1fr 300px;
    gap: 1px;
    background: #cbd5e1;
    overflow: hidden;
}

/* Panel Base Styles */
.workspace-panel {
    background: var(--theme-ocean-bg-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-panel-header {
    height: 48px; /* Slightly taller for the background design */
    border-bottom: 1px solid var(--theme-ocean-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: var(--theme-ocean-bg-panel);
    flex-shrink: 0;
}

.workspace-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--theme-ocean-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workspace-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workspace-panel-btn {
    background: transparent;
    border: 1px solid var(--theme-ocean-border);
    color: var(--theme-ocean-text-secondary);
    padding: 0.375rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875rem;
    line-height: 1;
}

.workspace-panel-btn:hover {
    background: #f1f5f9;
    color: var(--theme-ocean-text-primary);
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Blink animation for new tab button */
@keyframes blink-attention {
    0%, 100% { 
        background: transparent;
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
    50% { 
        background: #f97316;
        color: white;
        box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
        transform: scale(1.05);
    }
}

.workspace-panel-btn.blink-animate {
    animation: blink-attention 0.6s ease-in-out 5;
}

/* Clear/Sample Buttons in Panel Header */
.workspace-panel-clear-btn {
    background: transparent;
    border: none;
    color: var(--theme-ocean-text-secondary);
    padding: 0.375rem 0.625rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.05em;
}

.workspace-panel-clear-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.workspace-panel-content {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

/* SQL Editor Panel */
.sql-editor-panel {
    grid-row: span 1;
}

.sql-editor-panel .workspace-panel-content {
    padding: 0;
    background: #f8f9fa;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* SQL Editor - Full height */
.sql-editor {
    flex: 1;
    min-height: 0;
}

/* SQL Editor Scrollbar Styling */
.sql-editor-panel .workspace-panel-content ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.sql-editor-panel .workspace-panel-content ::-webkit-scrollbar-track {
    background: #e9ecef;
}

.sql-editor-panel .workspace-panel-content ::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 6px;
}

.sql-editor-panel .workspace-panel-content ::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

.sql-editor-container {
    height: 100%;
    display: flex;
}

.sql-editor-line-numbers {
    color: #94a3b8;
    text-align: right;
    user-select: none;
    padding-right: 0.5rem;
    border-right: 1px solid #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 1rem 0.5rem;
    background: #fafafa;
}

.sql-editor-textarea {
    flex: 1;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
}

.sql-editor-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.sql-editor-run-btn {
    width: 100%;
    background: #1e293b;
    color: white;
    border: none;
    font-weight: 700;
    padding: 0.625rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sql-editor-run-btn:hover {
    background: #0f172a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sql-editor-run-btn:active {
    transform: scale(0.98);
}

/* Lineage Graph Panel */
.lineage-graph-panel {
    grid-row: span 1;
}

.lineage-graph-panel .workspace-panel-content {
    padding: 0;
    background: #f8fafc;
    position: relative;
}

.lineage-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.lineage-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.lineage-iframe {
    position: relative;
    z-index: 2;
}

/* AI Summary Panel */
.ai-summary-panel {
    grid-column: span 2;
    position: relative;
}

.ai-panel-resize-handle {
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
    cursor: ns-resize;
    z-index: 20;
}

.ai-panel-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 3px;
    background: #94a3b8;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.15s, width 0.15s, background 0.15s;
}

.ai-panel-resize-handle:hover::after,
.ai-panel-resize-handle.active::after {
    opacity: 1;
    background: #f97316;
    width: 64px;
}

.ai-summary-panel .workspace-panel-content {
    background: white;
}

.ai-summary-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    min-height: 100%;
    align-items: start;
}

.ai-summary-section {
    min-width: 0;
}

.ai-summary-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.ai-summary-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #334155;
}

.ai-summary-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.ai-summary-table thead tr {
    color: #94a3b8;
    border-bottom: 1px solid #e2e8f0;
}

.ai-summary-table th {
    padding: 0.5rem 0;
    text-align: left;
    font-weight: 500;
}

.ai-summary-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.ai-summary-table tbody tr:last-child {
    border-bottom: none;
}

.ai-summary-table td {
    padding: 0.5rem 0;
    color: #64748b;
}

.ai-summary-table td code {
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: #334155;
    font-family: 'JetBrains Mono', monospace;
}

.ai-summary-table td:first-child {
    color: #1e293b;
    font-family: 'JetBrains Mono', monospace;
}

/* AI Summary Note */
.ai-summary-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef3c7;
    border-left: 3px solid #fbbf24;
    border-radius: 0.25rem;
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Scrollbar Styling */
.workspace-sidebar::-webkit-scrollbar,
.workspace-panel-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.workspace-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.workspace-sidebar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

.workspace-sidebar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.workspace-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.workspace-panel-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.workspace-panel-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive */
@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 200px 1fr;
    }

    .workspace-main {
        grid-template-columns: 1fr;
        grid-template-rows: 400px 1fr 300px;
    }

    .ai-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        position: absolute;
        left: -260px;
        width: 260px;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .workspace-sidebar.open {
        left: 0;
    }

    .workspace-main {
        grid-column: 1;
    }
}

/* Workspace Header - Quota Display */
.workspace-quota-display {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 4px 12px;
    background: linear-gradient(135deg, #1a2b4a, #2b3f6a);
    border-radius: 20px;
    margin-right: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    cursor: default;
    white-space: nowrap;
}

.workspace-quota-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

/* Workspace User Menu & Dropdown */
.workspace-user-menu {
    position: relative;
}

.workspace-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #fb923c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.workspace-user-avatar:hover {
    border-color: #f97316;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.workspace-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 240px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.workspace-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.workspace-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.workspace-user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.workspace-user-email {
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
}

.workspace-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.workspace-dropdown-item:hover {
    background: #f8fafc;
    color: #1e293b;
}

.workspace-dropdown-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Sidebar Section Header with Clear Button */
.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-clear-history {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.sidebar-clear-history:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

/* Sidebar History - Empty State */
.sidebar-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

/* Animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.sidebar-item,
.sidebar-history-item {
    animation: slideInLeft 0.2s ease;
}
