/* S3 Storage Manager - Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --success-color: #16a34a;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px 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);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-bar-inapp {
    background: #1a1a2e;
    color: #eee;
    padding: 0.4rem 1rem;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
}

.logo-icon {
    color: var(--primary-color);
}

.header-account {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-account-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#btn-sign-out {
    font-size: 0.8125rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

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

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

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

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
}

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

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

.btn-icon:hover {
    background: var(--background);
    color: var(--text-primary);
}

/* Breadcrumbs */
.breadcrumbs {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
}

.breadcrumb-item:hover {
    background: var(--background);
    color: var(--text-primary);
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--border);
}

/* Stats Bar */
.stats-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
    position: relative;
}

/* File Browser */
.file-browser {
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    min-height: 400px;
    position: relative;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.sort-controls-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 0.25rem;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

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

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

.sort-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sort-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.folder-readme-preview {
    max-height: 400px;
    overflow: hidden;
    margin: 0 1.5rem 1rem;
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    padding-bottom: 2.5rem;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.folder-readme-preview.expanded {
    max-height: none;
    overflow: visible;
}

.folder-readme-preview.collapsed-to-bar {
    max-height: none;
    padding: 0;
    min-height: 0;
}

.folder-readme-preview.collapsed-to-bar .readme-preview-content,
.folder-readme-preview.collapsed-to-bar .readme-preview-actions {
    display: none;
}

.folder-readme-preview .readme-preview-content {
    padding: 0;
}

.folder-readme-preview .markdown-body {
    padding: 0;
    font-size: 0.875rem;
}

.folder-readme-preview .readme-preview-actions {
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-readme-preview .readme-preview-actions .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

.folder-readme-preview .readme-preview-bar {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    transition: background 0.15s;
}

.folder-readme-preview .readme-preview-bar:hover {
    background: var(--background);
    color: var(--text-primary);
}

.folder-readme-preview.collapsed-to-bar .readme-preview-bar {
    display: flex;
}

.folder-readme-preview .readme-preview-bar svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.file-list.list-view {
    display: block;
    padding: 0;
}

.file-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.file-list-table thead {
    background: var(--background);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.file-list-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-list-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s, color 0.15s;
}

.file-list-table th.sortable:hover {
    background-color: var(--surface);
    color: var(--primary-color);
}

.file-list-table th.sortable span {
    display: inline-block;
}

.file-list-table tbody tr {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.file-list-table tbody tr:hover {
    background: var(--background);
}

.file-list-table tbody tr:last-child {
    border-bottom: none;
}

.file-list-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.file-list-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-list-name-cell svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.file-list-name-cell svg.folder {
    color: #f59e0b;
}

.file-list-name-cell span {
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.btn-delete-item {
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--danger-color);
    opacity: 0.7;
    transition: all 0.15s;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.btn-delete-item:hover {
    opacity: 1;
    background: rgba(220, 38, 38, 0.1);
    transform: scale(1.1);
}

.btn-delete-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-tail-item {
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--primary-color);
    opacity: 0.7;
    transition: all 0.15s;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.btn-tail-item:hover {
    opacity: 1;
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.1);
}

.btn-tail-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.file-list-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.file-list-table .col-name {
    width: 50%;
    min-width: 200px;
}

.file-list-table .col-size {
    width: 15%;
    min-width: 100px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.file-list-table .col-modified {
    width: 20%;
    min-width: 150px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.file-list-table .col-type {
    width: 15%;
    min-width: 100px;
    color: var(--text-secondary);
}

/* File Item */
.file-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.file-item .btn-delete-item,
.file-item .btn-tail-item {
    position: absolute;
    top: 0.5rem;
    margin-left: 0;
    z-index: 10;
}

.file-item .btn-delete-item {
    right: 0.5rem;
}

.file-item .btn-tail-item {
    right: 2.5rem;
}

/* Hover view-mode options for files */
.file-item-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-item-actions,
.file-item-actions:hover,
.file-list-name-cell:hover .file-item-actions-list {
    opacity: 1;
}

.file-item-actions-list {
    margin-left: auto;
    gap: 0.25rem;
}

.file-list-name-cell .file-item-actions-list {
    opacity: 0;
}

.file-list-row[data-type="file"]:hover .file-item-actions-list {
    opacity: 1;
}

.file-item-actions-grid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(to top, var(--surface) 60%, transparent);
    border-radius: 0 0 0.5rem 0.5rem;
}

.file-item-actions-grid .btn-view-action {
    flex: 1;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.35rem 0.25rem;
    font-size: 0.7rem;
}

.file-item-actions-grid .btn-view-action svg {
    flex-shrink: 0;
}

.btn-view-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.75rem;
    transition: background 0.15s, color 0.15s;
}

.btn-view-action:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

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

.file-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
}

.file-icon.folder {
    color: #f59e0b;
}

.file-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
    width: 100%;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    color: var(--border);
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Drop Zone */
.drop-zone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone-content {
    color: white;
    text-align: center;
}

.drop-zone-content svg {
    color: white;
    margin-bottom: 1rem;
}

.drop-zone-content h3 {
    font-size: 2rem;
    font-weight: 600;
}

/* Preview Modal */
.preview-image-wrapper {
    width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--background);
    border-radius: 0.75rem;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.preview-frame {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: 0.75rem;
    background: var(--surface);
}

.preview-video,
.preview-audio {
    width: 100%;
    max-height: 70vh;
    border-radius: 0.75rem;
    background: var(--background);
}

.preview-code {
    max-height: 70vh;
    overflow: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-text-wrapper {
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-json-wrapper {
    width: 100%;
    height: 70vh;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #1e1e1e;
}

#monaco-editor-container {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Tail Mode Styles - Full Page */
.tail-view-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--surface);
    z-index: 1000;
}

/* JSON View Styles - Full Page */
.json-view-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: #1e1e1e;
    z-index: 1000;
}

.json-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.json-view-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.json-view-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.json-view-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.json-view-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.json-view-path {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.json-view-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
}

#json-monaco-container {
    width: 100%;
    height: 100%;
}

.json-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.json-toolbar .btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
}

.json-validation-status {
    font-size: 0.8125rem;
    padding: 0 0.5rem;
}

.json-validation-status.valid {
    color: var(--success-color);
}

.json-validation-status.invalid {
    color: var(--danger-color);
}

.json-validation-bar {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    background: #2d2d30;
    color: #d4d4d4;
    border-bottom: 1px solid #3c3c3c;
}

.json-validation-bar.error {
    background: rgba(190, 50, 50, 0.2);
    color: #f48771;
}

.json-tree-container {
    height: 100%;
    overflow: auto;
    padding: 1rem;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: var(--font-mono, monospace);
    font-size: 13px;
}

.json-tree-node {
    margin-left: 1rem;
}

.json-tree-toggle {
    cursor: pointer;
    user-select: none;
    display: inline-block;
    width: 1rem;
    text-align: center;
}

.json-tree-key {
    color: #9cdcfe;
}

.json-tree-string {
    color: #ce9178;
}

.json-tree-number {
    color: #b5cea8;
}

.json-tree-boolean {
    color: #569cd6;
}

.json-tree-null {
    color: #569cd6;
}

/* Generic Content View Styles - Full Page */
.content-view-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--surface);
    z-index: 1000;
}

.content-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.content-view-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.content-view-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.content-view-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.content-view-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-view-path {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-view-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 2rem;
    background: var(--background);
    display: flex;
    flex-direction: column;
}

.content-view-body .preview-text-wrapper,
.content-view-body .preview-code {
    flex: 1;
    min-height: 0;
    max-height: none;
}

.content-view-body .preview-text-wrapper {
    display: flex;
    flex-direction: column;
}

.content-view-body .preview-frame,
.content-view-body .preview-video,
.content-view-body .preview-audio {
    flex: 1;
    min-height: 0;
    max-height: none;
}

.content-view-body .preview-html-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.content-view-body .preview-html-wrapper iframe {
    flex: 1;
    min-height: 0;
}

.preview-mermaid-wrapper {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1.5rem;
    background: var(--surface);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mermaid-preview-container {
    min-width: 0;
}

.mermaid-diagram-wrap {
    display: inline-block;
}

.mermaid-diagram-wrap svg {
    max-width: 100%;
    height: auto;
}

.content-view-body .preview-mermaid-wrapper {
    flex: 1;
    min-height: 0;
}

.content-view-header-right .btn {
    white-space: nowrap;
}

.content-view-header-right .btn-danger-content {
    color: var(--danger-color);
}

.content-view-header-right .btn-danger-content:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--danger-color);
}

/* Image View Styles - Full Page */
.image-view-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: #000000;
    z-index: 1000;
}

.image-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.image-view-header .btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.image-view-header .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.image-view-header .btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.image-view-header .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.image-view-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.image-view-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.image-view-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.image-view-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-view-path {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-view-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    padding: 2rem;
}

.image-view-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

.tail-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.tail-view-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.tail-view-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.tail-view-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.tail-view-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tail-view-path {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tail-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    background: var(--background);
    border-radius: 0.5rem;
}

.tail-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.tail-view-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #0f172a;
}

.tail-text {
    flex: 1;
    margin: 0;
    padding: 1.5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    overflow-y: auto;
    overflow-x: auto;
    scroll-behavior: smooth;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Legacy modal tail styles (for backwards compatibility) */
.tail-view-wrapper {
    display: flex;
    flex-direction: column;
    height: 70vh;
    max-height: 70vh;
}

.tail-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    border-radius: 0.5rem 0.5rem 0 0;
    margin-bottom: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.tail-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-error {
    color: var(--danger-color);
    padding: 1rem;
    background: rgba(220, 38, 38, 0.08);
    border-radius: 0.5rem;
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    max-width: calc(100vw - 4rem);
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.upload-progress-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-progress-header h4 {
    font-size: 1rem;
    font-weight: 600;
}

.upload-queue {
    max-height: 300px;
    overflow-y: auto;
}

.upload-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.upload-item:last-child {
    border-bottom: none;
}

.upload-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.upload-item-progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.upload-item-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 300;
    min-width: 180px;
}

.context-menu-item {
    width: 100%;
    background: none;
    border: none;
    padding: 0.625rem 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: var(--background);
}

.context-menu-item.danger {
    color: var(--danger-color);
}

.context-menu-item.danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
}

.modal-content {
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Form Elements */
input[type="text"],
input[type="search"] {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: stretch;
    }
    
    .header-actions .btn {
        flex: 1;
    }
    
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .file-list-table {
        font-size: 0.8125rem;
    }
    
    .file-list-table th,
    .file-list-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .file-list-table .col-size,
    .file-list-table .col-modified,
    .file-list-table .col-type {
        display: none;
    }
    
    .file-list-table .col-name {
        width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
}

