/**
 * Portal do Cliente - LM Sistemas
 * Estilos customizados
 */

:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-radius: 10px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Layout Geral */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f6fa;
  color: #2c3e50;
}

.container {
  max-width: 1200px;
}

/* Navbar */
.navbar {
  box-shadow: var(--box-shadow);
  border-bottom: 3px solid #0056b3;
}

.navbar-brand img {
  filter: brightness(0) invert(1);
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: var(--transition);
  border-radius: 5px;
  margin: 0 2px;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color), #0056b3);
  color: white;
  border-bottom: none;
  font-weight: 600;
}

.card-header h5 {
  margin: 0;
}

/* Welcome Card */
.welcome-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
}

.welcome-card h2 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.5rem;
  color: white;
}

.stat-content h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
}

.stat-content p {
  margin: 0;
  color: var(--secondary-color);
  font-weight: 500;
}

/* Buttons */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: var(--transition);
  border: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #0056b3);
  box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

/* Tables */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table thead th {
  background-color: var(--light-color);
  border: none;
  font-weight: 600;
  color: var(--dark-color);
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Badges */
.badge {
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  font-weight: 500;
}

/* Status Colors */
.bg-aberto {
  background-color: var(--primary-color) !important;
}
.bg-em_analise {
  background-color: var(--info-color) !important;
}
.bg-montando_orcamento {
  background-color: var(--warning-color) !important;
  color: var(--dark-color) !important;
}
.bg-aguardando_aprovacao {
  background-color: var(--secondary-color) !important;
}
.bg-em_desenvolvimento {
  background-color: var(--success-color) !important;
}
.bg-baixado {
  background-color: var(--dark-color) !important;
}
.bg-encerrado {
  background-color: var(--danger-color) !important;
}
.bg-encerrado_cliente {
  background-color: var(--warning-color) !important;
  color: var(--dark-color) !important;
}

/* Priority Colors */
.priority-baixa {
  color: var(--success-color);
}
.priority-media {
  color: var(--primary-color);
}
.priority-alta {
  color: var(--warning-color);
}
.priority-urgente {
  color: var(--danger-color);
}

/* Forms */
.form-control {
  border-radius: var(--border-radius);
  border: 2px solid #e9ecef;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
  border: none;
  border-radius: var(--border-radius);
  border-left: 4px solid;
}

.alert-success {
  border-left-color: var(--success-color);
  background-color: rgba(40, 167, 69, 0.1);
}

.alert-danger {
  border-left-color: var(--danger-color);
  background-color: rgba(220, 53, 69, 0.1);
}

.alert-warning {
  border-left-color: var(--warning-color);
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.alert-info {
  border-left-color: var(--info-color);
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Contact Info */
.contact-info p {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.contact-info i {
  margin-right: 0.5rem;
  width: 16px;
  color: var(--primary-color);
}

/* File Upload */
.file-upload-area {
  border: 2px dashed #dee2e6;
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--primary-color);
  background-color: rgba(0, 123, 255, 0.05);
}

.file-upload-area.dragover {
  border-color: var(--primary-color);
  background-color: rgba(0, 123, 255, 0.1);
}

/* Modern Timeline Styles */
.ticket-timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Central timeline line */
.ticket-timeline::after {
  content: "";
  position: absolute;
  width: 4px;
  background: linear-gradient(
    to bottom,
    var(--primary-color),
    var(--info-color)
  );
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
  border-radius: 2px;
}

/* Timeline item container */
.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
  margin-bottom: 2rem;
}

/* Timeline circles */
.timeline-item::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  right: -10px;
  background-color: white;
  border: 3px solid var(--primary-color);
  top: 20px;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Left positioning */
.timeline-item.left {
  left: 0;
}

/* Right positioning */
.timeline-item.right {
  left: 50%;
}

/* Left arrow */
.timeline-item.left::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 25px;
  width: 0;
  z-index: 1;
  right: 30px;
  border: medium solid white;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent white;
}

/* Right arrow */
.timeline-item.right::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 25px;
  width: 0;
  z-index: 1;
  left: 30px;
  border: medium solid var(--primary-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--primary-color) transparent transparent;
}

/* Right arrow colors for client/support */
.timeline-item.right.timeline-client::before {
  border: medium solid var(--success-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--success-color) transparent transparent;
}

.timeline-item.right.timeline-support::before {
  border: medium solid var(--info-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--info-color) transparent transparent;
}

/* Fix circle for right containers */
.timeline-item.right::after {
  left: -10px;
}

/* Timeline content styling */
.timeline-content {
  padding: 20px 25px;
  background: white;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
}

/* Different colors for client/support */
.timeline-item.timeline-client .timeline-content {
  border-left-color: var(--success-color);
}

.timeline-item.timeline-client::after {
  border-color: var(--success-color);
}

.timeline-item.timeline-support .timeline-content {
  border-left-color: var(--info-color);
}

.timeline-item.timeline-support::after {
  border-color: var(--info-color);
}

/* Timeline header styling */
.timeline-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.timeline-header strong {
  color: var(--dark-color);
  font-weight: 600;
}

/* Timeline body styling */
.timeline-body {
  color: #666;
  line-height: 1.6;
}

/* Timeline attachments */
.timeline-attachments {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.attachment-item:hover {
  background: #e9ecef;
}

.attachment-item i {
  color: var(--primary-color);
}

.attachment-item a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.attachment-item a:hover {
  text-decoration: underline;
}

.timeline-item.cliente::before {
  background-color: var(--success-color);
  box-shadow: 0 0 0 2px var(--success-color);
}

.timeline-item.suporte::before {
  background-color: var(--info-color);
  box-shadow: 0 0 0 2px var(--info-color);
}

/* Document Icons */
.document-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-right: 1rem;
  font-size: 1.2rem;
  color: white;
}

.document-icon.pdf {
  background-color: #dc3545;
}
.document-icon.doc,
.document-icon.docx {
  background-color: #007bff;
}
.document-icon.xls,
.document-icon.xlsx {
  background-color: #28a745;
}
.document-icon.jpg,
.document-icon.jpeg,
.document-icon.png {
  background-color: #ffc107;
  color: #333;
}
.document-icon.default {
  background-color: #6c757d;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 123, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .welcome-card {
    padding: 1.5rem;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
  }

  .stat-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .navbar-nav {
    text-align: center;
  }

  .card {
    margin-bottom: 1rem;
  }

  .ticket-timeline {
    padding-left: 1rem;
  }

  /* Timeline responsive adjustments */
  .ticket-timeline::after {
    left: 31px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-item::before {
    left: 60px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
  }

  .timeline-item.left::after,
  .timeline-item.right::after {
    left: 15px;
  }

  .timeline-item.right {
    left: 0%;
  }

  .timeline-content {
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .stat-content h3 {
    font-size: 1.5rem;
  }

  .welcome-card h2 {
    font-size: 1.5rem;
  }

  .btn {
    font-size: 0.875rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-color: #2c3e50;
    --dark-color: #ecf0f1;
  }

  body {
    background-color: #1a1a1a;
    color: #ecf0f1;
  }

  .card {
    background-color: #2c3e50;
    color: #ecf0f1;
  }

  .table {
    color: #ecf0f1;
  }

  .table thead th {
    background-color: #34495e;
    color: #ecf0f1;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Breadcrumb Customization - REMOVED */
/* .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.5) !important;
} */

/* Utility Classes */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cursor-pointer {
  cursor: pointer;
}

.border-left-primary {
  border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
  border-left: 4px solid var(--success-color) !important;
}

.border-left-warning {
  border-left: 4px solid var(--warning-color) !important;
}

.border-left-danger {
  border-left: 4px solid var(--danger-color) !important;
}

/* Timeline Intercalada - Componente Reutilizável */
/* Modern Timeline Styles */
.timeline-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Central timeline line */
.timeline-container::after {
  content: '';
  position: absolute;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary-color), var(--info-color));
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
  border-radius: 2px;
}

/* Timeline item container */
.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
  margin-bottom: 2rem;
}

/* Timeline circles */
.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  right: -10px;
  background-color: white;
  border: 3px solid var(--primary-color);
  top: 20px;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Left positioning */
.timeline-item.left {
  left: 0;
}

/* Right positioning */
.timeline-item.right {
  left: 50%;
}

/* Left arrow */
.timeline-item.left::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 25px;
  width: 0;
  z-index: 1;
  right: 30px;
  border: medium solid white;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent white;
}

/* Right arrow */
.timeline-item.right::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 25px;
  width: 0;
  z-index: 1;
  left: 30px;
  border: medium solid var(--primary-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--primary-color) transparent transparent;
}

/* Right arrow colors for client/support */
.timeline-item.right.timeline-client::before {
  border: medium solid var(--success-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--success-color) transparent transparent;
}

.timeline-item.right.timeline-support::before {
  border: medium solid var(--info-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--info-color) transparent transparent;
}

/* Fix circle for right containers */
.timeline-item.right::after {
  left: -10px;
}

/* Timeline content styling */
.timeline-content {
  padding: 20px 25px;
  background: white;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary-color);
}

/* Different colors for client/support */
.timeline-item.timeline-client .timeline-content {
  border-left-color: var(--success-color);
}

.timeline-item.timeline-client::after {
  border-color: var(--success-color);
}

.timeline-item.timeline-support .timeline-content {
  border-left-color: var(--info-color);
}

.timeline-item.timeline-support::after {
  border-color: var(--info-color);
}

/* Timeline header styling */
.timeline-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.timeline-header strong {
  color: var(--dark-color);
  font-weight: 600;
}

/* Timeline body styling */
.timeline-body {
  color: #666;
  line-height: 1.6;
}

/* Timeline attachments */
.timeline-attachments {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.attachment-item:hover {
  background: #e9ecef;
}

.attachment-item i {
  color: var(--primary-color);
}

.attachment-item a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.attachment-item a:hover {
  text-decoration: underline;
}

.timeline-item.cliente::before {
  background-color: var(--success-color);
  box-shadow: 0 0 0 2px var(--success-color);
}

.timeline-item.suporte::before {
  background-color: var(--info-color);
  box-shadow: 0 0 0 2px var(--info-color);
}

.timeline-changes {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.change-item {
  margin-bottom: 5px;
}

.timeline-attachments {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.attachment-item {
  margin-bottom: 8px;
}

.attachment-item a {
  color: var(--info-color);
  text-decoration: none;
}

.attachment-item a:hover {
  text-decoration: underline;
}

/* Cores dos marcadores */
.timeline-marker.bg-primary {
  background-color: var(--primary-color);
}

.timeline-marker.bg-success {
  background-color: var(--success-color);
}

.timeline-marker.bg-warning {
  background-color: var(--warning-color);
}

.timeline-marker.bg-danger {
  background-color: var(--danger-color);
}

.timeline-marker.bg-info {
  background-color: var(--info-color);
}

.timeline-marker.bg-secondary {
  background-color: var(--secondary-color);
}

/* Responsividade */
@media (max-width: 768px) {
  .timeline-container::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    text-align: left;
    padding-left: 50px;
    padding-right: 20px;
  }

  .timeline-item .timeline-marker {
    left: 12px !important;
    right: auto !important;
  }

  .timeline-item .timeline-content::after {
    left: -10px !important;
    right: auto !important;
    border-right-color: rgba(255, 255, 255, 0.1) !important;
    border-left-color: transparent !important;
  }
}
