/* ============================================
   CSV File Viewer - Modern Stylesheet
   Matching ConvertICO design system (MD Viewer style)
   ============================================ */

/* CSS Variables */
:root {
    --primary: #0EA5E9;
    --primary-light: #BAE6FD;
    --primary-dark: #0284C7;
    --accent: #FF6B6B;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --danger: #EF4444;
    --purple: #8B5CF6;
    --purple-light: #EDE9FE;
    
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    
    --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-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Table specific */
    --table-bg: #ffffff;
    --table-header-bg: #f1f5f9;
    --table-border: #e2e8f0;
    --table-stripe: #f8fafc;
    --table-hover: #f0f9ff;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    
    --table-bg: #1e293b;
    --table-header-bg: #334155;
    --table-border: #475569;
    --table-stripe: #0f172a;
    --table-hover: #334155;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, #f1f5f9 100%);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, var(--bg) 0%, #1e293b 100%);
}

/* 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);
}

/* 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: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(2, 132, 199, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover,
.upload-area.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    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-block;
    background: var(--bg);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}

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

.file-type-badge {
    background: linear-gradient(135deg, var(--success-light), #bbf7d0);
    color: var(--success);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Viewer Section */
.viewer-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: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .file-info-bar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

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

.file-info-item svg {
    color: var(--primary);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Options Panel */
.options-panel {
    padding: 1.25rem 2rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.options-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.option-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-group select {
    padding: 0.6rem 2rem 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.option-group select:hover {
    border-color: var(--primary);
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Checkbox Option */
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-option label {
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    margin: 0;
}

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

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

/* View Toggle */
.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg);
}

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

.view-toggle button:not(:last-child) {
    border-right: 1px solid var(--border);
}

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

.view-toggle button.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.view-toggle button svg {
    width: 16px;
    height: 16px;
}

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

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

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

.toolbar-btn svg {
    width: 18px;
    height: 18px;
}

/* Content Area */
.viewer-content {
    min-height: 400px;
    max-height: 65vh;
    overflow: auto;
    border-bottom: 1px solid var(--border);
    background: var(--table-bg);
}

/* CSV Table Display */
.csv-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.csv-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.csv-table th {
    background: var(--table-header-bg);
    color: var(--text);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
}

.csv-table th .col-index {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    margin-right: 8px;
}

.csv-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--table-border);
    color: var(--text);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csv-table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}

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

.csv-table .row-number {
    color: var(--text-muted);
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    padding-right: 16px;
    border-right: 1px solid var(--table-border);
    min-width: 50px;
    text-align: right;
}

/* JSON Display */
.json-display {
    padding: 2rem;
    background: var(--table-bg);
    font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text);
}

.json-display .json-key {
    color: var(--primary);
}

.json-display .json-string {
    color: var(--success);
}

.json-display .json-number {
    color: var(--warning);
}

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

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    opacity: 0.5;
    color: var(--primary);
}

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

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

[data-theme="dark"] .stats-bar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.stats-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stats-bar .stat-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    color: var(--primary);
}

.stats-bar .stat-item strong {
    color: var(--text);
    font-weight: 600;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

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

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

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

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

.fullpage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    flex-wrap: wrap;
    gap: 1rem;
}

.fullpage-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.fullpage-title svg {
    width: 24px;
    height: 24px;
}

.fullpage-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: rgba(255,255,255,0.3);
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
}

.keyboard-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.5rem;
}

.close-fullpage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-fullpage:hover {
    background: rgba(255,255,255,0.25);
}

.close-fullpage svg {
    width: 18px;
    height: 18px;
}

.fullpage-content {
    flex: 1;
    overflow: auto;
    padding: 0;
}

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

.fullpage-table th,
.fullpage-table td {
    padding: 12px 16px;
    border: 1px solid var(--table-border);
    text-align: left;
}

.fullpage-table th {
    background: var(--table-header-bg);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fullpage-table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}

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

/* Zoom classes */
.fullpage-table.zoom-75 { font-size: 11px; }
.fullpage-table.zoom-75 th, .fullpage-table.zoom-75 td { padding: 8px 12px; }

.fullpage-table.zoom-90 { font-size: 13px; }
.fullpage-table.zoom-90 th, .fullpage-table.zoom-90 td { padding: 10px 14px; }

.fullpage-table.zoom-100 { font-size: 14px; }

.fullpage-table.zoom-110 { font-size: 15px; }
.fullpage-table.zoom-110 th, .fullpage-table.zoom-110 td { padding: 14px 18px; }

.fullpage-table.zoom-125 { font-size: 17px; }
.fullpage-table.zoom-125 th, .fullpage-table.zoom-125 td { padding: 16px 20px; }

.fullpage-table.zoom-150 { font-size: 20px; }
.fullpage-table.zoom-150 th, .fullpage-table.zoom-150 td { padding: 18px 24px; }

/* Cell Tooltip */
.cell-tooltip {
    position: fixed;
    background: var(--text);
    color: var(--bg-elevated);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 13px;
    max-width: 400px;
    word-wrap: break-word;
    z-index: 10001;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

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

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

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

.info-card h2 svg {
    color: var(--primary);
    width: 24px;
    height: 24px;
}

/* Steps List */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

.steps-list li {
    position: relative;
    padding-left: 3.5rem;
    padding-bottom: 1.25rem;
    margin-left: 1rem;
    counter-increment: step;
}

.steps-list li:not(:last-child) {
    border-left: 2px solid var(--primary-light);
}

.steps-list li:last-child {
    padding-bottom: 0;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: -1rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

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

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

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

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-icon.blue { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.feature-icon.green { background: linear-gradient(135deg, var(--success), #059669); }
.feature-icon.purple { background: linear-gradient(135deg, var(--purple), #7C3AED); }
.feature-icon.orange { background: linear-gradient(135deg, var(--warning), #D97706); }

.feature-content h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

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

/* Delimiter Badges */
.delimiter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.delimiter-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.delimiter-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.delimiter-badge code {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
}

/* FAQ */
.faq-list {
    display: grid;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

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

.faq-question svg {
    color: var(--primary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

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

.faq-answer {
    display: none;
    padding: 0 1.25rem 1rem;
    background: var(--bg-elevated);
}

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

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

/* Progress indicator */
.progress-bar-container {
    padding: 2rem;
    display: none;
}

.progress-track {
    height: 8px;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

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

.progress-text {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Error Display */
.error-banner {
    display: none;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: var(--danger);
    margin: 1rem 2rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.error-banner svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.error-banner.show {
    display: flex;
}

/* Responsive */
@media (max-width: 900px) {
    .viewer-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
    
    .options-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .option-group {
        width: 100%;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .fullpage-header {
        flex-direction: column;
        text-align: center;
    }
    
    .fullpage-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .upload-section {
        padding: 2rem 1.5rem;
    }
    
    .upload-area {
        padding: 3rem 1.5rem;
    }
    
    .viewer-toolbar {
        padding: 1rem;
    }
    
    .options-panel {
        padding: 1rem;
    }
    
    .stats-bar {
        gap: 1rem;
        padding: 1rem;
    }
    
    .action-bar {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .file-info-bar {
        justify-content: center;
    }
}

@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%;
    }
    
    .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.5rem;
    }
    
    .feature-item {
        flex-direction: column;
    }
    
    .delimiter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 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,
    .options-panel,
    .info-sections {
        display: none !important;
    }
    
    .tool-main {
        box-shadow: none;
        border: none;
    }
    
    .viewer-section {
        display: block !important;
    }
    
    .viewer-content {
        max-height: none;
        overflow: visible;
    }
}

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