/* Admin Panel Styles */

/* Global Admin Styles */
.admin-panel {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f8f9fa;
  min-height: 100vh;
}

/* Sidebar Styles */
.admin-sidebar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.admin-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  margin: 2px 0;
  transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateX(5px);
}

.admin-sidebar .nav-link i {
  width: 20px;
  text-align: center;
}

/* Card Enhancements */
.card {
  border: none;
  border-radius: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-radius: 10px 10px 0 0 !important;
}

/* Dashboard Statistics Cards */
.border-left-primary {
  border-left: 4px solid #4e73df !important;
}

.border-left-warning {
  border-left: 4px solid #f6c23e !important;
}

.border-left-info {
  border-left: 4px solid #36b9cc !important;
}

.border-left-success {
  border-left: 4px solid #1cc88a !important;
}

/* Badge Styles */
.badge-high {
  background-color: #dc3545 !important;
  color: white !important;
}

.badge-medium {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.badge-normal {
  background-color: #28a745 !important;
  color: white !important;
}

.badge-status-new {
  background-color: #007bff !important;
  color: white !important;
}

.badge-status-in-progress {
  background-color: #fd7e14 !important;
  color: white !important;
}

.badge-status-responded {
  background-color: #28a745 !important;
  color: white !important;
}

.badge-status-closed {
  background-color: #6c757d !important;
  color: white !important;
}

/* Table Enhancements */
.table {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f5f5f5;
}

.table-warning {
  background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Button Enhancements */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Form Enhancements */
.form-control,
.form-select {
  border-radius: 6px;
  border: 1px solid #e1e5e9;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Timeline Styles */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #667eea, #764ba2);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-marker {
  position: absolute;
  left: -16px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-marker.bg-primary {
  background-color: #4e73df !important;
}

.timeline-marker.bg-info {
  background-color: #36b9cc !important;
}

.timeline-marker.bg-warning {
  background-color: #f6c23e !important;
}

.timeline-marker.bg-success {
  background-color: #1cc88a !important;
}

.timeline-content {
  margin-left: 15px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #495057;
}

.timeline-description {
  font-size: 12px;
  margin-bottom: 0;
  color: #6c757d;
}

/* Loading Spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1060;
}

.toast {
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-header {
  border-bottom: none;
}

.toast.bg-success {
  background-color: #d4edda !important;
  color: #155724 !important;
}

.toast.bg-danger {
  background-color: #f8d7da !important;
  color: #721c24 !important;
}

.toast.bg-warning {
  background-color: #fff3cd !important;
  color: #856404 !important;
}

.toast.bg-info {
  background-color: #d1ecf1 !important;
  color: #0c5460 !important;
}

/* Pagination */
.pagination {
  margin-top: 20px;
}

.page-link {
  color: #667eea;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin: 0 2px;
}

.page-link:hover {
  color: #5a6fd8;
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.page-item.active .page-link {
  background-color: #667eea;
  border-color: #667eea;
}

/* Search and Filter */
.filter-section {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    transition: left 0.3s ease;
    z-index: 1040;
  }
  
  .admin-sidebar.show {
    left: 0;
  }
  
  .admin-content {
    margin-left: 0;
  }
  
  .card {
    margin-bottom: 15px;
  }
  
  .table-responsive {
    border-radius: 8px;
  }
}

/* Login Page Specific */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 400px;
  width: 100%;
}

.login-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 30px 20px;
}

.login-body {
  padding: 30px;
}

.password-toggle {
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: #495057;
}

/* Status Indicators */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-new {
  background-color: #007bff;
}

.status-in-progress {
  background-color: #fd7e14;
}

.status-responded {
  background-color: #28a745;
}

.status-closed {
  background-color: #6c757d;
}

/* Priority Indicators */
.priority-indicator {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 8px;
}

.priority-high {
  background-color: #dc3545;
}

.priority-medium {
  background-color: #ffc107;
}

.priority-normal {
  background-color: #28a745;
}

/* Contact Detail Enhancements */
.contact-detail-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px 10px 0 0;
}

.response-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.response-content {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid #667eea;
  margin-top: 10px;
}

/* Email Preview */
.email-preview {
  font-family: Arial, sans-serif;
  max-width: 600px;
  margin: 0 auto;
}

.email-preview .border {
  border: 1px solid #dee2e6 !important;
  border-radius: 6px;
}

/* Utility Classes */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.shadow {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .admin-panel {
    background-color: #1a1a1a;
    color: #ffffff;
  }
  
  .card {
    background-color: #2d2d2d;
    color: #ffffff;
  }
  
  .table {
    background-color: #2d2d2d;
    color: #ffffff;
  }
  
  .table thead th {
    background-color: #3d3d3d;
    color: #ffffff;
  }
  
  .form-control,
  .form-select {
    background-color: #3d3d3d;
    border-color: #555555;
    color: #ffffff;
  }
  
  .form-control:focus,
  .form-select:focus {
    background-color: #3d3d3d;
    border-color: #667eea;
    color: #ffffff;
  }
}