:root {
    /* Professional Color System */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --accent: #0ea5e9;
    
    /* Neutral Grays */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #06b6d4;
    
    /* Typography */
    --font-system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.125rem;
    --radius: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-system);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    font-size: var(--font-size-base);
}

/* Professional Navigation */
.pro-nav {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo {
    background: var(--primary);
    color: white;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: var(--font-size-lg);
}

.workspace {
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-lg);
}

.nav-center {
    flex: 1;
    max-width: 600px;
    margin: 0 var(--space-6);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--gray-400);
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: var(--space-3) var(--space-3) var(--space-3) 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    background: var(--gray-50);
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--gray-700);
}

.nav-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.nav-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.nav-btn.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

/* Professional Layout */
.pro-layout {
    display: flex;
    height: calc(100vh - 73px);
}

.pro-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.sidebar-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Main Content Area */
.pro-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-4) var(--space-6);
}

.main-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.main-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.main-content {
    flex: 1;
    padding: var(--space-6);
    overflow-y: auto;
}

/* Team Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.dashboard-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
}

.card-action {
    padding: var(--space-2);
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s ease;
}

.card-action:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

/* File Lists */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}

.file-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.file-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.file-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto var(--space-3);
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.file-name {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
    font-size: var(--font-size-sm);
}

.file-meta {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
}

/* Professional PDF Viewer */
.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.pdf-modal.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

.pdf-modal-content {
    background: var(--gray-900);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pdf-header {
    background: var(--gray-800);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    border-bottom: 1px solid var(--gray-700);
}

.pdf-title {
    color: white;
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.pdf-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    justify-content: center;
}

.pdf-controls button,
.pdf-controls input,
.pdf-controls select {
    background: var(--gray-700);
    border: 1px solid var(--gray-600);
    color: white;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-controls button:hover {
    background: var(--gray-600);
    border-color: var(--gray-500);
}

.pdf-controls input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgb(37 99 235 / 0.2);
}

.pdf-divider {
    color: var(--gray-600);
    margin: 0 var(--space-2);
}

.pdf-tool-btn {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    border: 1px solid var(--gray-600);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: var(--font-size-sm);
    color: white;
    position: relative;
    overflow: hidden;
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transform: translateY(0);
}

.pdf-tool-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.pdf-tool-btn:hover::before {
    left: 100%;
}

.pdf-tool-btn:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.4), 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.pdf-tool-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5), 0 0 0 3px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px) scale(1.08);
    animation: pulse 2s infinite;
}

.pdf-tool-btn:active {
    transform: translateY(0) scale(0.95);
    transition-duration: 0.1s;
}

.pdf-save-btn {
    background: var(--success);
    border-color: var(--success);
    font-weight: 600;
    position: relative;
}

.pdf-save-btn::after {
    content: '💾';
    margin-left: var(--space-1);
}

.pdf-save-btn:hover {
    background: #059669;
    border-color: #059669;
    animation: pulse 0.8s infinite;
}

.pdf-save-btn.saving {
    background: var(--warning);
    border-color: var(--warning);
    animation: spin 1s linear infinite;
}

.pdf-save-btn.saved {
    background: var(--success);
    border-color: var(--success);
    animation: bounceIn 0.5s ease-out;
}

.pdf-close {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
}

.pdf-close:hover {
    background: var(--gray-700);
}

/* PDF Text Formatting */
.pdf-text-format-bar {
    background: var(--gray-800);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    border-bottom: 1px solid var(--gray-700);
}

.format-group {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.format-btn {
    background: var(--gray-700);
    border: 1px solid var(--gray-600);
    color: white;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-btn:hover,
.format-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.format-select {
    background: var(--gray-700);
    border: 1px solid var(--gray-600);
    color: white;
    padding: var(--space-2);
    border-radius: var(--radius);
    cursor: pointer;
}

.color-picker {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--gray-600);
    border-radius: var(--radius);
    cursor: pointer;
    background: none;
}

/* PDF Container */
.pdf-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    background: var(--gray-800);
    padding: var(--space-4);
}

.pdf-pages-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
}

.pdf-page-wrapper {
    position: relative;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
}

.pdf-page-wrapper canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdf-page-label {
    position: absolute;
    top: -2rem;
    left: 0;
    background: var(--gray-700);
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.pdf-loading,
.pdf-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: white;
    font-size: var(--font-size-lg);
}

.pdf-error a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* PDF Text Layer for interactive text */
.textLayer {
    position: absolute !important;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
    z-index: 2;
}

.textLayer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* PDF Hyperlinks - CRITICAL for user requirement */
.pdf-link-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000;
}

.pdf-link-layer a {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    z-index: 1000;
}

.pdf-link-layer a:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* PDF Annotations */
.pdf-annotation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
}

.pdf-annotation {
    position: absolute;
    cursor: pointer;
}

.pdf-text-annotation {
    background: linear-gradient(135deg, rgba(255, 255, 200, 0.95) 0%, rgba(255, 255, 180, 0.9) 100%);
    border: 2px solid #ffd700;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    min-width: 120px;
    min-height: 40px;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(2px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: move;
    user-select: none;
}

.pdf-text-annotation:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(255, 215, 0, 0.4);
    border-color: #ffcc00;
}

.pdf-text-annotation:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    cursor: text;
    user-select: text;
}

.pdf-comment-annotation {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 320px;
    font-size: var(--font-size-sm);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.pdf-comment-annotation:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.pdf-comment-annotation.priority-high {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.pdf-comment-pin {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
    font-weight: bold;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow);
}

.pdf-comment-pin.priority-high {
    background: var(--error);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.comment-author {
    color: var(--gray-900);
    font-weight: 600;
}

.comment-category {
    background: var(--gray-100);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    text-transform: capitalize;
}

.comment-text {
    color: var(--gray-700);
    line-height: 1.5;
    margin-bottom: var(--space-2);
}

.comment-date {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-align: right;
}

.pdf-highlight-annotation {
    background: rgba(255, 255, 0, 0.4);
    pointer-events: none;
}

.pdf-circle-annotation,
.pdf-arrow-annotation {
    pointer-events: none;
    stroke-width: 2;
    fill: none;
}

.pdf-circle-annotation {
    stroke: var(--primary);
}

.pdf-arrow-annotation {
    stroke: var(--error);
    marker-end: url(#arrowhead);
}

/* Login Page */
#loginPage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.login-container {
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.login-container p {
    color: var(--gray-600);
    margin-bottom: var(--space-8);
}

.form-group {
    text-align: left;
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-group input {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button[type="submit"] {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button[type="submit"]:hover {
    background: var(--primary-hover);
}

.error-message {
    color: var(--error);
    font-size: var(--font-size-sm);
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Page Visibility */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-4);
}

.modal-content textarea {
    height: 120px;
    resize: vertical;
}

.modal-content button {
    background: var(--primary);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-content button:hover {
    background: var(--primary-hover);
}

.close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--gray-700);
}

/* Upload Progress */
.upload-progress {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.progress-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
    min-width: 3rem;
}

.upload-details {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* Comment Options */
.comment-options {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.comment-options label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.comment-options input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.comment-options select {
    margin: 0;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pro-nav {
        flex-direction: column;
        gap: var(--space-4);
        padding: var(--space-3);
    }
    
    .nav-center {
        order: -1;
        margin: 0;
        max-width: none;
    }
    
    .pro-layout {
        flex-direction: column;
        height: auto;
    }
    
    .pro-sidebar {
        width: 100%;
        position: relative;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .pdf-controls {
        flex-wrap: wrap;
        gap: var(--space-1);
    }
    
    .pdf-text-format-bar {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .pdf-header {
        padding: var(--space-2);
    }
    
    .pdf-controls button,
    .pdf-controls input {
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-size-xs);
    }
    
    .modal-content {
        padding: var(--space-4);
        width: 95%;
    }
}

/* Animation and Transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(100%);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Transitions */
.page {
    animation: fadeIn 0.5s ease-out forwards;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-out forwards;
}

/* Enhanced Micro-interactions */
@media (prefers-reduced-motion: no-preference) {
    .dashboard-card {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }
    
    .dashboard-card:hover {
        animation: pulse 0.6s ease-in-out;
    }
    
    .file-item {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }
    
    .file-item:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    .nav-item {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }
    
    .nav-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }
    
    .nav-item:hover::before {
        left: 100%;
    }
    
    .pdf-tool-btn {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }
    
    .pdf-tool-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
    
    .nav-btn {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }
    
    .nav-btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }
    
    .nav-btn:active::after {
        width: 300px;
        height: 300px;
    }
    
    .search-box input {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .search-box input:focus {
        transform: scale(1.02);
    }
    
    /* Loading animations */
    .loading-spinner {
        animation: spin 1s linear infinite;
    }
    
    .upload-progress {
        animation: slideUp 0.4s ease-out;
    }
    
    /* Modal animations */
    .modal.active .modal-content {
        animation: modalSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    
    .pdf-modal.active .pdf-modal-content {
        animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    
    /* File list animations */
    .file-grid .file-item {
        animation: fadeIn 0.4s ease-out;
        animation-fill-mode: both;
    }
    
    .file-grid .file-item:nth-child(1) { animation-delay: 0.1s; }
    .file-grid .file-item:nth-child(2) { animation-delay: 0.2s; }
    .file-grid .file-item:nth-child(3) { animation-delay: 0.3s; }
    .file-grid .file-item:nth-child(4) { animation-delay: 0.4s; }
    .file-grid .file-item:nth-child(5) { animation-delay: 0.5s; }
    .file-grid .file-item:nth-child(6) { animation-delay: 0.6s; }
    
    /* Sidebar animations */
    .sidebar-nav {
        animation: slideIn 0.6s ease-out;
    }
    
    .nav-section {
        animation: fadeIn 0.5s ease-out;
        animation-fill-mode: both;
    }
    
    .nav-section:nth-child(1) { animation-delay: 0.1s; }
    .nav-section:nth-child(2) { animation-delay: 0.2s; }
    .nav-section:nth-child(3) { animation-delay: 0.3s; }
    
    /* PDF annotations with smooth appear */
    .pdf-annotation {
        animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    .pdf-comment-annotation {
        animation: modalSlideIn 0.3s ease-out;
    }
    
    /* Hyperlink hover effect enhancement */
    .pdf-link-layer a {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }
    
    .pdf-link-layer a:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    }
    
    /* Progress bar animation */
    .progress-fill {
        transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        background: linear-gradient(90deg, var(--primary), var(--accent));
        background-size: 200% 100%;
        animation: shimmer 2s infinite linear;
    }
    
    /* Staggered card animations */
    .dashboard-grid .dashboard-card {
        animation: fadeIn 0.6s ease-out;
        animation-fill-mode: both;
    }
    
    .dashboard-grid .dashboard-card:nth-child(1) { animation-delay: 0.1s; }
    .dashboard-grid .dashboard-card:nth-child(2) { animation-delay: 0.2s; }
    .dashboard-grid .dashboard-card:nth-child(3) { animation-delay: 0.3s; }
    
    /* Interactive feedback */
    .card-action:hover {
        transform: scale(1.1);
        background: var(--primary);
        color: white;
    }
    
    .user-menu:hover .user-avatar {
        transform: scale(1.1);
        background: var(--primary-hover);
    }
}

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Theme Toggle Styles */
.theme-toggle {
    position: relative;
}

.theme-icon {
    transition: all 0.3s ease;
}

.theme-dark {
    display: none;
}

[data-theme="dark"] .theme-light {
    display: none;
}

[data-theme="dark"] .theme-dark {
    display: block;
}

/* Dark Theme */
[data-theme="dark"] {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
}

[data-theme="dark"] body {
    background: var(--gray-50);
    color: var(--gray-900);
}

[data-theme="dark"] .pro-nav {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

[data-theme="dark"] .search-box input {
    background: var(--gray-200);
    color: var(--gray-900);
    border-color: var(--gray-300);
}

[data-theme="dark"] .search-box input:focus {
    background: var(--gray-100);
}

[data-theme="dark"] .pro-sidebar {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

[data-theme="dark"] .main-header {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

[data-theme="dark"] .dashboard-card {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

[data-theme="dark"] .file-item {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

[data-theme="dark"] .file-item:hover {
    border-color: var(--primary);
}

[data-theme="dark"] .nav-btn {
    background: var(--gray-200);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

[data-theme="dark"] .nav-btn:hover {
    background: var(--gray-300);
}

[data-theme="dark"] .nav-item:hover {
    background: var(--gray-200);
}

[data-theme="dark"] .card-action {
    background: var(--gray-200);
    color: var(--gray-700);
}

[data-theme="dark"] .card-action:hover {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .pdf-modal-content {
    background: var(--gray-100);
}

[data-theme="dark"] .pdf-header {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

[data-theme="dark"] .pdf-text-format-bar {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

[data-theme="dark"] .pdf-container {
    background: var(--gray-200);
}

[data-theme="dark"] .modal-content {
    background: var(--gray-100);
    color: var(--gray-900);
}

[data-theme="dark"] .modal-content input,
[data-theme="dark"] .modal-content textarea,
[data-theme="dark"] .modal-content select {
    background: var(--gray-200);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

[data-theme="dark"] .upload-progress {
    background: var(--gray-200);
}

[data-theme="dark"] .progress-bar {
    background: var(--gray-300);
}

/* Auto dark mode support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --gray-50: #0f172a;
        --gray-100: #1e293b;
        --gray-200: #334155;
        --gray-300: #475569;
        --gray-400: #64748b;
        --gray-500: #94a3b8;
        --gray-600: #cbd5e1;
        --gray-700: #e2e8f0;
        --gray-800: #f1f5f9;
        --gray-900: #f8fafc;
    }
    
    :root:not([data-theme="light"]) .theme-light {
        display: none;
    }
    
    :root:not([data-theme="light"]) .theme-dark {
        display: block;
    }
}

/* PDF Hyperlinks */
.pdf-hyperlink {
    position: absolute !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 10000 !important; /* Highest priority - above all annotation layers */
    background: rgba(0, 0, 255, 0.1) !important;
    border: 1px solid rgba(0, 0, 255, 0.3) !important;
    transition: background-color 0.2s ease !important;
    text-decoration: none !important;
    display: block !important;
}

/* Annotation Delete Button */
.annotation-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background-color 0.2s ease;
}

.annotation-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Note Preview Modal */
.note-preview-modal .modal-content {
    max-width: 600px;
    max-height: 80vh;
}

.note-content {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.preview-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.preview-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Enhanced PDF Toolbar */
.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-toolbar button:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pdf-tool-btn {
    position: relative;
    font-weight: 500;
}

.pdf-tool-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.pdf-tool-btn.active:hover {
    background: var(--accent-hover) !important;
}

.pdf-save-btn {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    font-weight: 600;
}

.pdf-save-btn:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#pdfPageInput {
    width: 50px;
    padding: 0.25rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

#pdfZoom {
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
    text-align: center;
}

.pdf-divider {
    color: var(--gray-300);
    margin: 0 0.5rem;
}

/* Enhanced PDF Close Button */
.pdf-close {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: #e74c3c !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 1000 !important;
}

.pdf-close:hover {
    background: #c0392b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.pdf-close .close-icon {
    font-size: 18px !important;
    font-weight: bold !important;
}

.pdf-close .close-text {
    font-size: 14px !important;
}

/* Fix text layer interference with hyperlinks */
.textLayer,
.textLayer span,
.textLayer div {
    pointer-events: none !important;
    cursor: default !important;
}

/* Ensure hyperlinks are always clickable and visible */
.pdf-hyperlink {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 10000 !important; /* Highest priority - above all annotation layers */
    background: rgba(0, 0, 255, 0.3) !important;
    border: 2px solid rgba(0, 0, 255, 0.8) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7) !important;
    transition: all 0.2s ease !important;
}

.pdf-hyperlink:hover {
    background: rgba(0, 0, 255, 0.5) !important;
    border: 2px solid rgba(0, 0, 255, 1.0) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 255, 0.4) !important;
}

/* Print styles */
@media print {
    .pdf-header,
    .pdf-text-format-bar,
    .nav-actions,
    .pro-sidebar {
        display: none !important;
    }
    
    .pdf-container {
        background: white;
        padding: 0;
    }
}