/* Custom Styles for Service Desk DPR RI */
:root {
  --tblr-primary: #2e5bff;
  --tblr-primary-rgb: 46, 91, 255;
  --tblr-success: #28a745;
  --tblr-warning: #ffc107;
  --tblr-danger: #dc3545;
  --tblr-info: #17a2b8;
}

/* Login & Auth Pages */
.page-center {
  display: flex;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 12px;
}

.navbar-brand {
  font-weight: 700;
  color: var(--tblr-primary);
}

/* Priority Badges */
.badge-priority-low {
  background-color: #28a745;
  color: white;
}
.badge-priority-medium {
  background-color: #ffc107;
  color: #000;
}
.badge-priority-high {
  background-color: #fd7e14;
  color: white;
}
.badge-priority-urgent {
  background-color: #dc3545;
  color: white;
}

/* Status Badges */
.badge-status-open {
  background-color: #17a2b8;
  color: white;
}
.badge-status-assigned {
  background-color: #007bff;
  color: white;
}
.badge-status-in_progress {
  background-color: #6f42c1;
  color: white;
}
.badge-status-resolved {
  background-color: #28a745;
  color: white;
}
.badge-status-closed {
  background-color: #6c757d;
  color: white;
}
.badge-status-cancelled {
  background-color: #dc3545;
  color: white;
}

/* Role Badges */
.badge-role-admin {
  background-color: #dc3545;
  color: white;
}
.badge-role-technician {
  background-color: #fd7e14;
  color: white;
}
.badge-role-customer {
  background-color: #28a745;
  color: white;
}

/* Custom Utilities */
.cursor-pointer {
  cursor: pointer;
}
.text-decoration-none:hover {
  text-decoration: underline !important;
}
.border-left-primary {
  border-left: 4px solid var(--tblr-primary) !important;
}
.border-left-success {
  border-left: 4px solid var(--tblr-success) !important;
}
.border-left-warning {
  border-left: 4px solid var(--tblr-warning) !important;
}
.border-left-danger {
  border-left: 4px solid var(--tblr-danger) !important;
}

/* Ticket Card */
.ticket-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  border-left: 4px solid var(--tblr-primary);
}

.ticket-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.ticket-card.urgent {
  border-left-color: var(--tblr-danger);
  background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}

.ticket-card.high {
  border-left-color: var(--tblr-warning);
  background: linear-gradient(135deg, #fff 0%, #fffbf0 100%);
}

/* Sidebar Active State */
.sidebar .nav-link.active {
  background-color: var(--tblr-primary);
  color: white;
  border-radius: 6px;
}

.sidebar .nav-link:hover:not(.active) {
  background-color: rgba(var(--tblr-primary-rgb), 0.1);
  border-radius: 6px;
}

/* Dashboard Stats Cards */
.stats-card {
  transition: transform 0.2s ease-in-out;
  border: none;
  border-radius: 10px;
}

.stats-card:hover {
  transform: translateY(-2px);
}

.stats-card .card-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}

.stats-card.bg-primary .card-status {
  background: rgba(255, 255, 255, 0.3);
}
.stats-card.bg-success .card-status {
  background: rgba(255, 255, 255, 0.3);
}
.stats-card.bg-warning .card-status {
  background: rgba(255, 255, 255, 0.3);
}
.stats-card.bg-danger .card-status {
  background: rgba(255, 255, 255, 0.3);
}

/* Progress Bars */
.progress-sm {
  height: 6px;
}

/* Comment & Chat Styles */
.comment-bubble {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  position: relative;
}

.comment-bubble.customer {
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  margin-left: 20px;
}

.comment-bubble.staff {
  background: #f3e5f5;
  border: 1px solid #e1bee7;
  margin-right: 20px;
}

.comment-bubble.internal {
  background: #fff3e0;
  border: 1px dashed #ffcc80;
  border-left: 4px solid #ff9800;
}

.comment-bubble::before {
  content: "";
  position: absolute;
  top: 12px;
  width: 0;
  height: 0;
  border-style: solid;
}

.comment-bubble.customer::before {
  left: -10px;
  border-width: 8px 10px 8px 0;
  border-color: transparent #bbdefb transparent transparent;
}

.comment-bubble.staff::before {
  right: -10px;
  border-width: 8px 0 8px 10px;
  border-color: transparent transparent transparent #e1bee7;
}

/* Timeline Styles */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e9ecef;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tblr-primary);
  border: 2px solid white;
  box-shadow: 0 0 0 3px var(--tblr-primary);
}

.timeline-item.success::before {
  background: var(--tblr-success);
  box-shadow: 0 0 0 3px var(--tblr-success);
}
.timeline-item.warning::before {
  background: var(--tblr-warning);
  box-shadow: 0 0 0 3px var(--tblr-warning);
}
.timeline-item.danger::before {
  background: var(--tblr-danger);
  box-shadow: 0 0 0 3px var(--tblr-danger);
}

/* Table Enhancements */
.table-hover tbody tr:hover {
  background-color: rgba(var(--tblr-primary-rgb), 0.02);
}

.table-responsive table {
  min-width: 800px;
}

/* Form Enhancements */
.form-control:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 2px rgba(var(--tblr-primary-rgb), 0.25);
}

.form-select:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 2px rgba(var(--tblr-primary-rgb), 0.25);
}

/* Button Enhancements */
.btn-primary {
  background-color: var(--tblr-primary);
  border-color: var(--tblr-primary);
}

.btn-primary:hover {
  background-color: #254be6;
  border-color: #254be6;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--tblr-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--tblr-danger);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Avatar Styles */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-lg {
  width: 60px;
  height: 60px;
}

/* File Upload Preview */
.file-upload-preview {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #f8f9fa;
  transition: border-color 0.3s ease;
}

.file-upload-preview:hover {
  border-color: var(--tblr-primary);
}

.file-upload-preview.has-file {
  border-color: var(--tblr-success);
  background: #f8fff9;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  .card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }
}

/* Dark Mode Support */
[data-bs-theme="dark"] .comment-bubble.customer {
  background: #1e3a5f;
  border-color: #2d4a75;
}

[data-bs-theme="dark"] .comment-bubble.staff {
  background: #3d2a4a;
  border-color: #4d3a5a;
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 1030;
    transition: left 0.3s ease;
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1029;
  }

  .table-responsive {
    font-size: 0.875rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
