:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h2 i {
    color: #ef4444; /* PDF red */
}

/* Upload Section */
.upload-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f1f5f9;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

.drop-zone i {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.drop-zone p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.upload-status {
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--primary-color);
    text-align: center;
}

.hidden {
    display: none !important;
}

/* File List */
.file-list-section {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.file-list-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0 20px;
    margin-bottom: 10px;
}

.file-list {
    list-style: none;
}

.file-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.file-item:hover {
    background-color: #f1f5f9;
}

.file-item.active {
    background-color: #eff6ff;
    border-left-color: var(--primary-color);
}

.file-item i {
    color: #ef4444;
}

.file-item-name {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #e2e8f0;
}

.content-header {
    background-color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 5;
}

.content-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tabs {
    display: flex;
    gap: 10px;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 6px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background-color: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Viewer Container */
.viewer-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.tab-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Native Iframe */
#native-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

/* PDF.js */
.pdfjs-toolbar {
    background-color: #334155;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.toolbar-btn {
    background: #475569;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.toolbar-btn:hover:not(:disabled) {
    background: #64748b;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.875rem;
    min-width: 120px;
    text-align: center;
}

.pdfjs-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 20px;
    background-color: #cbd5e1;
}

#pdf-canvas {
    direction: ltr;
    box-shadow: var(--shadow-md);
    background-color: white;
}
