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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  min-height: 100vh;
  color: #e0e0e0;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

h1 {
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  font-weight: 400;
}

main {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.input-group {
  margin-bottom: 1.75rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"] {
  width: 140px;
  padding: 0.875rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

input[type="text"]:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
}

.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: rgba(0, 212, 255, 0.5);
  background: rgba(0, 212, 255, 0.05);
  transform: translateY(-2px);
}

.drop-zone-content {
  pointer-events: none;
}

.drop-zone .btn-secondary {
  pointer-events: auto;
}

.drop-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.drop-zone p {
  margin: 0.25rem 0;
  color: rgba(255, 255, 255, 0.6);
}

.or {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
}

.file-info {
  margin-top: 1rem;
  padding: 0.875rem 1.25rem;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 12px;
  display: none;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.file-info.visible {
  display: block;
}

.file-info .filename {
  font-weight: 600;
  color: #00d4ff;
}

.file-info .filesize {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.textarea-toggle {
  margin-top: 0.75rem;
}

.btn-link {
  background: none;
  border: none;
  color: rgba(0, 212, 255, 0.8);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.btn-link:hover {
  color: #00d4ff;
}

textarea {
  width: 100%;
  min-height: 200px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  color: #e0e0e0;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.875rem;
  resize: vertical;
  margin-top: 0.75rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.hidden {
  display: none !important;
}

.actions {
  text-align: center;
  margin: 2.5rem 0;
}

.btn-primary,
.btn-secondary {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  font-size: 1.1rem;
}

.output-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.output-header h2 {
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
  font-weight: 600;
}

.output-actions {
  display: flex;
  gap: 0.75rem;
}

.stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.stat-value {
  font-weight: 700;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.warnings {
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.warnings h4 {
  color: #ffc107;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.warnings ul {
  margin-left: 1.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.preview-container {
  margin-top: 1rem;
}

pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.8rem;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.error-section {
  margin-top: 1.5rem;
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
}

.error-section h3 {
  color: #dc3545;
  margin-bottom: 0.5rem;
}

.error-section pre {
  background: rgba(0, 0, 0, 0.3);
  color: #ff6b6b;
}

/* Status bar */
.status-bar {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.status-ok {
  color: #10b981;
}

.status-error {
  color: #ef4444;
}

.status-loading {
  color: #f59e0b;
}

/* Preview Tabs */
.preview-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.875rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.tab-btn.active {
  color: #00d4ff;
  border-bottom-color: #00d4ff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Table Controls */
.table-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-top: 1.25rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: #e0e0e0;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.table-controls select {
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: #e0e0e0;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.table-controls select:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
}

.table-controls select option {
  background: #1a1a2e;
  color: #e0e0e0;
}

/* Table Wrapper */
.table-wrapper {
  max-height: 600px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

/* Custom scrollbar */
.table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

#csvTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#csvTable thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

#csvTable th {
  background: rgba(0, 212, 255, 0.1);
  color: rgba(0, 212, 255, 0.9);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  backdrop-filter: blur(10px);
}

#csvTable td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: top;
  max-width: 350px;
  word-wrap: break-word;
  color: rgba(255, 255, 255, 0.8);
}

#csvTable tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

#csvTable .col-key {
  width: 28%;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.75rem;
  color: rgba(0, 212, 255, 0.8);
}

#csvTable .col-en,
#csvTable .col-trans {
  width: 36%;
}

#csvTable td .empty {
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
}

#csvTable td.untranslated {
  background: rgba(255, 193, 7, 0.08);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2s forwards;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.3);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

footer {
  text-align: center;
  margin-top: 2.5rem;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  main {
    padding: 1.5rem;
    border-radius: 16px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .output-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .table-controls {
    flex-direction: column;
  }
}
