@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --panel-bg: rgba(30, 41, 59, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.3);
    --danger: #ef4444;
    --danger-hover: #f87171;
    --success: #10b981;
    --success-hover: #34d399;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    padding: 2rem 1rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Glassmorphic Panel Base */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Header & Breadcrumbs */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.breadcrumbs a {
    color: var(--accent-hover);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px var(--accent-glow);
}

.breadcrumbs .separator {
    color: var(--text-secondary);
}

.breadcrumbs .current {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

/* Icons and Controls */
.actions-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-hover);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-icon-only {
    padding: 0.6rem;
    aspect-ratio: 1;
}

/* File / Folder Grid Layout */
.items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.item-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
    min-width: 0;
}

.item-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.item-icon.folder {
    color: #fbbf24;
}

.item-icon.file {
    color: #38bdf8;
}

.item-icon.image {
    color: #34d399;
}

.item-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}

.item-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control {
    resize: vertical;
    min-height: 180px;
    font-family: 'Courier New', Courier, monospace;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Drag and Drop Zone */
.drag-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    margin-bottom: 1.25rem;
}

.drag-zone.dragover {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 15px var(--accent-glow);
}

.drag-zone-icon {
    font-size: 2.5rem;
    color: var(--accent-hover);
    margin-bottom: 0.75rem;
}

.drag-zone-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.drag-zone-text strong {
    color: var(--accent-hover);
}

/* Tabs inside Modal */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Viewer Styles */
.viewer-layout {
    max-width: 840px;
    margin: 0 auto;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.viewer-title {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

/* Markdown Rendering Custom Styles */
.markdown-body {
    color: #e2e8f0;
    font-size: 1.05rem;
    line-height: 1.7;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, 
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.markdown-body h1 { font-size: 1.8rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.45rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.25rem; }

.markdown-body p {
    margin-bottom: 1.1rem;
}

.markdown-body a {
    color: var(--accent-hover);
    text-decoration: underline;
    transition: var(--transition);
}

.markdown-body a:hover {
    color: var(--text-primary);
}

.markdown-body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #f8fafc;
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(139, 92, 246, 0.05);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.markdown-body ul, .markdown-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.markdown-body li {
    margin-bottom: 0.4rem;
}

.markdown-body img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
}

.markdown-body th, .markdown-body td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    text-align: left;
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

/* Image Centered View */
.image-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.image-viewer img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--panel-border);
}

.image-meta {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Global Floating Navigation Toggle */
.floating-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
}

.floating-nav-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    text-decoration: none;
}

.floating-nav-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6);
}

/* Alerts and Notifications */
.alert-toast {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 1000;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    pointer-events: none;
}

.alert-toast.active {
    opacity: 1;
    transform: translateY(0);
}

/* Loader style */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* SVG Icon styling */
svg.lucide {
    width: 1.25em;
    height: 1.25em;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    display: inline-block;
    vertical-align: middle;
}

.btn svg.lucide {
    width: 1.15rem;
    height: 1.15rem;
}

.btn-icon-only svg.lucide {
    width: 1.15rem;
    height: 1.15rem;
}

.breadcrumbs svg.lucide {
    width: 1.15rem;
    height: 1.15rem;
    margin-right: 0.35rem;
}

.item-icon svg.lucide {
    width: 1.75rem;
    height: 1.75rem;
}

.item-actions svg.lucide {
    width: 1.1rem;
    height: 1.1rem;
}

.drag-zone-icon svg.lucide {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
}

.empty-icon svg.lucide {
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.floating-nav-btn svg.lucide {
    width: 1.6rem;
    height: 1.6rem;
}

.alert-toast svg {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
}

