/* Additional NobelUI Components and Custom Styles */

/* Form Check Styles */
.form-check {
  position: relative;
  display: block;
  padding-left: 1.25rem;
}

.form-check-input {
  position: absolute;
  margin-top: 0.3rem;
  margin-left: -1.25rem;
}

.form-check-label {
  margin-bottom: 0;
  cursor: pointer;
}

/* Invalid Feedback */
.invalid-feedback {
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--danger-color);
  display: none;
}

.is-invalid ~ .invalid-feedback {
  display: block;
}

.is-invalid {
  border-color: var(--danger-color);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Close Button */
.close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: .5;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.close:hover {
  opacity: .75;
}

/* Stat Cards */
.stat-card {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(30px, -30px);
}

.stat-card-icon {
  font-size: 2.5rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.stat-card-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-card-label {
  opacity: 0.9;
  font-weight: 500;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Data Table Enhancements */
.data-table-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.table-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-search {
  max-width: 300px;
  width: 100%;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Sort indicators */
.sort-asc::after {
  content: ' ↑';
  color: var(--primary-color);
}

.sort-desc::after {
  content: ' ↓';
  color: var(--primary-color);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius-lg) - 1px) calc(var(--border-radius-lg) - 1px) 0 0;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 calc(var(--border-radius-lg) - 1px) calc(var(--border-radius-lg) - 1px);
}

.modal-footer > * {
  margin: 0.25rem;
}

/* Tooltips */
.tooltip {
  position: absolute;
  z-index: 1070;
  display: block;
  font-family: var(--font-family-sans-serif);
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
  word-spacing: normal;
  white-space: normal;
  line-break: auto;
  font-size: 0.75rem;
  word-wrap: break-word;
  opacity: 0.9;
}

.tooltip-inner {
  max-width: 200px;
  padding: 0.5rem 0.75rem;
  color: #fff;
  text-align: center;
  background-color: #000;
  border-radius: var(--border-radius);
}

/* Status Indicators */
.status-online {
  color: var(--success-color);
}

.status-offline {
  color: var(--text-muted);
}

.status-away {
  color: var(--warning-color);
}

.status-busy {
  color: var(--danger-color);
}

/* Activity Timeline */
.timeline {
  position: relative;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 3.5rem;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.timeline-content {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-weight: 600;
  margin: 0;
}

.timeline-time {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #5a6fd8;
}

/* Profile Avatar */
.avatar {
  position: relative;
  display: inline-block;
}

.avatar img {
  border-radius: 50%;
}

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 25%;
  height: 25%;
  border: 2px solid white;
  border-radius: 50%;
}

/* Avatar component styles */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.2rem;
}

.avatar-lg {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

/* Sidebar section titles */
.nav-section {
  padding: 0.5rem 1.25rem;
  margin-top: 1rem;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-text);
  opacity: 0.7;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.active-event-info {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: var(--border-radius);
}

.active-event-info h6 {
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.active-event-info p {
  color: var(--sidebar-text);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.active-event-info small {
  color: var(--sidebar-text);
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Enhanced form controls */
.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Badge positioning */
.position-absolute {
  position: absolute;
}

/* Small badge */
.badge-sm {
  font-size: 0.65em;
  padding: 0.125em 0.25em;
}

/* Additional Bootstrap-like utility classes */
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.me-4 { margin-right: 1.5rem; }
.me-5 { margin-right: 3rem; }

.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }
.ms-4 { margin-left: 1.5rem; }
.ms-5 { margin-left: 3rem; }

.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }

.small { font-size: 0.875em; }

/* Enhanced button outline styles */
.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  background-color: transparent;
}

.btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

/* Enhanced card styles for smaller cards */
.card .card-body.p-3 {
  padding: 1rem;
}

/* Position utilities */
.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
}

/* Z-index utilities */
.z-index-1000 {
  z-index: 1000;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .table-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .quick-actions {
    bottom: 1rem;
    right: 1rem;
  }
  
  .quick-action-btn {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .timeline::before {
    left: 20px;
  }
  
  .timeline-item {
    padding-left: 2.5rem;
  }
  
  .timeline-marker {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .navbar,
  .quick-actions,
  .btn,
  .dropdown {
    display: none !important;
  }
  
  .main-panel {
    margin-left: 0 !important;
  }
  
  .content-wrapper {
    padding: 0 !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* Custom KPI Card Styles for 5-card layout */
@media (min-width: 1200px) {
  /* Use CSS Grid for perfect 5-card layout on large screens */
  .kpi-grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
  }
  
  .kpi-grid-container .kpi-card-5 {
    max-width: none;
    flex: none;
  }
}

/* Fallback for smaller screens */
@media (max-width: 1199px) {
  .kpi-card-5 {
    flex: 0 0 auto;
  }
}

/* Avatar consistent sizing */
.avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* KPI Cards enhancement */
.kpi-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  border-radius: 0.5rem;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Compact card body for KPIs */
.kpi-card .card-body {
  padding: 1rem 0.75rem;
}

.kpi-card h5 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

.kpi-card .small {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Additional color utilities for KPI cards */
.bg-orange {
  background-color: #fd7e14 !important;
}

.bg-blue {
  background-color: #0d6efd !important;
}

.bg-pink {
  background-color: #d63384 !important;
}

.bg-teal {
  background-color: #20c997 !important;
}
