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

body {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: #0f0f0f;
  color: #e4e4e7;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 1.5rem;
  position: relative;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (min-width: 768px) {
  .header {
    padding: 1rem 0 2rem;
    flex-wrap: nowrap;
    gap: 0;
  }
}

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

.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #27272a, #18181b);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
  .title {
    font-size: 1.8rem;
  }
}

.subtitle {
  color: #a1a1aa;
  font-size: 0.9rem;
  font-weight: 400;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #27272a;
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .tabs {
    gap: 0.5rem;
  }
}

.tab-btn {
  appearance: none;
  border: 1px solid #27272a;
  background: transparent;
  color: #a1a1aa;
  padding: 0.625rem 0.875rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

@media (min-width: 640px) {
  .tab-btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

.tab-btn[aria-selected="true"] {
  background: #27272a;
  border-color: #3f3f46;
  color: #ffffff;
}

.tab-btn:hover:not([aria-selected="true"]) {
  border-color: #3f3f46;
  color: #d4d4d8;
}

.tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .grid {
    gap: 2rem;
    margin-bottom: 4rem;
  }
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.tool-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .tool-card {
    border-radius: 18px;
    padding: 2rem;
  }
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  transition: left 0.5s ease;
}

.tool-card:hover::before {
  left: 100%;
}

.tool-card:hover {
  border-color: #3f3f46;
  transform: translateY(-2px);
}

.tool-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-weight: 700;
}

@media (min-width: 640px) {
  .tool-title {
    font-size: 1.25rem;
  }
}

.tool-description {
  color: #a1a1aa;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #d4d4d8;
  font-size: 0.85rem;
  font-weight: 500;
}

.form-select,
.form-input {
  width: 100%;
  padding: 0.875rem;
  background: #0f0f0f;
  border: 1px solid #27272a;
  border-radius: 12px;
  color: #e4e4e7;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a1a1aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.form-select:hover {
  border-color: #3f3f46;
  background-color: #18181b;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Custom select option styling */
.form-select option {
  background: #0f0f0f;
  color: #d4d4d8;
  padding: 0.75rem;
  font-size: 0.9rem;
  border: none;
}

.form-select option:hover {
  background: #18181b !important;
  color: #ffffff !important;
}

.form-select option:checked {
  background: #27272a;
  color: #ffffff;
  font-weight: 600;
}

/* Webkit specific option styling */
.form-select option:checked {
  background: linear-gradient(#27272a, #27272a);
}

/* Firefox specific styling */
.form-select option {
  background-color: #0f0f0f;
  color: #d4d4d8;
}

.form-select option:checked {
  background-color: #27272a;
  color: #ffffff;
}

.form-select[multiple] {
  min-height: 140px;
}

/* Custom Scrollbar for Target Languages */
.form-select[multiple]::-webkit-scrollbar {
  width: 8px;
}

.form-select[multiple]::-webkit-scrollbar-track {
  background: #18181b;
  border-radius: 4px;
}

.form-select[multiple]::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
  border: 1px solid #27272a;
}

.form-select[multiple]::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

/* Firefox custom scrollbar */
.form-select[multiple] {
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 #18181b;
} 

/* Dropzone */
.dropzone {
  width: 100%;
  height: 100px;
  border: 2px dashed #3f3f46;
  border-radius: 12px;
  background: #0f0f0f;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

@media (min-width: 640px) {
  .dropzone {
    height: 120px;
  }
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #ffffff;
  background: #121214;
}

.dropzone-content {
  font-weight: 700;
  color: #d4d4d8;
}

.dropzone-hint {
  color: #a1a1aa;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: #ffffff;
  color: #0f0f0f;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .btn {
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
  }
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100%;
  height: 100%;
  background: #27272a;
  transition: transform 0.3s ease;
  z-index: -1;
}

.btn:hover::before {
  transform: translate(-50%, -50%) scale(1);
}

.btn:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  text-align: center;
}

@media (min-width: 640px) {
  .toolbar {
    gap: 1rem;
  }
}

.status {
  color: #a1a1aa;
  font-size: 0.8rem;
}

.muted {
  color: #a1a1aa;
  font-size: 0.8rem;
}

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 2px 6px;
  border: 1px solid #27272a;
  border-radius: 4px;
  background: #18181b;
  font-size: 0.75rem;
}

.hr {
  height: 1px;
  background: #27272a;
  border: 0;
  margin: 1rem 0;
}

/* Credit */
.credit {
  position: fixed;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .credit {
    bottom: 1rem;
    padding: 0;
  }
}

.credit-text {
  color: #a1a1aa;
  font-size: 0.8rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  animation: float 4s ease-in-out infinite;
}

@media (min-width: 640px) {
  .credit-text {
    font-size: 0.9rem;
  }
}

.heart {
  display: inline-block;
  color: #ef4444;
  animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 20% { transform: scale(1); }
  10% { transform: scale(1.2); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* Hidden utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Panel visibility */
[role="tabpanel"][hidden] {
  display: none;
}

/* GitHub Corner */
.github-corner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
}

.github-corner svg {
  fill: #ffffff;
  color: #0f0f0f;
  width: 60px;
  height: 60px;
}

.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(-25deg); }
  40%, 80% { transform: rotate(10deg); }
}

/* Custom Language List for Target Languages */
.lang-list {
  margin-top: 0.5rem;
  background: #0f0f0f;
  border: 1px solid #27272a;
  border-radius: 12px;
  max-height: 160px;
  overflow-y: auto;
  padding: 0.25rem 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
  .lang-list {
    max-height: 200px;
  }
}

.lang-row {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  border-radius: 8px;
  margin: 0 0.25rem;
}

@media (min-width: 640px) {
  .lang-row {
    padding: 0.75rem 1rem;
  }
}

.lang-row:hover {
  background: #18181b;
  transform: translateX(2px);
}

.lang-row.selected {
  background: #27272a;
  border: 1px solid #3f3f46;
}

.lang-tick {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #3f3f46;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.875rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.lang-row:hover .lang-tick {
  border-color: #52525b;
}

.lang-row.selected .lang-tick {
  border-color: #ffffff;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.lang-tick svg {
  display: none;
  width: 12px;
  height: 12px;
}

.lang-row.selected .lang-tick svg {
  display: block;
}

.lang-label {
  flex: 1;
  color: #d4d4d8;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

@media (min-width: 640px) {
  .lang-label {
    font-size: 0.9rem;
  }
}

.lang-row:hover .lang-label {
  color: #ffffff;
}

.lang-row.selected .lang-label {
  color: #ffffff;
  font-weight: 600;
}

.lang-row.select-all {
  font-weight: 700;
  color: #a1a1aa;
  border-bottom: 1px solid #27272a;
  margin-bottom: 0.5rem;
  padding-bottom: 0.875rem;
}

.lang-row.select-all:hover {
  color: #d4d4d8;
}

.lang-row.select-all.selected {
  color: #ffffff;
  background: #27272a;
}

#targetLangSearch.form-input {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  background: #0f0f0f;
  border-radius: 12px;
  border: 1px solid #27272a;
  color: #e4e4e7;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  #targetLangSearch.form-input {
    font-size: 0.9rem;
    padding: 0.875rem;
  }
}

#targetLangSearch.form-input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  outline: none;
}

#targetLangSearch.form-input::placeholder {
  color: #71717a;
}

/* Custom scrollbar for language list */
.lang-list::-webkit-scrollbar {
  width: 6px;
}

.lang-list::-webkit-scrollbar-track {
  background: transparent;
}

.lang-list::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 3px;
}

.lang-list::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

/* Firefox scrollbar */
.lang-list {
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}