/* Root variables for organization theming */
:root {
  /* Organization colors */
  --org-sidebar-color: #16AFDC;
  --org-button-color: #E65000;
  --org-button-hover-color: #d94c00;
  --org-button-light: #ff7b3d;
  --org-button-lighter: #ffe4d6;
  --org-button-dark: #cc4700;
  --org-bg-subtle: #fff5f0;

  /* System colors */
  --system-gray-100: #f8f9fa;
  --system-gray-200: #e9ecef;
  --system-gray-300: #dee2e6;
  --system-gray-400: #ced4da;
  --system-gray-500: #adb5bd;
  --system-gray-600: #6c757d;
  --system-gray-700: #495057;
  --system-gray-800: #343a40;
  --system-gray-900: #212529;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
}

/* Base Elements */
html,
body {
  height: 100%;
  font-family: 'Jost', sans-serif;
}

/* Layout */
.content {
  margin-left: 80px;
  padding-top: 0;
  overflow-y: auto;
}

/* Dashboard Header */
.dashboard-header {
  background: white;
  border-radius: 12px;
  margin: 1.25rem;
  padding: 1.5rem !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.dashboard-header:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-logo {
  height: 65px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.header-logo:hover {
  transform: scale(1.02);
}

.user-welcome {
  padding-left: var(--spacing-md);
}

.user-welcome h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--system-gray-800);
  font-weight: 600;
}

.user-welcome .text-muted {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Sidebar */
.sidebar {
  width: 80px;
  background-color: var(--org-sidebar-color);
  color: #fff;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1030;
}

.sidebar .nav-item {
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar-icon {
  position: relative;
  display: inline-block;
  font-size: 1.2rem;
}

.sidebar .nav-link {
  color: #fff;
  text-align: center;
  padding: 1rem;
  transition: background-color 0.2s ease;
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-tabs .nav-link.active {
  color: var(--org-button-color);
  font-weight: bold;
}

.bottom-icon {
  margin-top: auto;
  text-align: center;
}

.bottom-icon .user-image {
  max-width: 20px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-sm);
}

/* Profile Styles */
.profile-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  min-width: 100px;
  transition: transform 0.2s ease;
}

.profile-link:hover {
  transform: translateY(-2px);
}

.header-profile-icon, .header-issues-icon {
  font-size: 32px;
  margin-bottom: var(--spacing-sm);
  color: var(--org-button-color);
  transition: color 0.2s ease;
}

.profile-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--system-gray-700);
  transition: color 0.2s ease;
}

.profile-link:hover .header-profile-icon,
.profile-link:hover .profile-text {
  color: var(--org-button-hover-color);
}

/* Logo Styles */
.cogniti-home-logo {
  width: 28px;
}

.cogniti-nav-link-home-custom-logo {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
}

.cogniti-nav-link-home-custom-logo .cogniti-home-custom-logo {
  width: 60px;
  padding-top: 20px;
  margin: 0 auto;
}

.cogniti-nav-link-home-custom-logo .cogniti-home-custom-logo-text {
  width: 50px;
  padding-top: 5px;
  margin: 0 auto;
  display: block;
}

/* Buttons and Interactive Elements */
.btn-primary {
  background-color: var(--org-button-color);
  border-color: var(--org-button-color);
  color: white;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--org-button-hover-color);
  border-color: var(--org-button-hover-color);
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--org-button-color);
  border-color: var(--org-button-color);
  transition: all 0.2s ease;
}

.btn-outline-primary:hover {
  background-color: var(--org-button-color);
  border-color: var(--org-button-color);
  color: white;
  transform: translateY(-1px);
}

/* Create Agent Button Container */
.create-agent-button-container {
  display: flex;
  align-items: center;
}

.create-agent-button-container .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.create-agent-button-container .bi-exclamation-octagon-fill {
  font-size: 1rem;
  margin-right: var(--spacing-sm);
}

/* Disabled button styles */
.btn.disabled, 
.btn:disabled {
  background-color: var(--system-gray-400);
  border-color: var(--system-gray-400);
  opacity: 0.65;
  cursor: not-allowed;
  color: white;
}

/* Agent limit indicator */
.agent-limit-indicator {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Links */
a {
  color: var(--org-button-color);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--org-button-hover-color);
  text-decoration: none;
}

.nav-link {
  color: var(--org-button-color);
}

/* Form Elements */
.form-control:focus {
  border-color: var(--org-button-color);
  box-shadow: 0 0 0 0.25rem rgba(230, 80, 0, 0.25);
}

/* Progress and Loading */
.progress-bar {
  background-color: var(--org-button-color);
}

.spinner-grow-lg {
  width: 3rem;
  height: 3rem;
}

/* Badges and Notifications */
.badge-primary {
  background-color: var(--org-button-color);
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--org-button-color);
  color: white;
  border-radius: 50%;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  animation: notification-pulse 2s infinite;
}

.notification-badge.hidden {
  display: none;
}

/* Simulation Styling */
.simulation-status {
  margin-top: var(--spacing-md);
}

.simulation-badge {
  background-color: rgba(255, 193, 7, 0.15);
  color: #664d03;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.9375rem;
  animation: simulation-pulse 2s infinite;
}

.simulation-badge i {
  color: #997404;
}

#endSimulationBtn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-color: rgba(255, 193, 7, 0.5);
  color: #664d03;
  transition: all 0.2s ease;
}

#endSimulationBtn:hover {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #000;
  transform: translateY(-1px);
}

#endSimulationBtn i {
  margin-right: var(--spacing-xs);
}

/* Animations */
@keyframes notification-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
  }
}

@keyframes simulation-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Utilities */
.cursor-pointer {
  cursor: pointer;
}

.dropdown-menu.show {
  z-index: 2000;
}

.select2-container {
  z-index: 1000;
}

.select2-container--open {
  z-index: 15000;
}

/* Visibility Toggle */
.cogniti-toggle-visibility .bi-eye-slash,
.cogniti-toggle-visibility .bi-eye {
  display: none;
}

.cogniti-toggle-visibility[aria-expanded="false"] .bi-eye-slash {
  display: inline;
}

.cogniti-toggle-visibility[aria-expanded="true"] .bi-eye {
  display: inline;
}

/* Media Queries */
@media (max-width: 1200px) {
  .dashboard-header {
    margin: 1rem;
    padding: 1rem !important;
  }

  .header-logo {
    height: 50px;
  }

  .user-welcome h1 {
    font-size: 1.5rem;
  }

  .header-actions {
    gap: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    margin: 0.5rem;
    padding: 0.75rem !important;
  }

  .header-logo {
    height: 40px;
  }

  .user-welcome h1 {
    font-size: 1.25rem;
  }

  .create-agent-button-container .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }

  .header-profile-icon {
    font-size: 24px;
  }

  .profile-text {
    font-size: 0.75rem;
  }
}

.agent-edit-panel {
  position: fixed;
  right: -100%;
  top: 0;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  z-index: 1050;
  padding: 20px;
}

.agent-edit-panel.show {
  right: 0;
}

.agent-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.agent-edit-content {
  height: calc(100% - 60px);
  overflow-y: auto;
}

.agent-edit-close {
  position: absolute;
  right: 20px;
  top: 20px;
}

.text-student {
  color: var(--custom-student-color);
}

.text-staff {
  color: var(--custom-staff-color);
}

.text-purple {
  color: var(--cechat-purple-color);
}