/* Custom styles for Discord Support Bot */

:root {
  --discord-blurple: #5865f2;
  --discord-green: #57f287;
  --discord-yellow: #fee75c;
  --discord-fuchsia: #eb459e;
  --discord-red: #ed4245;
  --discord-white: #ffffff;
  --discord-black: #000000;
  --discord-dark-but-not-black: #2c2f33;
  --discord-not-quite-black: #23272a;
}

/* Global Styles */
html, body {
  height: 100%;
}

body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  color: #495057;
}

/* Main content should grow to fill space */
main {
  flex: 1 0 auto;
}

/* Footer should stick to bottom */
footer {
  flex-shrink: 0;
}

/* Navigation */
.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: var(--discord-blurple);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--discord-blurple) 0%, var(--discord-fuchsia) 100%);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Colored left borders for stats cards */
.border-left-primary {
  border-left: 4px solid var(--discord-blurple) !important;
}

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

.border-left-info {
  border-left: 4px solid #17a2b8 !important;
}

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

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

/* Custom text colors */
.text-discord {
  color: var(--discord-blurple) !important;
}

.bg-discord {
  background-color: var(--discord-blurple) !important;
}

/* Timeline styles */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e9ecef;
}

.timeline-item {
  position: relative;
  padding-left: 40px;
}

.timeline-marker {
  position: absolute;
  left: 8px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e9ecef;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--discord-blurple);
  border-color: var(--discord-blurple);
}

.btn-primary:hover {
  background-color: #4752c4;
  border-color: #4752c4;
}

.btn-success {
  background-color: var(--discord-green);
  border-color: var(--discord-green);
}

.btn-success:hover {
  background-color: #4ade80;
  border-color: #4ade80;
}

/* Badges */
.badge {
  border-radius: 6px;
}

.badge-success {
  background-color: var(--discord-green);
}

.badge-warning {
  background-color: var(--discord-yellow);
  color: #000;
}

.badge-danger {
  background-color: var(--discord-red);
}

/* Progress bars */
.progress {
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  transition: width 0.6s ease;
}

/* Tables */
.table {
  border-radius: 8px;
  overflow: hidden;
}

.table th {
  border-top: none;
  background-color: #f8f9fa;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: rgba(88, 101, 242, 0.05);
}

/* Form elements */
.form-control {
  border-radius: 8px;
  border: 1px solid #e3e6f0;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--discord-blurple);
  box-shadow: 0 0 0 0.2rem rgba(88, 101, 242, 0.25);
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--discord-blurple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Flash messages */
.flash-message {
  border-radius: 8px;
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chart containers */
.chart-container {
  position: relative;
  height: 300px;
  margin: 1rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }
  
  .hero-section {
    padding: 2rem 0 !important;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .timeline::before {
    left: 10px;
  }
  
  .timeline-item {
    padding-left: 30px;
  }
  
  .timeline-marker {
    left: 3px;
    width: 14px;
    height: 14px;
  }
}

/* Status indicators */
.status-online {
  color: var(--discord-green);
}

.status-idle {
  color: var(--discord-yellow);
}

.status-dnd {
  color: var(--discord-red);
}

.status-offline {
  color: #747f8d;
}

/* Channel status badges */
.channel-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

.channel-status.open {
  background-color: rgba(87, 242, 135, 0.1);
  color: var(--discord-green);
}

.channel-status.closed {
  background-color: rgba(116, 127, 141, 0.1);
  color: #747f8d;
}

/* Cost tracking styles */
.cost-positive {
  color: var(--discord-green);
}

.cost-negative {
  color: var(--discord-red);
}

.cost-neutral {
  color: #6c757d;
}

/* Avatar styles */
.avatar {
  border-radius: 50%;
  object-fit: cover;
}

.avatar-sm {
  width: 24px;
  height: 24px;
}

.avatar-md {
  width: 40px;
  height: 40px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Better text contrast and visibility */
.text-gray-800 {
  color: #2d3748 !important;
}

.text-muted {
  color: #6c757d !important;
}

/* Ensure all main text elements have proper color */
h1, h2, h3, h4, h5, h6 {
  color: #2d3748 !important;
}

p {
  color: #495057;
}

li {
  color: #495057;
}

/* Fix specific problematic elements */
.list-unstyled li {
  color: #495057 !important;
}

.timeline-content h6 {
  color: #2d3748 !important;
}

.timeline-content p {
  color: #6c757d !important;
}

/* Improve card text visibility */
.card-body {
  color: #495057;
}

.card-title {
  color: #2d3748;
}

/* Better table styling */
.table th {
  color: #495057 !important;
  font-weight: 600;
}

.table td {
  color: #495057 !important;
}

/* Ensure table headers are always visible */
table thead th {
  color: #495057 !important;
  font-weight: 600;
  background-color: #f8f9fa;
}

table tbody td {
  color: #495057 !important;
}

/* Override any Bootstrap table styling */
.table > :not(caption) > * > * {
  color: #495057 !important;
}

.table-responsive .table thead th {
  color: #495057 !important;
}

/* Force table styling everywhere */
.card .table th,
.card .table td,
.card-body .table th,
.card-body .table td {
  color: #495057 !important;
}

/* Dashboard specific table fixes */
.card-header + .card-body .table th,
.table.table-sm th,
.table.table-striped th,
.table.table-hover th {
  color: #495057 !important;
  background-color: #f8f9fa !important;
}

/* Ultra-specific table header fixes for stubborn elements */
.table.table-sm thead tr th,
.table.table-striped thead tr th,
.table thead th:nth-child(1),
.table thead th:nth-child(2),
.table thead th:nth-child(3),
.table thead th:nth-child(4),
.table thead th:nth-child(5) {
  color: #495057 !important;
  background-color: #f8f9fa !important;
}

/* Card body table headers */
.card-body .table-responsive .table thead th {
  color: #495057 !important;
  background-color: #f8f9fa !important;
}

/* Fix badge contrast */
.badge {
  font-weight: 500;
}

.badge.bg-success {
  background-color: #198754 !important;
}

.badge.bg-primary {
  background-color: var(--discord-blurple) !important;
}

/* Improve small text readability */
.small, small {
  color: #6c757d;
}

/* Better link colors */
.nav-link {
  color: #495057 !important;
}

.nav-link:hover {
  color: var(--discord-blurple) !important;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  :root {
    --bs-body-bg: #2c2f33;
    --bs-body-color: #ffffff;
  }
  
  body {
    background-color: #2c2f33;
    color: #ffffff !important;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
  }
  
  p {
    color: #ffffff !important;
  }
  
  li {
    color: #ffffff !important;
  }
  
  .list-unstyled li {
    color: #ffffff !important;
  }
  
  .timeline-content h6 {
    color: #ffffff !important;
  }
  
  .timeline-content p {
    color: #b3b3b3 !important;
  }
  
  .card {
    background-color: #36393f;
    color: #ffffff;
    border-color: #40444b;
  }
  
  .card-body {
    color: #ffffff;
  }
  
  .card-title {
    color: #ffffff;
  }
  
  .table {
    --bs-table-bg: #36393f;
    --bs-table-color: #ffffff;
  }
  
  .table th,
  .table td {
    color: #ffffff !important;
    border-color: #40444b;
  }
  
  table thead th {
    color: #ffffff !important;
    background-color: #40444b;
  }
  
  table tbody td {
    color: #ffffff !important;
  }
  
  .table > :not(caption) > * > * {
    color: #ffffff !important;
  }
  
  .table-responsive .table thead th {
    color: #ffffff !important;
  }
  
  .card .table th,
  .card .table td,
  .card-body .table th,
  .card-body .table td {
    color: #ffffff !important;
  }
  
  .card-header + .card-body .table th,
  .table.table-sm th,
  .table.table-striped th,
  .table.table-hover th {
    color: #ffffff !important;
    background-color: #40444b !important;
  }
  
  .table.table-sm thead tr th,
  .table.table-striped thead tr th,
  .table thead th:nth-child(1),
  .table thead th:nth-child(2),
  .table thead th:nth-child(3),
  .table thead th:nth-child(4),
  .table thead th:nth-child(5) {
    color: #ffffff !important;
    background-color: #40444b !important;
  }
  
  .card-body .table-responsive .table thead th {
    color: #ffffff !important;
    background-color: #40444b !important;
  }
  
  .form-control {
    background-color: #40444b;
    border-color: #40444b;
    color: #ffffff;
  }
  
  .form-control:focus {
    background-color: #40444b;
    color: #ffffff;
    border-color: var(--discord-blurple);
  }
  
  .text-gray-800 {
    color: #ffffff !important;
  }
  
  .text-muted {
    color: #b3b3b3 !important;
  }
  
  .small, small {
    color: #b3b3b3;
  }
}

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

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shadow-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24) !important;
}

.shadow {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23) !important;
}

.shadow-lg {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23) !important;
}