/* ============================================
   RAW File Viewer - Modern Stylesheet
   With Dark Mode Support
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors */
    --primary: #7c3aed;
    --primary-light: #ede9fe;
    --primary-dark: #6d28d9;
    --accent: #FF6B6B;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --danger: #EF4444;
    --purple: #8B5CF6;
    --purple-light: #EDE9FE;
    --teal: #14B8A6;
    --pink: #EC4899;
    
    /* Background Colors */
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-secondary: #f1f5f9;
    
    /* Text Colors */
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Border Colors */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --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);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Hex viewer specific */
    --hex-bg: #1e1e1e;
    --hex-text: #d4d4d4;
    --hex-offset: #569cd6;
    --hex-byte: #ce9178;
    --hex-ascii: #6a9955;
    --hex-highlight: rgba(124, 58, 237, 0.3);
    --hex-line-number: #858585;
    
    /* Format colors */
    --canon-color: #c41e3a;
    --nikon-color: #ffd100;
    --sony-color: #000000;
    --adobe-color: #ff0000;
    --fuji-color: #00a650;
    --olympus-color: #003da5;
    --panasonic-color: #0f4c81;
    --pentax-color: #e60012;
    
    /* Upload area */
    --upload-bg: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    --upload-hover-bg: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    
    /* Scrollbar */
    --scrollbar-track: var(--bg);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary: #a78bfa;
    --primary-light: rgba(167, 139, 250, 0.15);
    --primary-dark: #8b5cf6;
    --accent: #f87171;
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --danger: #f87171;
    --purple: #a78bfa;
    --purple-light: rgba(167, 139, 250, 0.15);
    
    /* Background Colors */
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-secondary: #334155;
    
    /* Text Colors */
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 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);
    
    /* Hex viewer - dark mode */
    --hex-bg: #0d1117;
    --hex-text: #c9d1d9;
    --hex-offset: #79c0ff;
    --hex-byte: #a5d6ff;
    --hex-ascii: #7ee787;
    --hex-highlight: rgba(167, 139, 250, 0.3);
    --hex-line-number: #484f58;
    
    /* Upload area */
    --upload-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --upload-hover-bg: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(139, 92, 246, 0.2) 100%);
    
    /* Scrollbar */
    --scrollbar-track: var(--bg-elevated);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 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-inline {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    color: var(--primary);
}

.tool-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

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

/* Main Tool Area */
.tool-main {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Upload Section */
.upload-section {
    padding: 3rem;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--upload-bg);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(109, 40, 217, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover,
.upload-area.active {
    border-color: var(--primary);
    background: var(--upload-hover-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-area:hover::before,
.upload-area.dragover::before,
.upload-area.active::before {
    opacity: 1;
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: translateY(-5px);
}

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

.upload-subtitle {
    color: var(--text-secondary);
    margin: 0 0 1rem;
    font-size: 1rem;
}

.upload-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    transition: background-color var(--transition-speed);
}

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

.file-type-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Progress Container */
.progress-container {
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.progress-bar-wrapper {
    height: 8px;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    display: block;
}

/* Error Container */
.error-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    margin: 1rem 2rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
}

.error-container svg {
    flex-shrink: 0;
}

.error-container span {
    flex: 1;
}

.error-close {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.error-close:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Editor Section */
.editor-section {
    padding: 0;
    animation: fadeIn 0.4s ease;
}

/* File Info Bar */
.file-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.file-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-info-item svg {
    color: var(--text-muted);
}

.format-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.format-badge svg {
    color: var(--primary);
}

/* Viewer Toolbar */
.viewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    gap: 1rem;
    flex-wrap: wrap;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.view-toggle {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-full);
    padding: 4px;
    border: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.view-toggle button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.view-toggle button.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Viewer Content */
.viewer-content {
    min-height: 400px;
    position: relative;
}

.preview-panel {
    padding: 0;
    display: none;
}

.preview-panel.active {
    display: block;
}

/* Info Panel */
.info-body {
    padding: 2rem;
}

.info-section {
    margin-bottom: 2rem;
}

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

.info-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
}

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

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-speed);
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

/* EXIF Panel */
.exif-content {
    padding: 2rem;
}

.exif-group {
    margin-bottom: 2rem;
}

.exif-group:last-child {
    margin-bottom: 0;
}

.exif-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.exif-group-title svg {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

.exif-table {
    width: 100%;
    border-collapse: collapse;
}

.exif-table tr {
    border-bottom: 1px solid var(--border-light);
}

.exif-table tr:last-child {
    border-bottom: none;
}

.exif-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.exif-table td:first-child {
    color: var(--text-secondary);
    width: 40%;
    font-weight: 500;
}

.exif-table td:last-child {
    color: var(--text);
}

.exif-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

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

/* Hex Panel */
.hex-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hex-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.hex-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hex-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.hex-nav-btn:hover:not(:disabled) {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.hex-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hex-offset {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0 0.75rem;
    min-width: 200px;
    text-align: center;
}

.hex-search {
    display: flex;
    gap: 0.5rem;
}

.hex-search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 0.875rem;
    width: 200px;
    transition: border-color 0.2s ease, background-color var(--transition-speed);
}

.hex-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.hex-search-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

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

.hex-viewer {
    flex: 1;
    background: var(--hex-bg);
    overflow: auto;
    padding: 1.5rem;
    min-height: 400px;
    max-height: 600px;
}

.hex-viewer pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--hex-text);
    white-space: pre;
}

.hex-line {
    display: flex;
    gap: 2rem;
}

.hex-line-offset {
    color: var(--hex-offset);
    min-width: 80px;
    user-select: none;
}

.hex-line-bytes {
    color: var(--hex-byte);
    min-width: 380px;
    letter-spacing: 0.1em;
}

.hex-line-ascii {
    color: var(--hex-ascii);
    border-left: 1px solid var(--border-light);
    padding-left: 1rem;
}

.hex-highlight {
    background: var(--hex-highlight);
    border-radius: 2px;
}

/* Structure Panel */
.structure-content {
    padding: 2rem;
}

.structure-item {
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: background-color var(--transition-speed);
}

.structure-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.structure-header:hover {
    background: var(--bg);
}

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

.structure-icon.header { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.structure-icon.metadata { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.structure-icon.image { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.structure-icon.thumbnail { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.structure-icon.unknown { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.structure-info {
    flex: 1;
    min-width: 0;
}

.structure-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.structure-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.structure-size {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-full);
}

.structure-toggle {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.structure-item.open .structure-toggle {
    transform: rotate(180deg);
}

.structure-body {
    display: none;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.structure-item.open .structure-body {
    display: block;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    overflow-x: auto;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: max-content;
}

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

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.stat-icon.orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.action-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Related Tools */
.related-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    flex-wrap: wrap;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.related-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.related-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.tool-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Info Sections */
.info-sections {
    margin-top: 3rem;
}

.info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    margin: 0 0 1.5rem;
    color: var(--text);
}

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

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

.feature-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    transition: all 0.2s ease, background-color var(--transition-speed);
}

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

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

.feature-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.feature-icon.green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.feature-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.feature-icon.orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }

.feature-content h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.feature-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Format Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.format-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    transition: all 0.2s ease, background-color var(--transition-speed);
}

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

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

.format-icon.canon { background: var(--canon-color); }
.format-icon.nikon { background: var(--nikon-color); color: #000; }
.format-icon.sony { background: var(--sony-color); }
.format-icon.adobe { background: var(--adobe-color); }
.format-icon.fuji { background: var(--fuji-color); }
.format-icon.olympus { background: var(--olympus-color); }
.format-icon.panasonic { background: var(--panasonic-color); }
.format-icon.pentax { background: var(--pentax-color); }

.format-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
}

.format-ext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

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

.faq-question span {
    flex: 1;
    padding-right: 1rem;
}

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

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 1.25rem 1.25rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

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

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

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.success svg {
    color: var(--success);
}

.toast-notification.error svg {
    color: var(--danger);
}

/* Fullscreen Overlay */
.fullpage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-elevated);
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.fullpage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
    flex-shrink: 0;
}

.fullpage-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.fullpage-title svg {
    color: var(--primary);
}

.fullpage-controls {
    display: flex;
    gap: 0.75rem;
}

.fullpage-content {
    flex: 1;
    overflow: auto;
    padding: 2rem;
    background: var(--bg);
}

.fullpage-document {
    background: var(--bg-elevated);
    padding: 2rem;
    border-radius: var(--radius-md);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.close-fullpage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.close-fullpage:hover {
    background: #DC2626;
}

/* Zoom Controls */
.fullpage-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.25rem;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

/* Responsive */
@media (max-width: 900px) {
    .viewer-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .action-group {
        width: 100%;
        justify-content: center;
    }
    
    .hex-controls {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .upload-section {
        padding: 2rem 1.5rem;
    }
    
    .upload-area {
        padding: 3rem 1.5rem;
    }
    
    .viewer-toolbar {
        padding: 1rem;
    }
    
    .stats-bar {
        gap: 1rem;
        padding: 1rem;
    }
    
    .action-bar {
        padding: 1.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .file-info-bar {
        justify-content: center;
    }
    
    .related-tools {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .related-links {
        width: 100%;
    }
    
    .tool-link {
        flex: 1;
        min-width: calc(50% - 0.375rem);
        justify-content: center;
    }
    
    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hex-line {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .hex-line-bytes,
    .hex-line-ascii {
        min-width: auto;
    }
    
    .hex-line-ascii {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-light);
        padding-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 1.75rem;
    }
    
    .tool-title-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .file-info-bar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .view-toggle {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .view-toggle button {
        flex: 1;
        justify-content: center;
    }
    
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .feature-item {
        flex-direction: column;
    }
    
    .format-grid {
        grid-template-columns: 1fr;
    }
    
    .fullpage-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .fullpage-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .toast-notification {
        left: 1rem;
        right: 1rem;
        transform: translateX(0) translateY(100px);
    }
    
    .toast-notification.show {
        transform: translateX(0) translateY(0);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Print Styles */
@media print {
    .upload-section,
    .viewer-toolbar,
    .action-bar,
    .stats-bar,
    .info-sections,
    .related-tools {
        display: none !important;
    }
    
    .tool-main {
        box-shadow: none;
        border: none;
    }
    
    .editor-section {
        display: block !important;
    }
    
    .preview-panel {
        display: block !important;
        max-height: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Selection */
::selection {
    background: rgba(124, 58, 237, 0.2);
    color: var(--text);
}

[data-theme="dark"] ::selection {
    background: rgba(167, 139, 250, 0.3);
}
