/* OpenSend - Clean Design with Maroon Theme */

:root {
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-sm: 4px;
  
  /* Light mode colors (default) */
  --bg-primary: #FFFFFF;
  --bg-secondary: #FAF9F9;
  --bg-tertiary: #F3F1F1;
  --bg-hover: #EBE8E8;
  
  --text-primary: #1F1A1A;
  --text-secondary: #5C5252;
  --text-muted: #8A7F7F;
  
  --accent: #8B2635;
  --accent-hover: #6E1E2A;
  --accent-light: #F8E8EA;
  
  --success: #2D7D46;
  --warning: #B8860B;
  --danger: #C41E3A;
  
  --border: #E0DADA;
  --border-focus: #8B2635;
  
  /* Preview colors (light) */
  --preview-bg: #1a1a1a;
  --preview-toolbar-bg: #2a2a2a;
  --preview-border: #3a3a3a;
  --preview-text: #ccc;
  --preview-text-muted: #888;
}

/* Dark mode colors */
[data-theme="dark"] {
  --bg-primary: #1C1917;
  --bg-secondary: #141211;
  --bg-tertiary: #292524;
  --bg-hover: #3D3836;
  
  --text-primary: #F5F5F4;
  --text-secondary: #A8A29E;
  --text-muted: #78716C;
  
  --accent: #DC626D;
  --accent-hover: #E8838C;
  --accent-light: #3D2527;
  
  --success: #4ADE80;
  --warning: #FBBF24;
  --danger: #F87171;
  
  --border: #3D3836;
  --border-focus: #DC626D;
  
  --preview-bg: #0D0C0B;
  --preview-toolbar-bg: #1C1917;
  --preview-border: #292524;
  --preview-text: #E7E5E4;
  --preview-text-muted: #78716C;
}

/* System preference dark mode (when theme is "system") */
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg-primary: #1C1917;
    --bg-secondary: #141211;
    --bg-tertiary: #292524;
    --bg-hover: #3D3836;
    
    --text-primary: #F5F5F4;
    --text-secondary: #A8A29E;
    --text-muted: #78716C;
    
    --accent: #DC626D;
    --accent-hover: #E8838C;
    --accent-light: #3D2527;
    
    --success: #4ADE80;
    --warning: #FBBF24;
    --danger: #F87171;
    
    --border: #3D3836;
    --border-focus: #DC626D;
    
    --preview-bg: #0D0C0B;
    --preview-toolbar-bg: #1C1917;
    --preview-border: #292524;
    --preview-text: #E7E5E4;
    --preview-text-muted: #78716C;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.logo:hover {
  text-decoration: none;
}

.doc-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.app-main {
  flex: 1;
  padding: 2rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.app-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.github-link:hover {
  color: var(--text-primary);
}

.github-link svg {
  flex-shrink: 0;
}

/* Flash */
.flash {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.flash-notice {
  background: #E8F5E9;
  color: #1B5E20;
  border: 1px solid #C8E6C9;
}

.flash-alert {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #E8C4C9;
}

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

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-primary);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dropzone-active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.dropzone:hover .dropzone-icon,
.dropzone.dropzone-active .dropzone-icon {
  color: var(--accent);
}

.dropzone-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.dropzone-limit {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.file-input {
  display: none;
}

/* Progress */
.upload-progress {
  padding: 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.upload-file-info {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
  word-break: break-all;
}

.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.15s ease;
  border-radius: 3px;
}

.progress-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Documents List */
.documents-section {
  margin-top: 2rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.documents-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.document-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.1s ease;
  text-decoration: none;
  color: inherit;
}

.document-card:hover {
  background: var(--bg-tertiary);
  text-decoration: none;
}

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

.document-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* File Icon */
.file-icon {
  position: relative;
  width: 32px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon.large {
  width: 40px;
  height: 48px;
}

.file-icon svg {
  width: 100%;
  height: 100%;
}

.file-ext {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-lg {
  padding: 0.625rem 1.25rem;
}

.btn-block {
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

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

.btn-secondary:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

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

.btn-danger:hover {
  background: #E8C4C9;
  text-decoration: none;
}

/* File Page */
.file-page {
  max-width: 560px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.file-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.file-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

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

.file-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  margin-bottom: 0.125rem;
}

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

.file-actions {
  display: flex;
  align-items: stretch;
  gap: 0.375rem;
  flex-shrink: 0;
}

.file-actions form {
  display: flex;
}

.file-actions form .btn {
  height: 100%;
}

/* Share Section */
.share-section {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.link-box {
  margin-bottom: 1.5rem;
}

.link-box label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.link-input-group {
  display: flex;
  gap: 0.5rem;
}

.link-input {
  flex: 1;
  padding: 0.625rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.link-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Settings Form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-section h3 {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.setting-row {
  margin-bottom: 1rem;
}

.setting-row:last-child {
  margin-bottom: 0;
}

.setting-row > label:not(.toggle-label) {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.setting-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}

.toggle-input:checked + .toggle-switch {
  background: var(--accent);
}

.toggle-input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

.toggle-text {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Password Input */
.password-input-group {
  display: flex;
  gap: 0.5rem;
}

.password-input-group .form-input {
  flex: 1;
}

/* Form Input */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.875rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(139, 38, 53, 0.15);
}

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

/* Expiry Picker */
.expiry-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.expiry-shortcuts {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.25rem 0.625rem;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 999px;
  font-family: var(--font-family);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s ease;
}

.chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Country Select */
.country-select {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.country-select select {
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.country-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.1s ease;
}

.country-chip:has(input:checked) {
  background: var(--accent);
  color: white;
}

.country-chip input {
  display: none;
}

/* Advanced Section */
.advanced-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.advanced-section summary {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.advanced-section summary::-webkit-details-marker {
  display: none;
}

.advanced-section summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid var(--text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}

.advanced-section[open] summary::before {
  transform: rotate(90deg);
}

.advanced-section .settings-section {
  padding-top: 1rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Share View (Public) */
.share-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-secondary);
}

.share-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.share-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

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

.share-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.share-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.share-actions {
  margin-top: 1.25rem;
}

.share-actions .btn {
  width: 100%;
}

.no-download-notice {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.share-expires {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.powered-by {
  margin-top: 1.5rem;
}

.powered-by a {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.powered-by a:hover {
  color: var(--text-secondary);
  text-decoration: none;
}

/* Auth Card */
.auth-card {
  text-align: center;
}

.auth-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.auth-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-bottom: 1.5rem;
}

.auth-form .form-group {
  margin-bottom: 0.75rem;
}

.auth-privacy {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Error Card */
.error-card {
  text-align: center;
}

.error-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.error-message {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-bottom: 1.5rem;
}

/* Share Page with Preview */
.share-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

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

.share-file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.share-filename {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.share-filemeta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.share-actions-bar {
  display: flex;
  gap: 0.5rem;
}

.share-preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.share-expires-notice {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.75rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.share-footer {
  text-align: center;
  padding: 1rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.share-footer a {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preview Container */
.preview-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--preview-bg);
}

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

.preview-filename {
  font-size: 0.8125rem;
  color: var(--preview-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-lang {
  font-size: 0.6875rem;
  color: var(--preview-text-muted);
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.preview-info {
  font-size: 0.6875rem;
  color: var(--preview-text-muted);
  margin-left: 0.5rem;
}

.preview-actions {
  display: flex;
  gap: 0.25rem;
}

.preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--preview-text-muted);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.preview-btn:hover {
  background: var(--preview-border);
  color: var(--preview-text);
}

.preview-frame {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-frame:fullscreen {
  background: var(--preview-bg);
}

/* PDF Viewer */
.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  min-height: 600px;
}

/* Image Viewer */
.image-preview .preview-frame {
  padding: 2rem;
  overflow: auto;
}

.preview-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  transition: transform 0.15s ease;
}

/* Video Viewer */
.preview-video {
  max-width: 100%;
  max-height: 80vh;
}

/* Audio Viewer */
.audio-preview .preview-frame {
  flex-direction: column;
  gap: 2rem;
  padding: 3rem;
}

.audio-icon {
  color: var(--preview-text-muted);
}

.preview-audio {
  width: 100%;
  max-width: 400px;
}

/* Text/Code Viewer */
.text-preview .preview-frame,
.code-preview .preview-frame {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
}

.text-content,
.code-content {
  width: 100%;
  margin: 0;
  padding: 1.5rem;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--preview-text);
  background: var(--preview-bg);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
}

.code-content code {
  font-family: inherit;
}

/* Spreadsheet Viewer */
.spreadsheet-preview .preview-frame {
  align-items: flex-start;
  justify-content: flex-start;
  background: var(--bg-primary);
}

.table-wrapper {
  width: 100%;
  overflow: auto;
}

.spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.spreadsheet-table th,
.spreadsheet-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.spreadsheet-table th {
  background: var(--bg-tertiary);
  font-weight: 500;
  position: sticky;
  top: 0;
}

.spreadsheet-table tr:nth-child(even) {
  background: var(--bg-secondary);
}

/* Office Viewer */
.office-content {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: white;
  color: #333;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.docx-content {
  padding: 2rem 3rem;
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  line-height: 1.7;
}

.docx-content h1, .docx-content h2, .docx-content h3 {
  font-family: var(--font-family);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.docx-content p {
  margin-bottom: 1em;
}

.docx-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.docx-content th, .docx-content td {
  border: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
}

.xlsx-content {
  padding: 1rem;
}

.xlsx-content table {
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.xlsx-content th, .xlsx-content td {
  border: 1px solid #ddd;
  padding: 0.375rem 0.5rem;
  text-align: left;
  white-space: nowrap;
}

.xlsx-content th {
  background: #f5f5f5;
  font-weight: 500;
}

/* No Preview */
.no-preview {
  background: var(--bg-secondary);
}

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

.no-preview-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.no-preview-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.preview-error {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 2rem;
}

/* Theme Selector */
.theme-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 0.375rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 100;
}

.theme-selector.open .theme-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  text-align: left;
}

.theme-option:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.theme-option.active {
  background: var(--accent-light);
  color: var(--accent);
}

.theme-option svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.theme-option-check {
  margin-left: auto;
  opacity: 0;
}

.theme-option.active .theme-option-check {
  opacity: 1;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 0.75rem 1rem;
  }
  
  .app-main {
    padding: 1rem;
  }
  
  .dropzone {
    padding: 3rem 1rem;
  }
  
  .file-header {
    flex-wrap: wrap;
  }
  
  .file-actions {
    width: 100%;
    margin-top: 0.75rem;
  }
  
  .link-input-group {
    flex-direction: column;
  }
  
  .link-input-group .btn {
    width: 100%;
  }
  
  .share-header-bar {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .share-actions-bar {
    justify-content: stretch;
  }
  
  .share-actions-bar .btn {
    flex: 1;
  }
}
