* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background: #ffffff;
    --surface: #f8fafc;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --sidebar-width: 300px;
    --navbar-height: 70px;
    --social-width: 60px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --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);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 2rem;
    max-width: none;
}

.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 1rem;
    transition: var(--transition-fast);
}

.hamburger-menu span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 2px 0;
    transition: var(--transition-fast);
    transform-origin: center;
}

.hamburger-menu:hover {
    transform: scale(1.1);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--text-secondary);
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height) - 200px);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    height: calc(100vh - var(--navbar-height));
    position: sticky;
    top: var(--navbar-height);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 0;
    border-right: none;
}

.sidebar-header {
    padding: 2rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--background);
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.file-item:hover {
    background: var(--surface-hover);
    border-left-color: var(--primary-color);
}

.file-item.active {
    background: var(--primary-color);
    color: white;
    border-left-color: var(--primary-hover);
}

.file-icon {
    margin-right: 0.75rem;
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    transition: var(--transition);
    background: var(--background);
}

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - var(--navbar-height) - 4rem);
    text-align: center;
}

.welcome-content {
    max-width: 600px;
    padding: 3rem;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.supported-formats h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.format-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.format-tag {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.format-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.file-content {
    max-width: none;
    margin: 0;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.file-info h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.file-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-viewer {
    background: var(--background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Social Sidebar */
.social-sidebar {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.social-item {
    width: 48px;
    height: 48px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.social-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(-4px) scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding: 2rem 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-actions .btn-secondary {
        display: none;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .welcome-content {
        padding: 2rem 1rem;
    }
    
    .welcome-content h2 {
        font-size: 2rem;
    }
    
    .social-sidebar {
        right: 1rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--navbar-height);
        height: calc(100vh - var(--navbar-height));
        z-index: 999;
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .content-area {
        width: 100%;
    }
    
    .social-sidebar {
        display: none;
    }
}

/* File Content Styles */
.markdown-content {
    max-width: none;
    line-height: 1.7;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 2rem 0 1rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content h1 {
    font-size: 2.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.markdown-content h2 {
    font-size: 1.875rem;
}

.markdown-content h3 {
    font-size: 1.5rem;
}

.markdown-content p {
    margin: 1rem 0;
    color: var(--text-secondary);
}

.markdown-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.markdown-content code {
    background: var(--surface);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.875rem;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.markdown-content li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--background);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.markdown-content th,
.markdown-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.markdown-content th {
    background: var(--surface);
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.markdown-content a:hover {
    text-decoration: underline;
}

.pdf-viewer,
.video-viewer,
.image-viewer,
.text-viewer {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pdf-viewer iframe,
.video-viewer video {
    width: 100%;
    height: 80vh;
    border: none;
}

.image-viewer img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.text-viewer {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 80vh;
    overflow-y: auto;
}

.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--error);
}

.error-message h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.error-message p {
    color: var(--text-secondary);
}

