/* ============================================
   Archive Viewer - Modern Stylesheet
   Dark Mode Support with Light Mode Default
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors - Blue Theme */
    --primary: #3399cc;
    --primary-light: #E0F2FE;
    --primary-dark: #2980b9;
    --accent: #339966;
    
    /* Status Colors */
    --success: #339966;
    --success-light: #E8F5E9;
    --warning: #f59e0b;
    --warning-light: #FEF3C7;
    --danger: #e64e4e;
    --danger-light: #FEE2E2;
    
    /* Background Colors */
    --bg: #F0F9FF;
    --bg-elevated: #ffffff;
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #E2E8F0;
    
    /* Text Colors */
    --text: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    
    /* Border Colors */
    --border: #CBD5E1;
    --border-light: #E2E8F0;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 14px rgba(51, 153, 204, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(51, 153, 204, 0.35);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Input */
    --input-bg: #ffffff;
    --input-border: #CBD5E1;
    
    /* File Type Colors */
    --color-zip: #3399cc;
    --color-rar: #e64e4e;
    --color-7z: #339966;
    --color-tar: #f59e0b;
    --color-folder: #64748B;
    --color-file: #94A3B8;
    
    /* Scrollbar */
    --scrollbar-track: var(--bg);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: rgba(96, 165, 250, 0.15);
    --primary-dark: #3b82f6;
    --accent: #4ade80;
    
    /* Status Colors */
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    
    /* Background Colors */
    --bg: #0F172A;
    --bg-elevated: #1E293B;
    --bg-secondary: #334155;
    --bg-tertiary: #475569;
    
    /* Text Colors */
    --text: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    
    /* Border Colors */
    --border: #334155;
    --border-light: #475569;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
    --shadow-primary: 0 4px 14px rgba(96, 165, 250, 0.2);
    --shadow-primary-hover: 0 6px 20px rgba(96, 165, 250, 0.3);
    
    /* Input */
    --input-bg: #334155;
    --input-border: #475569;
    
    /* File Type Colors */
    --color-zip: #60a5fa;
    --color-rar: #f87171;
    --color-7z: #4ade80;
    --color-tar: #fbbf24;
    --color-folder: #94A3B8;
    --color-file: #64748B;
    
    /* Scrollbar */
    --scrollbar-track: var(--bg-elevated);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Container */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-primary);
    flex-shrink: 0;
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.tool-icon-wrapper svg,
.tool-icon-wrapper i {
    width: 28px;
    height: 28px;
}

.tool-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

.tool-description a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.tool-description a:hover {
    text-decoration: underline;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    background: var(--bg-elevated);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    color: var(--primary);
    opacity: 0.8;
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.upload-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.file-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.file-type-badge {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.upload-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Viewer Section */
.viewer-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Archive Header */
.archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.archive-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.archive-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.archive-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.archive-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    word-break: break-word;
}

.archive-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.archive-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.archive-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

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

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

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    overflow-x: auto;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

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

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

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    transition: all var(--transition-speed);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input-wrapper svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text);
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.clear-search {
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-speed);
}

.clear-search:hover {
    color: var(--text);
}

.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.view-btn:hover {
    color: var(--text);
}

.view-btn.active {
    background: var(--bg-elevated);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* File Browser */
.file-browser {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
}

.file-list {
    padding: 0.5rem;
}

/* List View Styles */
.file-list.list-view .file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.file-list.list-view .file-item:hover {
    background: var(--bg-secondary);
}

.file-list.list-view .file-item.selected {
    background: var(--primary-light);
}

.file-list.list-view .file-item-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-list.list-view .file-item-icon.folder {
    background: var(--warning-light);
    color: var(--warning);
}

.file-list.list-view .file-item-icon.file {
    color: var(--text-muted);
}

.file-list.list-view .file-item-icon.image {
    background: var(--success-light);
    color: var(--success);
}

.file-list.list-view .file-item-icon.code {
    background: var(--primary-light);
    color: var(--primary);
}

.file-list.list-view .file-item-icon.archive {
    background: var(--danger-light);
    color: var(--danger);
}

.file-list.list-view .file-item-info {
    flex: 1;
    min-width: 0;
}

.file-list.list-view .file-item-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-list.list-view .file-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.file-list.list-view .file-item-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.file-list.list-view .file-item:hover .file-item-actions {
    opacity: 1;
}

.file-item-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.file-item-action:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Grid View Styles */
.file-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.file-list.grid-view .file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: center;
}

.file-list.grid-view .file-item:hover {
    background: var(--bg-secondary);
}

.file-list.grid-view .file-item.selected {
    background: var(--primary-light);
}

.file-list.grid-view .file-item-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.file-list.grid-view .file-item-icon svg {
    width: 28px;
    height: 28px;
}

.file-list.grid-view .file-item-icon.folder {
    background: var(--warning-light);
    color: var(--warning);
}

.file-list.grid-view .file-item-icon.file {
    color: var(--text-muted);
}

.file-list.grid-view .file-item-info {
    width: 100%;
}

.file-list.grid-view .file-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.file-list.grid-view .file-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-list.grid-view .file-item-actions {
    display: none;
}

/* Folder Group */
.folder-group {
    margin-bottom: 0.5rem;
}

.folder-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.folder-toggle:hover {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.folder-toggle svg {
    transition: transform var(--transition-speed);
}

.folder-toggle.collapsed svg {
    transform: rotate(-90deg);
}

.folder-contents {
    padding-left: 1.5rem;
}

.folder-contents.hidden {
    display: none;
}

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

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem;
    color: var(--text);
}

.empty-state p {
    margin: 0;
}

/* File Preview Backdrop */
.file-preview-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
}

.file-preview-backdrop.active {
    opacity: 1;
    visibility: visible;
}

[data-theme="dark"] .file-preview-backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* File Preview */
.file-preview {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 4rem);
    max-width: 1000px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
}

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

.preview-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
}

.preview-info svg {
    color: var(--primary);
}

.preview-name {
    font-weight: 500;
}

.close-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.close-preview:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.preview-content {
    flex: 1;
    overflow: auto;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
}

.preview-content pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-content img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg, rgba(0,0,0,0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.processing-content {
    background: var(--bg-elevated);
    padding: 2rem 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

.processing-text {
    color: var(--text);
    font-weight: 500;
    margin: 0;
}

/* Features Section */
.features-section {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 2rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.feature-card p a {
    color: var(--primary);
    text-decoration: none;
}

.feature-card p a:hover {
    text-decoration: underline;
}

/* How It Works Section */
.howto-section {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.step-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Formats Section */
.formats-section {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.format-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.format-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.format-icon.zip {
    background: var(--primary-light);
    color: var(--primary);
}

.format-icon.rar {
    background: var(--danger-light);
    color: var(--danger);
}

.format-icon.sevenz {
    background: var(--success-light);
    color: var(--success);
}

.format-icon.tar {
    background: var(--warning-light);
    color: var(--warning);
}

.format-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.format-info p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.format-info p a {
    color: var(--primary);
    text-decoration: none;
}

.format-info p a:hover {
    text-decoration: underline;
}

/* Related Tools Section */
.related-section {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.related-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-speed);
}

.related-card:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.related-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.related-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--text);
}

.related-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.8125rem;
}

/* FAQ Section */
.faq-section {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    transition: all var(--transition-speed);
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question svg {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition-speed);
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 1.25rem 1rem;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.faq-answer p a {
    color: var(--primary);
    text-decoration: none;
}

.faq-answer p a:hover {
    text-decoration: underline;
}

/* Content Section */
.content-section {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.content-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 1rem;
}

.content-section h2:not(:first-child) {
    margin-top: 2rem;
}

.content-section p {
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.7;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section a {
    color: var(--primary);
    text-decoration: none;
}

.content-section a:hover {
    text-decoration: underline;
}

/* Scrollbar */
.file-browser::-webkit-scrollbar,
.preview-content::-webkit-scrollbar {
    width: 8px;
}

.file-browser::-webkit-scrollbar-track,
.preview-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.file-browser::-webkit-scrollbar-thumb,
.preview-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.file-browser::-webkit-scrollbar-thumb:hover,
.preview-content::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .archive-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .archive-actions {
        width: 100%;
    }
    
    .archive-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .view-toggle {
        align-self: flex-end;
    }
    
    .file-preview {
        max-height: 60vh;
        bottom: 1rem;
        width: calc(100% - 2rem);
        border-radius: var(--radius-md);
    }
    
    .features-grid,
    .formats-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .btn span {
        display: none;
    }
    
    .archive-actions .btn span {
        display: inline;
    }
}

@media (max-width: 480px) {
    .tool-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .tool-icon-wrapper {
        width: 56px;
        height: 56px;
    }
    
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Password Modal */
.password-modal {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg, rgba(0,0,0,0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.password-modal-content {
    background: var(--bg-elevated);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

.password-modal-content h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    color: var(--text);
}

.password-modal-content h3 svg {
    color: var(--warning);
}

.password-modal-content p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

.password-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.password-input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: all var(--transition-speed);
}

.password-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.password-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Nested file preview support */
.preview-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.preview-binary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.preview-binary svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.preview-binary p {
    color: var(--text-secondary);
    margin: 0;
}
