/* TableConvert-inspired UI */
:root {
  --bg: #0d1117;
  --panel: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --accent: #10b981;
  --accent-2: #14b8a6;
  --border: #1f2937;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --panel: #ffffff;
  --card: #f1f5f9;
  --muted: #64748b;
  --text: #0f172a;
  --accent: #0ea5e9;
  --accent-2: #6366f1;
  --border: #e2e8f0;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(120% 120% at 20% 20%, rgba(16, 185, 129, 0.14), transparent),
    radial-gradient(120% 120% at 80% 0%, rgba(99, 102, 241, 0.12), transparent),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
}

.page { max-width: 1240px; margin: 0 auto; }

.tc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.12), rgba(79, 70, 229, 0.12));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 18px; }
.brand i { color: var(--accent); }

.nav-links { display: flex; gap: 14px; align-items: center; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-links a.active, .nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.06); }

.tc-hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  padding: 26px;
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(16, 185, 129, 0.12), rgba(99, 102, 241, 0.12)), var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hero-text h1 { font-size: 32px; margin-bottom: 10px; }
.hero-text p { color: var(--muted); margin-bottom: 16px; }
.hero-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.hero-actions .primary, .hero-actions .ghost {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: var(--text);
}
.hero-actions .primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #f8fafc; border: none; }
.hero-actions .primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.hero-actions .ghost { background: rgba(255, 255, 255, 0.04); }
.hero-actions .ghost:hover { background: rgba(255, 255, 255, 0.08); }

.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-badges span {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}
.ad-container, .adsbygoogle { display: none !important; }

.hero-preview { display: grid; gap: 10px; align-content: start; }
.mini-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.mini-card .label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.mini-card .value { font-weight: 700; }

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-header h2 { font-size: 20px; margin-bottom: 4px; }
.panel-header .eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; color: var(--muted); }
.panel-header .sub { color: var(--muted); font-size: 13px; }

.drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 26px 18px;
  text-align: center;
  background: var(--card);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 12px;
}
.drop-zone:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.drop-zone.dragover { border-color: var(--accent); background: rgba(16, 185, 129, 0.08); }

.drop-zone-content { pointer-events: none; }
.upload-icon { font-size: 32px; color: var(--accent); margin-bottom: 10px; display: block; }
.drop-zone h3 { margin-bottom: 4px; }
.drop-zone p { color: var(--muted); margin-bottom: 10px; }
.file-input { display: none; }
.browse-btn {
  pointer-events: all;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #f8fafc;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.paste-area { display: grid; gap: 6px; margin-bottom: 12px; }
.paste-area label { color: var(--muted); font-size: 13px; }
.paste-area textarea {
  min-height: 96px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 12px;
  resize: vertical;
}
.secondary {
  justify-self: start;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.file-info { margin-bottom: 12px; }
.file-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
}
.file-icon-wrapper { width: 44px; height: 44px; border-radius: 10px; background: rgba(16, 185, 129, 0.12); display: grid; place-items: center; }
.file-icon { color: var(--accent); }
.file-name { font-weight: 700; }
.file-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.remove-file-btn { border: none; background: none; color: var(--muted); cursor: pointer; }

.format-row { display: grid; gap: 6px; margin-bottom: 10px; }
.format-row label { font-weight: 600; }
.format-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
}

.options-row { display: flex; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.checkbox { display: flex; gap: 6px; align-items: center; }

.advanced-settings-panel summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.settings-content { padding: 8px 0; }

.convert-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #f8fafc;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.convert-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.tab-btn { padding: 8px 12px; background: var(--card); border: none; color: var(--muted); cursor: pointer; }
.tab-btn.active { background: rgba(16, 185, 129, 0.12); color: var(--text); }

.preview-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview-pane { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); min-height: 180px; padding: 10px; display: none; }
.preview-pane.active { display: block; }
.preview-pane .preview-header { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 6px; font-size: 12px; }
.code-preview { white-space: pre-wrap; word-break: break-word; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px; color: var(--text); max-height: 320px; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px; }

.preview-actions { display: flex; gap: 8px; margin-top: 8px; }
.copy-btn, .fullscreen-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.download-section { margin-top: 12px; }
.download-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--card); }
.download-icon { color: var(--accent); }
.download-btn { padding: 10px 12px; border-radius: 10px; border: none; background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #f8fafc; cursor: pointer; }

.conversion-matrix-section { margin: 20px 0; padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-header h2 { font-size: 18px; }
.section-header p { color: var(--muted); font-size: 13px; }
.conversion-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.conversion-matrix .conversion-item { padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease; color: var(--text); text-align: center; font-size: 14px; }
.conversion-matrix .conversion-item:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.conversion-matrix .conversion-item strong { color: var(--accent); margin: 0 6px; }
.conversion-item-from, .conversion-item-to { font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.feature-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 13px; }

.status-message { position: fixed; bottom: 20px; right: 20px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; box-shadow: var(--shadow); }
.status-icon { color: var(--accent); }
.status-title { font-weight: 700; }
.status-description { color: var(--muted); font-size: 12px; }
.status-close { border: none; background: none; color: var(--muted); cursor: pointer; }
.site-footer { margin-top: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.footer-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 10px; }
.footer-main h4 { margin-bottom: 6px; }
.footer-main p { color: var(--muted); font-size: 13px; }
.footer-bottom { color: var(--muted); font-size: 12px; }

.loading-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; }
.loading-card { background: var(--panel); padding: 20px; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); text-align: center; }
.loading-spinner { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.spinner-ring { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(120deg, var(--accent), var(--accent-2)); animation: pulse 1s infinite alternate; }
.spinner-ring:nth-child(2) { animation-delay: 0.2s; }
.spinner-ring:nth-child(3) { animation-delay: 0.4s; }
.progress-bar { margin-top: 10px; height: 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(120deg, var(--accent), var(--accent-2)); transition: width 0.3s ease; }

.hidden { display: none !important; }

@keyframes pulse { to { transform: translateY(-3px); opacity: 0.6; } }

@media (max-width: 960px) {
  .tc-hero { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  body { padding: 16px; }
}
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(10px);
    }
    60% {
        transform: translateX(5px);
    }
}

.conversion-options {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    position: relative;
}

/* Advanced Settings Panel */
.advanced-settings-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1.5rem 0;
    cursor: pointer;
}

.advanced-settings-panel summary {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.5rem;
    outline: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advanced-settings-panel summary::-webkit-details-marker {
    color: var(--primary-color);
}

.advanced-settings-panel[open] summary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.settings-group small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.setting-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.convert-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.convert-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview Section */
.preview-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow);
    margin-top: 14px;
}

.preview-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.copy-btn, .fullscreen-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.copy-btn:hover, .fullscreen-btn:hover {
    background: rgba(16, 185, 129, 0.12);
}

.preview-tabs {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tab-btn {
    padding: 8px 12px;
    background: var(--card);
    border: none;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

.preview-content {
    position: relative;
    min-height: 400px;
}

.preview-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.preview-pane.active {
    opacity: 1;
    visibility: visible;
}

.preview-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.preview-label {
    font-weight: 600;
    color: var(--text-primary);
}

.preview-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.code-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary);
}

.code-preview::-webkit-scrollbar {
    width: 8px;
}

.code-preview::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.code-preview::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.code-preview::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Download Section */
.download-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.download-card {
    background: var(--success-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.download-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.download-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.download-info p {
    opacity: 0.9;
    font-size: 0.875rem;
}

.download-btn {
    background: white;
    color: var(--success-color);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Status Messages */
.status-message {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.status-message.success {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.status-message.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.status-message.warning {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.status-icon {
    font-size: 1.5rem;
}

.status-message.success .status-icon {
    color: var(--success-color);
}

.status-message.error .status-icon {
    color: var(--error-color);
}

.status-message.warning .status-icon {
    color: var(--warning-color);
}

.status-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.status-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.status-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.status-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Footer */
.footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.format-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.format-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--primary-color);
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    border-right-color: var(--primary-color);
    animation-delay: 0.2s;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: var(--primary-color);
    animation-delay: 0.4s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }

    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .format-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .conversion-arrow {
        transform: rotate(90deg);
    }

    .conversion-options {
        flex-direction: column;
        gap: 1rem;
    }

    .download-card {
        flex-direction: column;
        text-align: center;
    }

    .download-btn {
        margin-left: 0;
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .format-tags {
        justify-content: center;
    }

    .preview-actions {
        flex-direction: column;
    }

    .copy-btn, .fullscreen-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo i {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .file-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .loading-card {
        padding: 2rem;
    }
}

/* Focus Styles */
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Data Table Editor Styles */
.data-table-editor {
    margin: 2rem 0;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.table-search {
    flex: 1;
    min-width: 250px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.table-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.row-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.data-table th.sortable:hover {
    background-color: var(--border-color);
}

.sort-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.5;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.data-table td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.data-table td.editable {
    cursor: pointer;
    position: relative;
}

.data-table td.editable:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.cell-value {
    display: block;
    padding: 0.25rem;
}

.cell-edit-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

.cell-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.actions-cell {
    text-align: center;
    padding: 0.5rem !important;
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.add-row-btn {
    margin: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.add-row-btn:hover {
    background-color: var(--primary-hover);
}

/* Table format output styling */
.html-table-output {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.html-table-output thead {
    background-color: var(--bg-tertiary);
}

.html-table-output th,
.html-table-output td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.html-table-output th {
    font-weight: 600;
    color: var(--text-primary);
}

.html-table-output tbody tr:nth-child(odd) {
    background-color: var(--bg-secondary);
}

.html-table-output tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* Conversion Matrix Section */
.conversion-matrix-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.conversion-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.conversion-item {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.conversion-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: white;
}

.conversion-item strong {
    display: block;
    margin: 0.5rem 0;
    font-size: 1rem;
}

.conversion-item-from,
.conversion-item-to {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}