/**
 * Common Styles for Voice Genie Dashboard
 * Shared across all dashboard pages
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  min-height: 100vh;
}

.metric-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.chart-container {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 24px;
  min-height: 400px;
  max-width: 100%;
  overflow: hidden;
  contain: layout style;
}

.live-indicator {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
}

.nav-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Sidebar base styles */
.sidebar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(59, 130, 246, 0.2);
  transition: width 0.3s ease;
  width: 16rem; /* Default expanded width */
}

/* Collapsible sidebar styles */
.sidebar-collapsed .sidebar {
  width: 5rem;
}

.sidebar-expanded .sidebar {
  width: 16rem;
}

.sidebar-collapsed .sidebar .nav-text,
.sidebar-collapsed .sidebar .sidebar-header-text {
  display: none;
}

.sidebar-collapsed .sidebar .nav-item {
  justify-content: center;
}

.sidebar-collapsed .sidebar .sidebar-brand {
  justify-content: center;
}

/* Fix for gap between collapsed sidebar and main content */
.sidebar-collapsed .flex-1,
.sidebar-expanded .flex-1,
.sidebar-collapsed .flex-grow-1,
.sidebar-expanded .flex-grow-1 {
  margin-left: 0;
  transition: margin-left 0.3s ease;
  position: relative;
}

/* For session panels or other sidebar-adjacent elements */
.sidebar-collapsed [id$="-panel"] {
  margin-left: 5rem;
}

.sidebar-expanded [id$="-panel"] {
  margin-left: 16rem;
}

[id$="-panel"] {
  transition: margin-left 0.3s ease;
  position: relative;
}

/* Handle Bootstrap-specific layout */
.sidebar-collapsed .container-fluid,
.sidebar-expanded .container-fluid {
  transition: padding-left 0.3s ease;
}

.sidebar-expanded .d-flex.vh-100 > .flex-grow-1 {
  margin-left: 0;
  padding-left: 0;
}

/* Bootstrap specific sidebar styles */
body.sidebar-collapsed .sidebar {
  width: 5rem;
}

body.sidebar-expanded .sidebar {
  width: 16rem;
}

/* Fix for Bootstrap header */
body.sidebar-collapsed .navbar,
body.sidebar-expanded .navbar {
  padding-left: 1rem;
  transition: padding-left 0.3s ease;
}

.comparison-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s ease;
}

.comparison-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}

.alert-critical {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
}

.alert-attention {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
}

/* Status indicators */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-active {
  background-color: #10b981;
  animation: pulse 2s infinite;
}

.status-error {
  background-color: #ef4444;
}

.status-warning {
  background-color: #f59e0b;
}

/* Common button styles */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
  background: #6b7280;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Modal styles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
}

/* Loading spinner */
.spinner {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-left: 2px solid #3b82f6;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

/* Toast notifications */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast.info {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}