/* Importing global CSS styles */
@import "../common.css";

.encoder-tool-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.encoding-mode-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 10px;
  margin: -25px -25px 20px -25px;
}

.tab-button {
  flex: 1;
  background: none;
  border: none;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #64748b;
  position: relative;
  overflow: hidden;
}

.tab-button:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.tab-button.active {
  color: var(--primary-color);
  background-color: white;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.input-group,
.result-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #4a5568;
  font-size: 1rem;
}

.input-with-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

textarea {
  width: 100%;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.95rem;
  resize: vertical;
  transition: all 0.2s ease;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(84, 104, 255, 0.15);
}

textarea[readonly] {
  background-color: var(--secondary-color);
  cursor: default;
  border-color: #e2e8f0;
}

.input-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  margin: 10px 0 20px;
}

.action-btn {
  padding: 12px 22px;
  font-weight: 600;
  min-width: 120px;
  font-size: 1rem;
  letter-spacing: 0.2px;
}

.btn {
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 5px rgba(84, 104, 255, 0.3);
}

.btn.primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(84, 104, 255, 0.4);
}

.btn.secondary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: 1px solid rgba(84, 104, 255, 0.2);
}

.btn.secondary:hover {
  background-color: #e6eaff;
  transform: translateY(-2px);
}

.btn.small {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
}

.encoding-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 5px;
  padding: 15px;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.option-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-weight: normal;
  color: #4a5568;
}

.hidden {
  display: none;
}

/* Back link styles */
.back-link a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.back-link a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Info Card Styles */
.info-card {
  margin-top: 30px;
  padding: 30px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
}

.info-card h2 {
  margin-top: 0;
  color: #2d3748;
  font-size: 1.6rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.encoding-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

.encoding-type {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.encoding-type h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.example-box {
  background-color: var(--secondary-color);
  padding: 15px;
  border-radius: 6px;
  margin-top: 15px;
  border: 1px solid #e2e8f0;
}

.example-pair {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-pair div {
  word-break: break-all;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .site-header h1 {
    font-size: 2.2rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .back-link {
    margin-top: 15px;
  }

  .encoding-info {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .action-btn {
    width: 100%;
  }

  .tab-button {
    padding: 14px;
    font-size: 0.95rem;
  }

  .info-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .site-header h1 {
    font-size: 1.8rem;
  }

  .info-card h2 {
    font-size: 1.4rem;
  }

  .encoding-type h3 {
    font-size: 1.1rem;
  }
}
