/**
 * Components - Card, Button, Badge, etc.
 *
 * @package Burot_Sigoignet
 */

/* Card */
.bs-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: box-shadow var(--transition-base), background-color var(--transition-base);
}

.bs-card:hover {
  box-shadow: var(--shadow-md);
}

.bs-card--link {
  display: block;
  cursor: pointer;
}

.bs-card__icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
}

.bs-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.bs-card__description,
.bs-card__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Button */
.bs-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bs-btn--primary {
  background: var(--color-primary);
  color: white;
}

.bs-btn--primary:hover {
  opacity: 0.9;
}

.bs-btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.bs-btn--secondary:hover {
  background: var(--color-bg);
}

.bs-btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: var(--text-xl);
}

/* Badge */
.bs-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.bs-badge--todo {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.bs-badge--doing {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.bs-badge--done {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

/* Widget */
.bs-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: background-color var(--transition-base);
}

.bs-widget__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
}

.bs-widget__content {
  color: var(--color-text);
}

/* Quick Links */
.bs-quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--spacing-md);
}

.bs-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: all var(--transition-fast);
  text-align: center;
}

.bs-quick-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.bs-quick-link__icon {
  font-size: 2rem;
}

.bs-quick-link__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

/* User Menu */
.bs-user-menu {
  position: relative;
}

.bs-user-menu__toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.bs-user-menu__toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bs-user-menu__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--spacing-sm);
  min-width: 150px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.bs-user-menu:hover .bs-user-menu__dropdown {
  display: flex;
}

.bs-user-menu__dropdown a {
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: background var(--transition-fast);
}

.bs-user-menu__dropdown a:hover {
  background: var(--color-bg);
}

/* Task Components */
.bs-task-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.bs-task-list__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.bs-task-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bs-task-status--todo { background: #fbbf24; }
.bs-task-status--doing { background: #3b82f6; }
.bs-task-status--done { background: #10b981; }

.bs-tasks-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.bs-task-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.bs-task-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.bs-task-card__title a {
  color: var(--color-text);
  font-weight: 500;
}

.bs-task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Language Switcher */
.bs-lang-switcher {
  position: relative;
}

.bs-lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bs-lang-switcher__btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.bs-lang-switcher__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--spacing-xs);
  min-width: 120px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.bs-lang-switcher:hover .bs-lang-switcher__dropdown {
  display: flex;
}

.bs-lang-switcher__dropdown a {
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: background var(--transition-fast);
}

.bs-lang-switcher__dropdown a:hover {
  background: var(--color-bg);
}

.bs-lang-switcher__dropdown a.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* Toast Notifications */
#bs-toast-container {
  position: fixed;
  top: 72px;
  right: var(--spacing-md);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.bs-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease forwards;
  position: relative;
  overflow: hidden;
}

.bs-toast--out {
  animation: toastOut 0.3s ease forwards;
}

.bs-toast--success { border-left: 3px solid #10b981; }
.bs-toast--error   { border-left: 3px solid #ef4444; }
.bs-toast--info    { border-left: 3px solid #3b82f6; }
.bs-toast--warning { border-left: 3px solid #f59e0b; }

.bs-toast__icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.bs-toast__msg {
  flex: 1;
  line-height: 1.4;
}

.bs-toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.bs-toast__close:hover {
  color: #f1f5f9;
}

.bs-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.bs-toast__bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  animation: toastProgress linear forwards;
  width: 100%;
}

.bs-toast--success .bs-toast__bar { background: #10b981; }
.bs-toast--error   .bs-toast__bar { background: #ef4444; }
.bs-toast--info    .bs-toast__bar { background: #3b82f6; }
.bs-toast--warning .bs-toast__bar { background: #f59e0b; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

@media (max-width: 480px) {
  #bs-toast-container {
    right: var(--spacing-sm);
    left: var(--spacing-sm);
    max-width: none;
  }
}

/* Confirm Modal — z-index supérieur aux autres modales (1000) */
#bs-confirm-modal {
  z-index: 1100;
}

#bs-confirm-modal .bs-modal-content {
  max-width: 420px;
}

#bs-confirm-message {
  padding: 0 var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Skeleton Loading */
.bs-skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-bg) 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: bsShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
  height: 48px;
}

.bs-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

@keyframes bsShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Button Loading State */
.bs-btn--loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.bs-btn--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: bsSpin 0.6s linear infinite;
}

@keyframes bsSpin {
  to { transform: rotate(360deg); }
}

/* Keyboard Shortcuts Help Overlay */
/* Global Search Modal */
.bs-search-modal-content {
  max-width: 560px;
  margin: 80px auto 0;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}

.bs-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
}

.bs-search-icon {
  font-size: 18px;
  opacity: 0.5;
}

.bs-search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-size: 16px;
}

.bs-search-kbd {
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.bs-search-results {
  max-height: 360px;
  overflow-y: auto;
}

.bs-search-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.bs-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--color-text);
  transition: background 150ms;
}

.bs-search-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.bs-search-result-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.bs-search-result-title {
  flex: 1;
  font-size: 14px;
}

.bs-search-result-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
}

.bs-search-result-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.bs-shortcuts-help {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.bs-shortcuts-help.is-open {
  display: flex;
}

.bs-shortcuts-help__panel {
  background: var(--color-surface, #1e293b);
  border: 1px solid var(--color-border, rgba(255,255,255,0.1));
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 90vw;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.bs-shortcuts-help__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.bs-shortcuts-help__header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.bs-shortcuts-help__section {
  margin-bottom: 16px;
}

.bs-shortcuts-help__section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #94a3b8);
  margin: 0 0 8px 0;
}

.bs-shortcuts-help__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}

.bs-shortcuts-help__row span {
  margin-left: auto;
  color: var(--color-text-muted, #94a3b8);
}

.bs-shortcuts-help__row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text, #f1f5f9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

/* Notification Bell */
.bs-notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  color: var(--color-text-muted, #94a3b8);
  transition: color 0.2s;
}

.bs-notif-bell:hover {
  color: var(--color-text, #f1f5f9);
}

.bs-notif-badge {
  position: absolute;
  top: 0;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: white;
  background: #ef4444;
  border-radius: 8px;
}

/* Bottom Sheet (Mobile Nav "More") */
.bs-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  pointer-events: none;
}

.bs-bottom-sheet__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.bs-bottom-sheet.is-open .bs-bottom-sheet__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.bs-bottom-sheet__content {
  position: relative;
  z-index: 200;
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  padding: var(--spacing-lg);
  padding-bottom: calc(var(--bottom-nav-height, 60px) + var(--spacing-lg));
  max-height: 60vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  pointer-events: auto;
  border-top: 1px solid var(--color-border);
}

.bs-bottom-sheet.is-open .bs-bottom-sheet__content {
  transform: translateY(0);
}

.bs-bottom-sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 0 auto var(--spacing-md);
}

.bs-bottom-sheet__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-md);
}

.bs-bottom-sheet__list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.bs-bottom-sheet__item {
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.bs-bottom-sheet__item:active {
  background: var(--color-bg);
}

.bs-bottom-sheet__link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  flex: 1;
  color: var(--color-text);
  min-width: 0;
}

.bs-bottom-sheet__item-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.bs-bottom-sheet__item-label {
  font-size: var(--text-base);
  font-weight: 500;
}

.bs-bottom-sheet__pin {
  margin-left: auto;
  padding: var(--spacing-md);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.bs-bottom-sheet__pin:hover {
  color: var(--color-text);
}

.bs-bottom-sheet__pin.is-pinned {
  color: var(--color-primary);
}

/* More button in bottom nav */
.bs-bottom-nav__more {
  background: none;
  border: none;
  cursor: pointer;
}
