/* ========================================
   Ticket Consulta Pública - Vista Moderna
   ======================================== */

:root {
  --primary-color: #4ab7d8;
  --primary-dark: #2a297e;
  --primary-blue-index: #6994bd;
  --primary-dark-index: #2c3f51;
  --secondary-color: #7cafdf;
  --success-color: #239954;
  --success-green: #2ecc71;
  --success-green-index: #2ecc71;
  --danger-color: #e74c3c;
  --danger-red: #e74c3c;
  --danger-red-index: #e74c3c;
  --warning-color: #f39c12;
  --warning-orange: #f39c12;
  --warning-orange-index: #f39c12;
  --info-color: #3498db;
  --info-blue: #3498db;
  --info-blue-index: #3498db;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Container Principal
   ======================================== */
.ticket-consulta-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.ticket-consulta-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ========================================
   Header
   ======================================== */
.ticket-consulta-header {
  text-align: center;
  margin-bottom: 1rem;
}

.ticket-consulta-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.ticket-consulta-header h1 i {
  color: var(--primary-color);
}

.ticket-consulta-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ========================================
   Info Alert
   ======================================== */
.info-alert {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
  border-left: 4px solid var(--info-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.info-alert-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--info-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.info-alert-content h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.info-alert-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ========================================
   Requisitos para comentarios
   ======================================== */
.requisitos-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff9e6 100%);
  border-left: 4px solid var(--warning-orange);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.requisitos-section .requisitos-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--warning-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
}

.requisitos-section .requisitos-content h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.requisitos-section .requisitos-content ol {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.requisitos-section .requisitos-content li {
  margin-bottom: 0.5rem;
}

.requisitos-section .requisitos-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ========================================
   Search Ticket Card
   ======================================== */
.search-ticket-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition);
}

.search-ticket-card:hover {
  box-shadow: var(--shadow-lg);
}

.search-ticket-header {
  background: linear-gradient(135deg, #2c3e50 0%, #6994bd 100%);
  padding: 1.5rem;
  color: white;
}

.search-ticket-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.search-ticket-content {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group label i {
  color: var(--primary-color);
}

.required {
  color: var(--danger-color);
  margin-left: 0.25rem;
}

.input-group-search {
  display: flex;
  gap: 0.75rem;
}

.input-group-search .form-control {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
}

.input-group-search .form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 183, 216, 0.1);
}

.btn-search {
  padding: 0.75rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-search:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-search:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.error-message {
  margin-top: 0.5rem;
  color: var(--danger-color);
  font-size: 0.875rem;
  padding: 0.5rem;
  background: #fee2e2;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger-color);
}

/* ========================================
   Ticket Result Card
   ======================================== */
.ticket-result-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Código de Ticket */
.ticket-code-section {
  background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 100%);
  padding: 2rem;
  text-align: center;
  border-bottom: 3px solid var(--primary-color);
}

.ticket-code-header {
  margin-bottom: 1rem;
}

.ticket-code-header i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.ticket-code-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
}

.ticket-code-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 2px;
  font-family: "Courier New", monospace;
  background: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

/* Estado del Ticket */
.ticket-status-section {
  padding: 1.5rem 2rem;
  text-align: center;
  background: var(--light-bg);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
}

.status-badge .status-icon {
  font-size: 1.2rem;
}

.status-pendiente {
  background: #fef3c7;
  color: #92400e;
}

.status-enproceso {
  background: #dbeafe;
  color: #1e40af;
}

.status-resuelto {
  background: #d1fae5;
  color: #166534;
}

.status-rechazado {
  background: #fee2e2;
  color: #991b1b;
}

/* Información del Ticket */
.ticket-info-section {
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.ticket-info-section h4 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.ticket-info-section h4 i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--light-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-color);
}

.info-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.info-label i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.info-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Comentario y Respuesta */
.ticket-comment-section,
.ticket-response-section {
  padding: 2rem;
}

.ticket-comment-section {
  border-bottom: 1px solid var(--border-color);
}

.ticket-comment-section h4,
.ticket-response-section h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.ticket-comment-section h4 i,
.ticket-response-section h4 i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.comment-box,
.response-box {
  background: var(--light-bg);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-color);
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.response-box {
  border-left-color: var(--secondary-color);
  background: rgb(124, 175, 223, 0.2);
}

/* ========================================
   Sección de Comentarios (Estilo Reddit)
   ======================================== */
.ticket-comments-section {
  padding: 2rem;
  border-top: 2px solid var(--border-color);
  background: var(--card-bg);
}

.ticket-comments-section h4 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.ticket-comments-section h4 i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.comments-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
  background: var(--light-bg);
  border-radius: var(--radius-md);
}

.comment-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.comment-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--light-bg);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-author i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.comment-author-name {
  font-size: 0.9rem;
}

.comment-date {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-date i {
  font-size: 0.75rem;
}

.comment-body {
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  word-wrap: break-word;
}

.comment-body p {
  margin: 0;
  white-space: pre-wrap;
}

/* Respuesta del Operario */
.comment-reply {
  margin-top: 0.5rem;
  margin-left: 1rem;
  margin-right: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(
    135deg,
    rgba(74, 183, 216, 0.08) 0%,
    rgba(124, 175, 223, 0.12) 100%
  );
  border-left: 3px solid var(--secondary-color);
  border-radius: var(--radius-sm);
  position: relative;
}

.comment-reply::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.75rem;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid var(--secondary-color);
}

.comment-reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment-reply-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.9rem;
}

.comment-reply-author i {
  color: var(--secondary-color);
  font-size: 1rem;
}

.comment-reply-author-name {
  font-size: 0.85rem;
}

.comment-reply-date {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-reply-date i {
  font-size: 0.7rem;
}

.comment-reply-body {
  color: var(--text-primary);
  line-height: 1.6;
  word-wrap: break-word;
}

.comment-reply-body p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

/* Responsive para comentarios */
@media (max-width: 768px) {
  .ticket-comments-section {
    padding: 1.5rem;
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .comment-reply {
    margin-left: 0.5rem;
  }

  .comment-reply-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================
   Formulario Agregar Comentario
   ======================================== */
.ticket-add-comment-section {
  padding: 2rem;
  border-top: 2px solid var(--border-color);
  background: var(--light-bg);
}

.ticket-add-comment-section h4 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.ticket-add-comment-section h4 i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.ticket-add-comment-section .form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--card-bg);
  color: var(--text-primary);
}

.ticket-add-comment-section .form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 183, 216, 0.1);
}

.ticket-add-comment-section textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.ticket-add-comment-section input[type="file"].form-control {
  padding: 0.5rem;
  cursor: pointer;
}

.ticket-add-comment-section .form-text {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.ticket-add-comment-section .form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-submit {
  padding: 0.75rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.btn-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-reset {
  padding: 0.75rem 2rem;
  background: var(--text-muted);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.btn-reset:hover {
  background: var(--text-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 768px) {
  .ticket-add-comment-section {
    padding: 1.5rem;
  }

  .ticket-add-comment-section .form-actions {
    flex-direction: column;
  }

  .btn-submit,
  .btn-reset {
    width: 100%;
    justify-content: center;
  }
}
