/* Component-specific styles for Lectorium */

/* Accessibility utilities */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sr-only-focusable:active, .sr-only-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus, .skip-link:active {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--bg-accent, #111827);
  color: #fff;
  z-index: 9999;
  border-radius: 6px;
}

/* Header components */
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  height: 20px;
  min-width: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  padding: 0.5rem 0.9rem;
  border-radius: calc(var(--radius-sm,8px) + 2px);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.18s ease;
}

.user-menu-button:hover {
  background: var(--bg-tertiary);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 18rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md,12px);
  box-shadow: 0 18px 50px rgba(15,23,42,0.08);
  padding: 0.5rem;
  z-index: 1000;
}

.dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
}

.dropdown-item.text-red-600 {
  color: #dc2626;
}

.dropdown-item.text-red-600:hover {
  background: #fee2e2;
}

[data-theme="dark"] .dropdown-item.text-red-600:hover {
  background: #7f1d1d;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

/* Hero section components */
.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

/* Navigation components */
.navigation-container {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.navigation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Dashboard components */
.welcome-card {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.welcome-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.welcome-subtitle {
  font-size: 1.125rem;
  opacity: 0.8;
  line-height: 1.625;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md,12px);
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(15,23,42,0.04);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.stat-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 60px rgba(15,23,42,0.08);
}

.stat-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
}

.stat-icon {
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.stat-icon.bg-blue { background: rgba(37, 99, 235, 0.1); }
.stat-icon.bg-green { background: rgba(34, 197, 94, 0.1); }
.stat-icon.bg-purple { background: rgba(147, 51, 234, 0.1); }
.stat-icon.bg-orange { background: rgba(234, 88, 12, 0.1); }

[data-theme="dark"] .stat-icon.bg-blue { background: rgba(37, 99, 235, 0.2); }
[data-theme="dark"] .stat-icon.bg-green { background: rgba(34, 197, 94, 0.2); }
[data-theme="dark"] .stat-icon.bg-purple { background: rgba(147, 51, 234, 0.2); }
[data-theme="dark"] .stat-icon.bg-orange { background: rgba(234, 88, 12, 0.2); }

.stat-description {
  font-size: 0.875rem;
  opacity: 0.7;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.quick-action-btn {
  width: 100%;
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-action-btn:hover {
  background: var(--bg-tertiary);
}

/* Search components */
.search-container {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input-container {
  flex: 1;
  position: relative;
  min-width: 300px;
}

.search-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

.search-field {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-weight: 500;
}

.search-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.category-select {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-weight: 500;
  min-width: 200px;
}

.category-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-button {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-button:hover {
  transform: scale(1.05);
}

.search-button:active {
  transform: scale(0.95);
}

.active-filters {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Books grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.loading-container {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

.no-results {
  text-align: center;
  padding: 4rem 0;
}

/* Loans components */
.loans-container {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.section-header {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

/* Resource components */
.resource-header {
  height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-content {
  padding: 1.5rem;
}

.resource-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.resource-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.resource-description {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-bottom: 1rem;
}

.resource-actions {
  display: flex;
  gap: 0.5rem;
}

.bg-red-gradient {
  background: linear-gradient(135deg, #ef4444 0%, #ea580c 100%);
}

.bg-blue-gradient {
  background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
}

.bg-green-gradient {
  background: linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
}

.bg-purple-gradient {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.bg-yellow-gradient {
  background: linear-gradient(135deg, #eab308 0%, #ea580c 100%);
}

/* Analytics components */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.chart-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.top-books-container {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

/* Services components */
.services-placeholder {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
}

.placeholder-content {
  text-align: center;
  padding: 3rem 0;
}

.placeholder-icon {
  font-size: 3.75rem;
  opacity: 0.2;
  margin-bottom: 1rem;
}

.placeholder-title {
  font-size: 1.25rem;
  font-weight: 600;
  opacity: 0.7;
}

.placeholder-subtitle {
  font-size: 0.875rem;
  opacity: 0.5;
}

/* Footer components */
.footer {
  background: #111827;
  color: white;
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-subtitle {
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-text {
  color: #d1d5db;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 0.5rem;
}

.footer-link {
  color: #d1d5db;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #374151;
  margin-top: 2rem;
  padding-top: 2rem;
  text-align: center;
  color: #9ca3af;
}

/* Modal components */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.auth-modal {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  width: 100%;
  max-width: 28rem;
  margin: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.auth-subtitle {
  opacity: 0.8;
  margin-top: 0.5rem;
  line-height: 1.625;
}

.auth-notice {
  margin-top: 0.75rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

.form-fields {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-weight: 500;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.password-toggle:hover {
  opacity: 1;
}

.form-hint {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
  font-weight: 500;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-toggle {
  width: 100%;
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  padding: 0.75rem;
  transition: color 0.3s ease;
}

.auth-toggle:hover {
  color: var(--primary-dark);
}

.auth-cancel {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  padding: 0.75rem;
  transition: color 0.3s ease;
}

.auth-cancel:hover {
  color: var(--text-primary);
}

.book-modal {
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  width: 100%;
  max-width: 42rem;
  margin: 1rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Chat components */
.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
}

.chat-toggle-btn {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  padding: 1rem;
  border: none;
  border-radius: 50%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-toggle-btn:hover {
  transform: scale(1.02);
}

.chat-window {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 20rem;
  height: 24rem;
  background: var(--bg-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  z-index: 40;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Ensure chat layout doesn't grow page height: use column flex and bounded messages */
.chat-window {
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
}

.chat-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title {
  font-weight: 600;
}

.chat-status {
  font-size: 0.875rem;
  opacity: 0.9;
}

.chat-close {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
  flex: 1 1 auto;
  padding: 1rem;
  max-height: 18rem;
  overflow-y: auto;
  background: var(--bg-primary);
}

.chat-message {
  margin-bottom: 0.75rem;
}

.bot-message {
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.5rem 0.5rem 0.5rem 0.125rem;
}

.user-message {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-left: auto;
  max-width: 75%;
  border-radius: 0.5rem 0.5rem 0.125rem 0.5rem;
}

.chat-input-container {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-send {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-send:hover {
  transform: scale(1.05);
}

/* Gradient utilities */
.from-blue-600 { background: linear-gradient(135deg, #2563eb, var(--secondary)); }
.to-purple-700 { background: linear-gradient(135deg, var(--primary), #7c3aed); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .search-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input-container {
    min-width: auto;
  }
  
  .navigation-tabs {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav-item {
    text-align: center;
  }
  
  .auth-modal {
    padding: 1.5rem;
  }
  
  .chat-window {
    width: calc(100vw - 3rem);
    right: 1.5rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.125rem;
  }
}/* Card Components */
.card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

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

/* Button Components */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Form Components */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

/* Modal Components */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 32px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Badge Components */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(5, 150, 105, 0.12);
  color: #065f46;
}

.badge-warning {
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
}

.badge-error {
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

.badge-info {
  background: rgba(2, 132, 199, 0.1);
  color: #075985;
}

[data-theme="dark"] .badge-success {
  background: rgba(5, 150, 105, 0.2);
  color: #6ee7b7;
}

[data-theme="dark"] .badge-warning {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
}

[data-theme="dark"] .badge-error {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

[data-theme="dark"] .badge-info {
  background: rgba(2, 132, 199, 0.2);
  color: #7dd3fc;
}

/* Loading Components */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}

[data-theme="dark"] .loading-overlay {
  background: rgba(0, 0, 0, 0.8);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Alert Components */
.alert {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: start;
  gap: 12px;
}

.alert-success {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.2);
  color: #065f46;
}

.alert-warning {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: #92400e;
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #991b1b;
}

.alert-info {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  color: #075985;
}

[data-theme="dark"] .alert-success {
  background: rgba(5, 150, 105, 0.2);
  border-color: rgba(5, 150, 105, 0.3);
  color: #6ee7b7;
}

[data-theme="dark"] .alert-warning {
  background: rgba(217, 119, 6, 0.2);
  border-color: rgba(217, 119, 6, 0.3);
  color: #fbbf24;
}

[data-theme="dark"] .alert-error {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

[data-theme="dark"] .alert-info {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(2, 132, 199, 0.3);
  color: #7dd3fc;
}

/* Dropdown Components */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 200px;
  z-index: 1000;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

/* Tooltip Components */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 8px;
}

.tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--dark);
  margin-bottom: 4px;
}

/* Progress Components */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Avatar Components */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

/* Tab Components */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Utility Components */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
}

.divider-vertical {
  width: 1px;
  background: var(--border-color);
  margin: 0 24px;
}

.content-section {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.content-section.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  left: -9999px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  
  .modal-content {
    padding: 24px;
    margin: 16px;
  }
  
  .btn-primary,
  .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .dropdown-menu {
    min-width: 160px;
  }
  
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab {
    padding: 10px 16px;
    white-space: nowrap;
  }
}
