:root {
  /* Nord Snow Storm Light - Design System Tokens */

  /* Layout */
  --navbar-height: 60px;
  --sidebar-width: 300px;
  --sidebar-duration: 0.3s;
  --sidebar-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --scrollbar-width: 8px;

  /* Primary Palette */
  --primary-color: #344362;
  --primary-hover: #2a354e;
  --on-primary: #ffffff;
  --primary-container: #f0f4ff;
  --on-primary-container: #2a354e;
  --inverse-primary: #8fa4c4;

  /* Secondary Palette */
  --secondary-color: #4a90e2;
  --on-secondary: #ffffff;
  --secondary-container: #e8f0f8;
  --on-secondary-container: #283552;

  /* Tertiary Palette (Fjord Gold) */
  --tertiary-color: #fec12d;
  --on-tertiary: #1d1d1f;
  --tertiary-container: #fff8e1;
  --on-tertiary-container: #d1ad1c;

  /* Surface Colors */
  --surface: #ffffff;
  --surface-dim: #f8f9fa;
  --surface-bright: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f9f9fb;
  --surface-container: #f5f5f7;
  --surface-container-high: #eef1f5;
  --surface-container-highest: #e9ecef;
  --surface-variant: #eef1f5;

  /* Text Colors */
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #515154;
  --inverse-surface: #2a354e;
  --inverse-on-surface: #ffffff;

  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #f9f9fb;
  --background: #f8f9fa;
  --on-background: #1d1d1f;

  /* Functional Colors */
  --danger-color: #dc3545;
  --danger-light: #fee2e2;
  --on-error: #ffffff;
  --error-container: #fee2e2;
  --on-error-container: #a71d2a;
  --success-color: #28a745;
  --success-hover: #218838;
  --success-container: #f0fff0;
  --on-success-container: #1e7e34;
  --on-success: #ffffff;
  --accent-red: #a33a31;

  /* Notification Colors */
  --warning-color: #ff9800;
  --info-color: #607d8b;
  --purple-color: #9c27b0;

  /* Border Colors */
  --border-color: #e5e5e7;
  --border-hover: #c0c0c0;
  --outline: #c0c0c0;
  --outline-variant: #e5e5e7;
  --border-light: #ccc;
  --border-medium: #999;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-sidebar: 2px 0 10px rgba(0, 0, 0, 0.1);
  --shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.15);
  --shadow-button: 0 2px 8px rgba(52, 67, 98, 0.3);
  --shadow-button-active: 0 4px 12px rgba(52, 67, 98, 0.4);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-xxl: 12px;
  --radius-pill: 20px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.2s ease;
  --transition-slow: all 0.3s ease;
  --transition-spring: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Legacy variables - updated with brand colors */
  --set-active-bg-color: #344362;
  --set-active-text-color: white;
  --set-active-stats-color: #8fa4c4;
  --navbar-color: #fec12d;
  --accent-color: #a33a31;

  /* Gradients */
  --gradient-grading: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-pink: #ff6b6b;
}

/* Désactiver sélection de texte sur toute l'application */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Permettre sélection sur les champs de formulaire */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* latin-ext */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://res.dexocard.com/fonts/lato/400.woff2) format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://res.dexocard.com/fonts/lato/400-unicode.woff2)
    format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://res.dexocard.com/fonts/lato/700.woff2) format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://res.dexocard.com/fonts/lato/700-unicode.woff2)
    format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  padding: 0;
  margin: 0;
  font-family:
    "Lato",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-weight: 400;
  font-display: swap;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f8f9fa;

  height: 100vh;
  height: 100dvh; /* Dynamic viewport height - plus moderne */
  overflow: hidden;
}

/* Premium scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* App Container Base Styles */
#_app_container {
  overflow: hidden;
}

/* Mobile App layout - split screen between app container and navbar */
body.mobile-app #_app_container {
  height: calc(100vh - var(--navbar-height));
  height: calc(100dvh - var(--navbar-height));
}

body.mobile-app #navbar_principal {
  display: flex !important;
}

/* Web mode - hide navbar */
body:not(.mobile-app) #navbar_principal {
  display: none !important;
}

body:not(.mobile-app) #_app_container {
  height: 100vh;
  height: 100dvh;
}

/* Children of #_app_container take full height */
#_app_container > div {
  height: 100%;
}

/* Collection sidebar takes full height of its container */
#collectionSidebar {
  height: 100%;
}

/* Sidebar overlay only visible when collection page is active */
#collection:not(.active) #sidebarOverlay {
  display: none !important;
}

/* Force hide overlay when not on collection page */
body:not(:has(#collection.active)) #sidebarOverlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Force sidebar to close when collection page is not active - MOBILE ONLY */
@media (max-width: 768px) {
  #collection:not(.active) #collectionSidebar {
    left: calc(-1 * var(--sidebar-width)) !important;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0) !important;
  }
}

.page,
.mobile-navbar {
  opacity: 0;
}

body.loaded .page,
body.loaded .mobile-navbar {
  opacity: 1;
}

/* iOS Tab Bar - Moderne avec indicateur animé */
.mobile-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(248, 248, 248, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.33px solid rgba(60, 60, 67, 0.29);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Indicateur animé coulissant */
.navbar-indicator {
  position: absolute;
  left: 0;
  bottom: 8px;
  height: 3px;
  width: 40px;
  background: var(--primary-color);
  border-radius: 2px;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width;
  z-index: 1;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #8e8e93;
  transition: color 0.2s ease-out;
  padding: 8px 16px;
  min-width: 64px;
  position: relative;
  flex: 1;
  height: 100%;
}

.nav-item.active {
  color: var(--primary-color);
}

/* Ripple effect au toucher */
.nav-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition:
    width 0.4s ease-out,
    height 0.4s ease-out,
    opacity 0.4s ease-out;
  z-index: 0;
}

.nav-item:active::before {
  width: 80px;
  height: 80px;
  opacity: 0.08;
}

/* Touch support */
.nav-item {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Icon container avec transition */
.nav-icon {
  position: relative;
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease-out;
}

/* Outline version - visible par défaut */
.nav-icon .icon-outline {
  opacity: 1;
  transform: scale(1);
}

/* Filled version - cachée par défaut */
.nav-icon .icon-filled {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: scale(0.85);
}

/* Active state - filled visible, outline cachée */
.nav-item.active .icon-outline {
  opacity: 0;
  transform: scale(0.85);
}

.nav-item.active .icon-filled {
  opacity: 1;
  transform: scale(1);
}

/* Bounce animation on activation */
.nav-item.active .nav-icon svg {
  animation: navBounce 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes navBounce {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.02px;
  transition: font-weight 0.2s ease-out;
}

.nav-item:not(.active) .nav-label {
  font-weight: 400;
}

/* Page Styles */
.page {
  display: none;
  height: 100%;
  background: var(--surface);
  position: relative;
}

.page.active {
  display: block;
}

.page h1 {
  margin: 0 0 16px 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
}

.page p {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Force navbar visibility for testing */
/* .mobile-navbar {
  display: flex !important;
} */

/* Collection Page Sidebar Styles */
.collection-container {
  display: flex;
  height: 100%;
}

main#collection-main {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-toggle {
  background: var(--surface);
  border: none;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-button);
  transition: all 0.2s ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-button-active);
}

.sidebar-toggle:active {
  transform: translateY(0);
  box-shadow: var(--shadow-button);
}

.sidebar-toggle img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: transform 0.2s ease-out;
}

.sidebar-toggle:hover img {
  transform: scale(1.1);
}

.collection-sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.03);
}

#collectionSidebar::-webkit-scrollbar {
  width: 6px;
}

#collectionSidebar::-webkit-scrollbar-track {
  background: transparent;
}

#collectionSidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

#collectionSidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(
    to bottom,
    var(--surface) 0%,
    var(--surface-dim) 100%
  );
}

.sidebar-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.collection-main {
  flex: 1;
  overflow-y: auto;
  background: var(--background);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Mobile app mode - sidebar respects app container bounds */
  body.mobile-app .collection-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    height: calc(100dvh - var(--navbar-height));
    z-index: 1000;
    transform: translateX(-100%);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition:
      transform var(--sidebar-duration) var(--sidebar-easing),
      box-shadow var(--sidebar-duration) var(--sidebar-easing);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    background: var(--surface);
    overflow-y: auto;
    touch-action: pan-y;
  }

  /* Web mode - sidebar takes full screen height */
  body:not(.mobile-app) .collection-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    z-index: 1000;
    transform: translateX(-100%);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition:
      transform var(--sidebar-duration) var(--sidebar-easing),
      box-shadow var(--sidebar-duration) var(--sidebar-easing);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    background: var(--surface);
    overflow-y: auto;
    touch-action: pan-y;
  }

  body.mobile-app .collection-sidebar.open {
    transform: translateX(0);
    height: calc(100vh - var(--navbar-height));
    height: calc(100dvh - var(--navbar-height));
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }

  body:not(.mobile-app) .collection-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }

  .sidebar-close {
    display: block;
  }

  /* Overlay */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--sidebar-duration) var(--sidebar-easing);
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Backdrop pour settings/stats sidebars mobile */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .sidebar_set {
    border-bottom: 0.33px solid #c0c0c0 !important;
  }

  .set_link:last-of-type .sidebar_set {
    border-bottom: none !important;
  }
}

/* Styles pour le set actif - applicable à tous les écrans */
/* Le highlight actif utilise le Fjord Gold (#fec12d) selon le design system */
.set_link.active {
  background-color: var(--tertiary-color) !important;
  color: var(--on-tertiary) !important;
}

.set_link.active .sidebar_set {
  background-color: var(--tertiary-color) !important;
}

.set_link.active .sidebar_set_name {
  color: var(--on-tertiary) !important;
}

.set_link.active .sidebar_set_div_container {
  background-color: transparent !important;
}

.set_link.active .sidebar_set_stats {
  color: var(--on-tertiary) !important;
  opacity: 0.8;
}

.sidebar_set_stats {
  font-size: 11px;
  color: var(--text-secondary);
  padding-right: 5px;
  white-space: nowrap;
}

/* Desktop - hide toggle button */
@media (min-width: 769px) {
  .sidebar-toggle {
    display: none;
  }

  /* Desktop sidebar should inherit from parent hierarchy and be visible */
  .collection-sidebar {
    position: static; /* Reset any position fixed from mobile */
    left: auto; /* Reset left position from mobile */
    height: 100%;
    display: block; /* Ensure it's visible */
  }
}

/* Login Modal Styles */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-modal.active {
  display: flex;
}

.login-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.login-modal-content {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group input {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--outline-variant);
  border-radius: 12px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--surface-container-low);
  transition: all 0.2s ease-out;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(52, 67, 98, 0.1);
}

.btn-primary {
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-out;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-button);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.spinner {
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

.fullscreen-modal .modal-content {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.fullscreen-modal .modal-footer {
  border-top: none;
  padding: 30px 40px 80px 40px;
  position: relative;
  z-index: 1;
}

.fullscreen-modal .btn-lg {
  padding: 20px 40px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 16px;
  min-width: 320px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-hover) 100%
  );
  border: none;
  box-shadow: var(--shadow-button);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fullscreen-modal .btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-button-active);
  background: linear-gradient(135deg, var(--secondary-color) 0%, #3a7bc8 100%);
}

.fullscreen-modal .btn-lg:active {
  transform: translateY(0);
  box-shadow: var(--shadow-button);
}

/* ===== MODERN TABS SYSTEM (iOS Style) ===== */

/* Container - glass effect */
.tabs-wrapper {
  display: flex;
  align-items: center;
  background: rgba(248, 248, 248, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.33px solid rgba(60, 60, 67, 0.29);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Tabs container */
.main-tabs {
  display: flex;
  background: transparent;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
  position: relative;
  gap: 4px;
  margin-top: 4px;
}

.main-tabs::-webkit-scrollbar {
  height: 6px;
}

.main-tabs::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.main-tabs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.main-tabs::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  * {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  *::-webkit-scrollbar {
    display: none;
  }

  .main-tabs::-webkit-scrollbar {
    display: none;
  }

  .main-tabs {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
}

/* Smooth scrolling for touch devices */
.main-tabs {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Sliding indicator */
.tabs-indicator {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px;
  transition:
    left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: left, width;
  z-index: 1;
}

/* Tab scroll arrows */
.tab-scroll-arrow {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    width 0.25s ease,
    opacity 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
  position: sticky;
  z-index: 20;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
  white-space: nowrap;
}

.tab-scroll-arrow.visible {
  width: 36px;
  opacity: 1;
  pointer-events: auto;
}

.tab-scroll-arrow:hover {
  color: #374151;
  background: rgba(52, 67, 98, 0.05);
}

.tab-scroll-arrow:active {
  transform: scale(0.95);
}

.tab-scroll-left {
  left: 0;
  background: linear-gradient(
    to right,
    rgba(248, 248, 248, 0.94) 70%,
    transparent
  );
}

.tab-scroll-right {
  right: 0;
  background: linear-gradient(
    to left,
    rgba(248, 248, 248, 0.94) 70%,
    transparent
  );
}

.tab-scroll-arrow svg {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.tab-scroll-arrow:hover svg {
  opacity: 1;
}

/* Fixed tabs that don't scroll */
.main-tab-button.fixed {
  position: sticky;
  left: 0;
  z-index: 15;
  background: rgba(248, 248, 248, 0.94);
  border-right: none;
}

.sidebar-toggle-tab.fixed {
  background: transparent;
  z-index: 20;
}

.sidebar-toggle-tab {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .sidebar-toggle-tab {
    display: flex;
  }
}

.sidebar-toggle-tab:hover {
  background: transparent;
}

.sidebar-toggle-tab:active {
  transform: scale(0.95);
}

/* Tab button - base */
.main-tab-button {
  flex: none;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #8e8e93;
  cursor: pointer;
  position: relative;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border-radius: 8px 8px 0 0;
  letter-spacing: -0.1px;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

/* Ripple effect */
.main-tab-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition:
    width 0.4s ease-out,
    height 0.4s ease-out,
    opacity 0.4s ease-out;
}

.main-tab-button:active::before {
  width: 80px;
  height: 80px;
  opacity: 0.08;
}

/* Active state */
.main-tab-button.active {
  color: var(--primary-color);
  background: rgba(52, 67, 98, 0.08);
}

/* Remove old underline */
.main-tab-button::after {
  display: none;
}

.main-tab-button:hover:not(.active) {
  color: #374151;
  background: rgba(52, 67, 98, 0.05);
}

.main-tab-button:active:not(.active) {
  transform: scale(0.97);
}

/* Icon container with dual state */
.main-tab-button .tab-icon {
  position: relative;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-tab-button .tab-icon svg {
  width: 18px;
  height: 18px;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
}

/* Outline - visible par défaut */
.main-tab-button .tab-icon .icon-outline {
  opacity: 1;
  transform: scale(1);
}

/* Filled - caché par défaut */
.main-tab-button .tab-icon .icon-filled {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: scale(0.85);
}

/* Active - swap icons */
.main-tab-button.active .tab-icon .icon-outline {
  opacity: 0;
  transform: scale(0.85);
}

.main-tab-button.active .tab-icon .icon-filled {
  opacity: 1;
  transform: scale(1);
}

/* Bounce animation on activation */
.main-tab-button.active .tab-icon svg {
  animation: tabBounce 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tabBounce {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Badge styling */
#collection-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary-color);
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes badgePulse {
  0% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.3);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

.badge-pulse {
  animation: badgePulse 0.3s ease;
}

/* Dynamic tab styles */
.main-tab-button .tab-close-btn {
  cursor: pointer;
  margin-left: 8px;
  flex-shrink: 0;
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  background-color: #dc2626;
  color: white;
}

.main-tab-button .tab-close-btn:hover {
  background-color: #fecaca;
  color: #dc2626;
}

.main-tab-button .tab-close-btn svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* Tab animations */
.main-tab-button-entering {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-tab-button-entered {
  opacity: 1;
  transform: translateY(0);
}

.main-tab-button-exiting {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#windows_tabs_content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-tab-content {
  display: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.main-tab-content.active {
  display: flex;
  flex-direction: column;
}

.swal2-container {
  z-index: 10000 !important;
}
