/* ===================================
   Variables y Reset
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colores principales */
  --primary-color: #667eea;
  --primary-dark: #5568d3;
  --secondary-color: #764ba2;
  --success-color: #10b981;
  --error-color: #ef4444;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --white: #ffffff;
  --border-color: #e5e7eb;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Espaciados */
  --spacing-xs: 0.3rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.7rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.2rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* ===================================
   Estilos Generales
   =================================== */
body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: var(--spacing-md) var(--spacing-sm);
  color: var(--text-dark);
  line-height: 1.5;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* ===================================
   Header
   =================================== */
header {
  text-align: center;
  margin-bottom: var(--spacing-md);
  color: var(--white);
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 0.9rem;
  font-weight: 300;
  opacity: 0.95;
}

/* ===================================
   Card Principal
   =================================== */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Help Box
   =================================== */
.help-box {
  background: linear-gradient(135deg, #e0e7ff 0%, #e9d5ff 100%);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-sm);
}

.help-box strong {
  color: var(--primary-dark);
  font-size: 0.9rem;
  display: block;
  margin-bottom: var(--spacing-xs);
}

.help-box ol {
  margin-left: var(--spacing-md);
  color: var(--text-dark);
  line-height: 1.5;
}

.help-box li {
  margin-bottom: var(--spacing-xs);
  font-size: 0.8rem;
}

.help-box li strong {
  display: inline;
  color: var(--secondary-color);
  font-size: 0.9rem;
}

.help-example {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
}

.help-example strong {
  color: var(--primary-color);
}

.help-note {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.5;
}

.help-note strong {
  display: inline;
  color: #92400e;
  font-size: 0.85rem;
}

/* ===================================
   Form Groups
   =================================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
}

.form-group .icon {
  margin-right: var(--spacing-xs);
  font-size: 1.2rem;
}

.label-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-light);
  font-style: italic;
  margin-left: var(--spacing-xs);
}

/* ===================================
   Input Fields
   =================================== */
.input-field {
  width: 100%;
  padding: var(--spacing-sm);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s ease;
  background-color: var(--bg-light);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-field:hover {
  border-color: var(--primary-dark);
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-sm) center;
  padding-right: 2.5rem;
}

.textarea {
  resize: vertical;
  min-height: 60px;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
}

.textarea[readonly] {
  background-color: var(--bg-light);
  cursor: default;
}

/* ===================================
   Descriptions & Hints
   =================================== */
.description {
  margin-top: var(--spacing-xs);
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
  padding: var(--spacing-sm);
  background-color: #f0f4ff;
  border-left: 3px solid var(--primary-color);
  border-radius: var(--radius-sm);
}

.hint {
  margin-top: var(--spacing-xs);
  font-size: 0.875rem;
  color: var(--text-light);
}

.char-counter {
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: var(--spacing-xs);
}

/* ===================================
   Buttons
   =================================== */
.button-group {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-width: 100px;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: var(--white);
}

.btn-primary:hover {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--secondary-color) 100%
  );
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #9d5caa 100%);
  color: var(--white);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #9d5caa 0%, var(--secondary-color) 100%);
}

.btn-clear {
  background-color: #f3f4f6;
  color: var(--text-dark);
}

.btn-clear:hover {
  background-color: #e5e7eb;
}

.btn-copy {
  width: 100%;
  margin-top: var(--spacing-sm);
  background-color: var(--success-color);
  color: var(--white);
}

.btn-copy:hover:not(:disabled) {
  background-color: #059669;
}

.btn-copy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===================================
   Feedback
   =================================== */
.feedback {
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  font-size: 0.85rem;
  display: none;
  animation: slideDown 0.3s ease-out;
}

.feedback.show {
  display: block;
}

.feedback.success {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success-color);
}

.feedback.error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--error-color);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Footer
   =================================== */
footer {
  text-align: center;
  margin-top: var(--spacing-md);
  color: var(--white);
  opacity: 0.9;
}

footer p {
  margin: var(--spacing-xs) 0;
  font-size: 0.8rem;
}

.small {
  font-size: 0.75rem;
  font-weight: 300;
}

/* ===================================
   Hidden
   =================================== */
.hidden {
  display: none !important;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
  body {
    padding: var(--spacing-md) var(--spacing-sm);
  }

  header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .card {
    padding: var(--spacing-lg);
  }

  .button-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }
}
