/* Dark Theme Customization */
:root[data-bs-theme="dark"] {
    --bs-body-bg: #0d1117;
    --bs-body-color: #e6edf3;
    --bs-secondary-bg: #161b22;
    --bs-tertiary-bg: #21262d;
    --bs-border-color: #30363d;
    --bs-primary: #2f81f7;
    --bs-success: #3fb950;
    --bs-danger: #f85149;
    --bs-warning: #d29922;
    --bs-info: #58a6ff;
}

body {
    min-height: 100vh;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Breadcrumb */
.breadcrumb {
    background-color: var(--bs-secondary-bg);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* File/Folder Cards */
.file-card, .folder-card {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
}

.file-card:hover, .folder-card:hover {
    background-color: var(--bs-tertiary-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.file-icon, .folder-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--bs-primary);
}

.folder-icon {
    color: #f9826c;
}

.file-name, .folder-name {
    font-size: 0.875rem;
    word-break: break-word;
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.75rem;
    color: #8b949e;
}

/* Protected Folder Badge */
.protected-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--bs-warning);
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

/* Toolbar */
.toolbar {
    background-color: var(--bs-secondary-bg);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 1050;
    min-width: 180px;
    display: none;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-body-color);
    text-decoration: none;
}

.context-menu-item:hover {
    background-color: var(--bs-tertiary-bg);
}

.context-menu-divider {
    height: 1px;
    background-color: var(--bs-border-color);
    margin: 0.25rem 0;
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 300px;
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
}

/* Drag & Drop Zone */
.drop-zone {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: var(--bs-primary);
    background-color: var(--bs-tertiary-bg);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Image Preview */
.image-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

/* Responsive Grid */
@media (max-width: 640px) {
    .file-grid, .folder-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toolbar {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Editor Styles */
.editor-container {
    display: flex;
    height: calc(100vh - 120px);
    gap: 1rem;
}

.editor-pane, .preview-pane {
    flex: 1;
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.editor-toolbar {
    background-color: var(--bs-tertiary-bg);
    padding: 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

/* PIN Input */
.pin-input {
    width: 3rem;
    height: 3rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 0.25rem;
}

/* Recycle Bin */
.recycle-item {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recycle-item:hover {
    background-color: var(--bs-tertiary-bg);
}

/* Shared Notes Panel */
.notes-panel {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
}

.notes-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notes-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notes-textarea {
    flex: 1;
    padding: 1rem;
    background-color: transparent;
    border: none;
    color: var(--bs-body-color);
    resize: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.notes-textarea:focus {
    outline: none;
}

.notes-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--bs-border-color);
}

@media (max-width: 992px) {
    .notes-panel {
        height: 400px;
        position: relative;
        top: 0;
        margin-top: 2rem;
    }
}
