/* ========================================
   Codetude Text Converter - Estilos
   ======================================== */

:root {
  --txt-primary: #6366f1;
  --txt-success: #10b981;
  --txt-light-bg: #ffffff;
  --txt-light-surface: #f8fafc;
  --txt-light-border: #e2e8f0;
  --txt-light-text: #1e293b;
  --txt-light-text-secondary: #64748b;
  --txt-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark-mode {
  --txt-light-bg: #1e293b;
  --txt-light-surface: #0f172a;
  --txt-light-border: #334155;
  --txt-light-text: #e2e8f0;
  --txt-light-text-secondary: #94a3b8;
  --txt-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Container */
.codetude-text-converter {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Seções */
.text-section {
  background: var(--txt-light-bg);
  border: 1px solid var(--txt-light-border);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--txt-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.text-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Headers */
.section-header {
  margin-bottom: 25px;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--txt-light-text);
  margin: 0 0 10px 0;
}

.section-header h2 .icon {
  width: 28px;
  height: 28px;
  color: var(--txt-primary);
  stroke-width: 2;
}

.section-description {
  color: var(--txt-light-text-secondary);
  margin: 0;
  font-size: 15px;
}

/* Converter Container */
.converter-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.input-section,
.output-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-section label,
.output-section label {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt-light-text);
}

textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--txt-light-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: "Courier New", monospace;
  background: var(--txt-light-surface);
  color: var(--txt-light-text);
  resize: vertical;
  line-height: 1.6;
  transition: border-color 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--txt-primary);
}

textarea::placeholder {
  color: var(--txt-light-text-secondary);
  opacity: 0.6;
}

/* Stats */
.text-stats {
  display: flex;
  gap: 20px;
  padding: 10px 14px;
  background: var(--txt-light-surface);
  border-radius: 6px;
  font-size: 13px;
  color: var(--txt-light-text-secondary);
  flex-wrap: wrap;
}

.text-stats strong {
  color: var(--txt-light-text);
  font-weight: 600;
}

/* Conversion Types */
.conversion-types {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background: var(--txt-light-surface);
  border-radius: 10px;
}

.conversion-types h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt-light-text);
  margin: 0;
}

/* Buttons Grid */
.buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.btn-convert {
  background: var(--txt-light-bg);
  color: var(--txt-light-text);
  border: 2px solid var(--txt-light-border);
}

.btn-convert:hover {
  background: var(--txt-primary);
  color: white;
  border-color: var(--txt-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-convert:active {
  transform: translateY(0);
}

.btn-convert code {
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
}

.btn-primary {
  background: var(--txt-primary);
  color: white;
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-large {
  padding: 14px 24px;
  font-size: 15px;
  width: 100%;
}

.btn-secondary {
  background: var(--txt-light-surface);
  color: var(--txt-light-text);
  border: 1px solid var(--txt-light-border);
}

.btn-secondary:hover {
  background: var(--txt-light-border);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

/* Info Cards */
.info-content {
  display: grid;
  gap: 20px;
}

.info-card {
  padding: 20px;
  background: var(--txt-light-surface);
  border-left: 4px solid var(--txt-primary);
  border-radius: 8px;
}

.info-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--txt-light-text);
  margin: 0 0 12px 0;
}

.info-card p {
  color: var(--txt-light-text-secondary);
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.info-card ul {
  margin: 10px 0;
  padding-left: 25px;
  color: var(--txt-light-text-secondary);
  line-height: 1.8;
}

.info-card ul strong {
  color: var(--txt-light-text);
  font-weight: 600;
}

/* Toast */
.text-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--txt-light-text);
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--txt-shadow);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.text-toast svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* Animações */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.btn-convert.active {
  animation: pulse 0.3s ease;
}

/* Responsivo */
@media (max-width: 968px) {
  .converter-container {
    grid-template-columns: 1fr;
  }

  .buttons-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .codetude-text-converter {
    padding: 15px;
  }

  .text-section {
    padding: 20px;
  }

  .buttons-grid {
    grid-template-columns: 1fr;
  }

  .text-stats {
    flex-direction: column;
    gap: 8px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
