:root {
    --primary: #8a2be2;
    --primary-light: #a64dff;
    --accent: #00f2fe;
    --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --sidebar-width: 320px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-container {
    width: 95vw;
    height: 90vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    padding: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.icon-luna {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent));
}

.logo span span {
    font-size: 0.7rem;
    background: var(--primary);
    padding: 2px 6px;
    border-radius: 6px;
    vertical-align: middle;
}

.search-box {
    margin: 0 20px 20px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px 12px 12px 40px;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.session-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 20px;
}

.section-title {
    padding: 0 15px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.session-list {
    list-style: none;
}

.session-item {
    margin-bottom: 8px;
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.session-item.active {
    background: linear-gradient(90deg, rgba(138, 43, 226, 0.3), transparent);
    border-left: 3px solid var(--accent);
}

.session-item .id {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    padding: 25px 40px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-info h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.session-info p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.btn-icon:hover {
    opacity: 1;
    transform: rotate(180deg);
}

.badge-status {
    padding: 6px 12px;
    background: rgba(0, 255, 127, 0.1);
    border: 1px solid rgba(0, 255, 127, 0.3);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #00ff7f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #00ff7f;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff7f;
}

/* Workspace */
.audit-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 350px;
    overflow: hidden;
}

.chat-viewport {
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(0, 0, 0, 0.1);
}

.welcome-message {
    margin: auto;
    text-align: center;
    max-width: 400px;
}

.welcome-message i {
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(to bottom, var(--accent), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Chat Bubbles */
.message {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 20px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.human {
    align-self: flex-end;
    background: var(--primary);
    border-bottom-right-radius: 4px;
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

.message .sender {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0.8;
}

.message .content {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Tool Calls & Results */
.tool-event {
    align-self: center;
    width: 90%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px dashed var(--glass-border);
    margin: 10px 0;
    overflow: hidden;
}

.tool-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
    font-family: monospace;
}

.tool-header .name {
    color: var(--accent);
    font-weight: bold;
}

.tool-body {
    padding: 12px 15px;
    font-family: monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
    color: #a5d6ff;
}

/* Audit Panel */
.audit-details {
    border-left: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.metadata-grid {
    padding: 20px;
    overflow-y: auto;
}

.metadata-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.metadata-card h4 {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.metadata-card .value {
    font-size: 0.9rem;
    word-break: break-all;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Loader */
.loader-small {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}