:root {
    /* Theme Variables (Dark/Glass Mode) */
    --glass-bg: rgba(20, 25, 35, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #00f0ff; /* Cyber blue */
    --accent-hover: #00bcd4;
    --highlight-color: rgba(255, 255, 0, 0.3);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --surface-dark: #0a0e14;
    --surface-light: rgba(255, 255, 255, 0.05);
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--surface-dark);
    color: var(--text-primary);
    overflow: hidden;
}

#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* --- Sidebar --- */
#sidebar {
    width: 250px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace; /* Adopted monospace font for technical feel */
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

select, input, button {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-family: inherit;
}

button.primary {
    background: var(--accent-color);
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

button.primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* --- Main Content Area --- */
#main-content {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.split-pane {
    display: flex;
    width: 100%;
    height: 100%;
}

/* --- Memo Panel --- */
#memo-panel {
    flex: 1;
    padding: 40px; /* Increased padding for document feel */
    overflow-y: auto;
    border-right: 1px solid var(--glass-border);
    background: rgba(10, 14, 20, 0.95);
    position: relative;
}

/* Typography for Memo */
.memo-content h1 { 
    border-bottom: 1px solid var(--glass-border); 
    padding-bottom: 15px;
    color: #fff;
}
.memo-content h2 { 
    color: var(--accent-color); 
    margin-top: 25px; 
    font-size: 1.4rem;
}
.memo-content p { 
    line-height: 1.7; 
    margin-bottom: 15px; 
    color: #d1d5db;
}

/* --- Evidence/PDF Panel --- */
#evidence-panel {
    flex: 1;
    padding: 0;
    background: #1a1e24;
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 1px solid var(--glass-border);
    transition: width 0.3s ease;
    width: 0; /* Hidden by default */
    overflow: hidden;
}

#evidence-panel.active {
    width: 50%;
}

/* --- Citations (Merged) --- */
/* Combines the HTML class from Left with the styling logic from Right */
.citation-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 240, 255, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(0, 240, 255, 0.3);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0 6px;
    border-radius: 4px;
    margin-left: 4px;
    cursor: pointer;
    vertical-align: super;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.citation-tag:hover {
    background-color: var(--accent-color);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 240, 255, 0.4);
}

/* --- PDF Viewer Mock --- */
#pdf-viewer {
    flex: 1;
    background: #525659; /* Standard PDF viewer gray */
    color: black;
    position: relative;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pdf-page {
    width: 100%;
    max-width: 800px; /* A4 constraints */
    min-height: 1000px;
    background: white;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.bbox-highlight {
    position: absolute;
    background: var(--highlight-color);
    border: 2px solid #ff9800;
    pointer-events: none;
    z-index: 10;
    transition: all 0.3s ease;
}

/* --- Audit Log / Status --- */
#audit-log-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: #000;
    border-top: 1px solid var(--glass-border);
    padding: 10px;
    overflow-y: auto;
    display: none;
    z-index: 50;
}

/* Audit Table Styles (From Right) */
#audit-log-panel table {
    width: 100%;
    border-collapse: collapse;
    color: #0f0;
}

#audit-log-panel th {
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-size: 0.7rem;
    text-align: left;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    color: #888;
}

#audit-log-panel td {
    font-family: monospace;
    font-size: 0.8rem;
    padding: 4px 0;
}

/* --- Progress Bar --- */
#progress-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: var(--glass-bg);
    padding: 20px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    text-align: center;
    z-index: 100;
    display: none;
    backdrop-filter: blur(5px);
}

.progress-bar {
    height: 4px;
    background: #333;
    margin-top: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    transition: width 0.3s;
}

/* --- Scrollbars (From Right - Adapted) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}