/* ============================================
   DB-Card Component Styles
   Shared UI components across all pages.
   ============================================ */

/* === MODA Brand Utilities (replaces 3x duplicated inline defs) === */
.bg-moda { background-color: var(--color-primary); }
.bg-moda-light { background-color: var(--color-primary-ghost); }
.text-moda { color: var(--color-primary); }
.text-moda-dark { color: var(--color-moda-700); }
.border-moda { border-color: var(--color-primary); }
.border-moda-light { border-color: var(--color-primary-ghost); }
.shadow-moda { box-shadow: 0 20px 25px -5px rgba(104, 104, 172, 0.1), 0 8px 10px -6px rgba(104, 104, 172, 0.1); }

.hover\:bg-moda:hover { background-color: var(--color-primary-hover); }
.hover\:text-moda:hover { color: var(--color-primary); }
.hover\:border-moda:hover { border-color: var(--color-primary); }
.focus\:border-moda:focus { border-color: var(--color-primary); }
.focus\:ring-moda:focus { --tw-ring-color: var(--color-primary); }
.group:hover .group-hover\:bg-moda { background-color: var(--color-primary); }
.group:hover .group-hover\:text-white { color: white; }

/* === Glassmorphism Surfaces (unified naming) === */
.glass-card,
.glass-panel,
.glass-surface {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: all var(--duration-normal) var(--ease-default);
}

.glass-card:hover,
.glass-panel:hover,
.glass-surface:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-4px);
}

.crystal-container {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
}

/* === Buttons === */
.btn-primary {
  background-color: var(--color-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  transition: all var(--duration-normal) ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* === Feature Icon Container === */
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-ghost);
  color: var(--color-primary);
}

/* === HUD Text === */
.hud-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

/* === Info Chip (card-display) === */
.info-chip {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  transition: all 0.4s var(--ease-default);
}

.info-chip:hover {
  background: var(--glass-bg-hover);
  backdrop-filter: blur(16px) saturate(200%);
  -webkit-backdrop-filter: blur(16px) saturate(200%);
  border-color: var(--color-primary-border);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(104, 104, 172, 0.15), 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* === Social Node (card-display) === */
.social-node {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--color-primary-ghost);
  color: var(--color-primary);
  transition: all var(--duration-normal) ease;
}

.social-node:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: scale(1.1) rotate(3deg);
}

/* === Notifications === */
#notification-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification {
  background: var(--color-surface-elevated, white);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  font-weight: 600;
  animation: slideIn var(--duration-normal) ease;
}

.notification-info    { border-left: 4px solid var(--color-info); color: var(--color-info); }
.notification-warning { border-left: 4px solid var(--color-warning); color: var(--color-warning); }
.notification-success { border-left: 4px solid var(--color-success); color: var(--color-success); }
.notification-error   { border-left: 4px solid var(--color-error); color: var(--color-error); }

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

/* === Error Container === */
#error-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display: none;
}

.error-message {
  background: var(--color-surface-elevated, white);
  border: 2px solid var(--color-error);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  color: var(--color-error);
  font-weight: 700;
  max-width: 90%;
  width: 400px;
  box-sizing: border-box;
}

.error-message button {
  min-width: 120px;
  min-height: 44px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* === Watermark === */
.watermark {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10vw;
  color: rgba(104, 104, 172, 0.04);
  font-weight: 900;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* === Offline Badge === */
.offline-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 165, 0, 0.9);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 60;
}

/* === Warning Banner === */
.warning-banner {
  background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* === Cursor Blink === */
.cursor::after {
  content: '_';
  animation: blink 1s infinite;
  color: var(--color-primary);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* === Animations === */
.reveal {
  animation: crystalReveal 1.2s var(--ease-default) forwards;
}

@keyframes crystalReveal {
  from { opacity: 0; transform: translateY(60px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fade-in {
  animation: fadeIn var(--duration-slow) ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Bilingual Field (shared by user-portal + admin) === */
.bilingual-field {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 1px;
  background: #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
  .bilingual-field {
    grid-template-columns: 1fr;
  }
}

.bilingual-field input,
.bilingual-field textarea {
  background: #fff;
  padding: 14px 18px;
  font-size: 14px;
  border: none;
  outline: none;
}

.bilingual-field input:focus,
.bilingual-field textarea:focus {
  background: #fdfdff;
  box-shadow: inset 0 0 0 2px var(--color-primary);
  z-index: 10;
}

/* === Modal Animations === */
.modal-backdrop {
  animation: fadeInBg var(--duration-normal) ease-out;
}

@keyframes fadeInBg {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  animation: slideUp 0.4s var(--ease-default);
  background: var(--color-surface-elevated, rgba(255, 255, 255, 0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Loading Overlay === */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--color-surface) 80%, transparent);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
}
.loading-overlay:not(.hidden) {
  display: flex;
}

/* === Skeleton Loading === */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

/* === Badge System === */
.badge {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.badge-personal { background: #dbeafe; color: #1e40af; }
.badge-event    { background: #fef3c7; color: #92400e; }
.badge-sensitive { background: #fee2e2; color: #991b1b; }
.badge-bound    { background: #d1fae5; color: #065f46; }
.badge-revoked  { background: #fecaca; color: #991b1b; }
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-suspended { background: #fed7aa; color: #9a3412; }

/* === Tab System (admin) === */
.tab-btn {
  position: relative;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-secondary);
  transition: all var(--duration-normal) ease;
}
.tab-btn.active {
  color: var(--color-primary);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

/* === Social Chip Preview === */
.social-chip-prev {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-ghost);
  color: var(--color-primary);
  transition: all 0.2s;
}

/* === Google Login Button === */
.btn-google {
  background: white;
  border: 1px solid #dadce0;
  color: #3c4043;
  transition: all 0.2s;
}
.btn-google:hover:not(:disabled) {
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
}

/* === Responsive Overrides === */
@media (max-width: 768px) {
  .watermark {
    font-size: 15vw;
  }

  #notification-container {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .notification {
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 640px) {
  .error-message {
    padding: 2rem 1.5rem;
    max-width: 95%;
    width: auto;
  }

  .error-message button {
    width: 100%;
    min-height: 48px;
  }
}

/* === Card Display: 3D Flip & Desktop Effects (from v4-design.css) === */

/* Accessibility: Focus visible for keyboard navigation */
.focus\:not-sr-only:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: inherit !important;
    margin: inherit !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

/* 3D 翻轉容器 */
.card-perspective {
    perspective: 800px;
    width: 100%;
    max-width: 56rem; /* 896px */
    padding: 0 1rem;
    margin: 0 auto;
}

/* 卡片內層（可翻轉） */
.card-inner {
    position: relative;
    width: 100%;
    min-height: 600px;

    /* 3D 變換 */
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;

    /* GPU 加速 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    /* 翻轉動畫 — mobile 用較慢時間讓旋轉可見 */
    transition: transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
    cursor: pointer;
}

/* 翻轉狀態 */
.card-inner.is-flipped {
    transform: rotateY(180deg) translateZ(0);
    -webkit-transform: rotateY(180deg) translateZ(0);
}

/* Desktop: side flip for realistic effect */
@media (min-width: 1024px) {
    /* 桌面版實體名片比例 */
    .card-perspective {
        perspective: 2000px;
        max-width: 540px;
        aspect-ratio: 540 / 856;
        margin: 4rem auto;
    }

    .card-inner {
        transform-origin: center right;
        /* 桌面版：書頁翻開含 translateX，0.8s overshoot 合適 */
        transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);

        /* 使用 CSS 變數 */
        --rotate-x: 0deg;
        --rotate-y: 0deg;
        transform: rotateY(var(--rotate-y)) rotateX(var(--rotate-x)) translateZ(0);
        -webkit-transform: rotateY(var(--rotate-y)) rotateX(var(--rotate-x)) translateZ(0);
    }

    .card-inner.is-flipped {
        transform: translateX(-100%) rotateY(calc(var(--rotate-y) - 180deg)) rotateX(var(--rotate-x)) translateZ(0);
        -webkit-transform: translateX(-100%) rotateY(calc(var(--rotate-y) - 180deg)) rotateX(var(--rotate-x)) translateZ(0);
    }

    /* 白色邊框 */
    .card-face {
        border: 8px solid #fff;

        /* 4 層陰影系統 */
        box-shadow:
            0 0 0 1px rgba(0,0,0,0.05),
            0 2px 4px rgba(0,0,0,0.05),
            0 8px 16px rgba(0,0,0,0.1),
            0 30px 60px -10px rgba(0,0,0,0.2),
            inset 0 1px 0 0 rgba(255,255,255,0.5);

        transition: box-shadow 0.3s ease;
    }

    /* Hover 效果：陰影增強 */
    .card-inner:hover .card-face {
        box-shadow:
            0 0 0 1px rgba(0,0,0,0.08),
            0 4px 8px rgba(0,0,0,0.08),
            0 16px 32px rgba(0,0,0,0.15),
            0 50px 100px -15px rgba(0,0,0,0.3),
            inset 0 1px 0 0 rgba(255,255,255,0.5);
    }

    /* 桌面版字體放大 */
    /* 姓名 */
    #user-name,
    #user-name-en {
        font-size: 3.5rem; /* text-6xl: 3.75rem, 調整為 3.5rem */
        line-height: 1;
    }

    /* 職稱 */
    #user-title,
    #user-title-en {
        font-size: 1rem; /* text-base */
        line-height: 1.5rem;
    }

    /* 部門 */
    #user-department,
    #user-department-en {
        font-size: 1rem; /* text-base */
        line-height: 1.5rem;
    }

    /* HUD 文字 */
    .hud-text {
        font-size: 0.75rem; /* text-xs */
        line-height: 1rem;
    }

    /* 資訊晶片 */
    .info-chip {
        font-size: 1rem; /* text-base */
        line-height: 1.5rem;
    }

    /* Typewriter 文字 */
    #typewriter,
    #typewriter-en {
        font-size: 1.25rem; /* text-xl */
        line-height: 1.75rem;
    }
}

/* ========================================
   物理互動效果 (Desktop Only)
   ======================================== */

/* 輕微浮動動畫 */
@keyframes cardFloating {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

/* 點擊彈跳動畫 */
@keyframes cardBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(0.95); }
    60%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (min-width: 1024px) {
    /* 浮動：套用在 perspective 容器，不干涉 card-inner 的 3D transform */
    .card-perspective {
        animation: cardFloating 3s ease-in-out infinite;
    }

    /* Hover 時暫停浮動，啟動放大 */
    .card-perspective:hover {
        animation-play-state: paused;
        transform: scale(1.05);
        transition: transform 0.3s ease-out;
        z-index: 20;
    }

    /* Bounce 時暫停浮動，由 JS 添加此 class */
    .card-perspective.is-bouncing {
        animation-play-state: paused;
        animation: cardBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
}

/* 卡片正反面 */
.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;

    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scrolling from watermark */
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;

    /* Physical card standard radius (16px ≈ 6mm) */
    border-radius: 1rem;

    /* Gradient background */
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.6) 100%);

    /* Enhanced blur effect */
    backdrop-filter: blur(40px) saturate(180%) brightness(110%);
    -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(110%);

    /* Multi-layer shadow with inner highlight */
    box-shadow:
        0 4px 16px 0 rgba(104, 104, 172, 0.08),
        0 1px 4px 0 rgba(0, 0, 0, 0.04),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);

    /* Refined border */
    border: 0.5px solid rgba(255, 255, 255, 0.15);
}

/* Ambient glow — NFC signal metaphor */
.card-face::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    height: 220px;
    background: radial-gradient(
        ellipse 60% 80% at 50% 30%,
        var(--color-primary-ghost, rgba(104, 104, 172, 0.1)) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

/* 隱藏 Webkit 滾動條 */
.card-face::-webkit-scrollbar {
    display: none;
}

/* 正面 */
.card-front {
    z-index: 2;
    transform: rotateY(0deg) translateZ(1px);
    -webkit-transform: rotateY(0deg) translateZ(1px);
}

/* 背面 */
.card-back {
    z-index: 1;
    transform: rotateY(180deg) translateZ(1px);
    -webkit-transform: rotateY(180deg) translateZ(1px);
}

/* 焦點指示器（WCAG 合規） */
.card-inner:focus {
    outline: none;
}

.card-inner:focus-visible {
    outline: 2px solid var(--moda-accent);
    outline-offset: 4px;
    border-radius: 1rem;
}

/* 浮動提示 */
#hint-badge {
    animation: float 3s ease-in-out infinite;
}

#hint-badge button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 響應式調整 */
@media (max-width: 640px) {
    .card-perspective {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .card-inner {
        min-height: 500px;
    }
}

/* === Dark Mode Overrides === */
@media (prefers-color-scheme: dark) {
  /* Text */
  .text-slate-500 { color: #b0b0c4 !important; }
  .text-slate-600, .text-gray-600 { color: var(--color-text-secondary) !important; }
  .text-slate-700, .text-gray-700 { color: var(--color-text) !important; }
  .text-slate-800, .text-slate-900, .text-gray-900 { color: var(--color-text) !important; }
  .text-slate-400, .text-gray-400 { color: #c8c8de !important; }
  .text-slate-300 { color: var(--color-text-secondary) !important; }
  .text-moda { color: var(--color-primary) !important; }
  .text-black { color: var(--color-text) !important; }

  /* Colored text — lighten for dark backgrounds */
  .text-green-800, .text-green-700 { color: #6ee7b7 !important; }
  .text-green-600 { color: #34d399 !important; }
  .text-green-400 { color: #4ade80 !important; }
  .text-blue-800, .text-blue-900 { color: #93c5fd !important; }
  .text-blue-700 { color: #60a5fa !important; }
  .text-blue-600 { color: #60a5fa !important; }
  .text-red-900, .text-red-800, .text-red-700 { color: #fca5a5 !important; }
  .text-red-600 { color: #f87171 !important; }
  .text-red-500 { color: #f87171 !important; }
  .text-amber-800, .text-amber-700, .text-amber-600 { color: #fcd34d !important; }
  .text-yellow-900, .text-yellow-800, .text-yellow-700 { color: #fde047 !important; }
  .text-yellow-600, .text-yellow-500 { color: #fde047 !important; }
  .text-purple-600 { color: #c4b5fd !important; }
  .text-gray-300 { color: #9a9ab0 !important; }

  /* Backgrounds */
  .bg-white { background-color: var(--color-surface-alt) !important; }
  .bg-white\/80, .bg-white\/60, .bg-white\/50, .bg-white\/40 {
    background-color: var(--color-surface-alt) !important;
  }
  .bg-slate-50, .bg-gray-50, .bg-gray-100 { background-color: var(--color-surface) !important; }
  .bg-slate-100 { background-color: var(--color-surface-alt) !important; }
  .bg-slate-200 { background-color: rgba(255, 255, 255, 0.06) !important; }
  .bg-slate-300 { background-color: rgba(255, 255, 255, 0.1) !important; }
  .bg-green-50, .bg-green-100 { background-color: rgba(16, 185, 129, 0.15) !important; }
  .bg-blue-50, .bg-blue-100 { background-color: rgba(59, 130, 246, 0.15) !important; }
  .bg-red-50, .bg-red-100 { background-color: rgba(239, 68, 68, 0.15) !important; }
  .bg-amber-50, .bg-amber-100 { background-color: rgba(245, 158, 11, 0.15) !important; }
  .bg-yellow-50 { background-color: rgba(234, 179, 8, 0.15) !important; }
  .bg-purple-50 { background-color: rgba(168, 85, 247, 0.15) !important; }

  /* Borders */
  .border-slate-200, .border-slate-100, .border-slate-300,
  .border-gray-200, .border-gray-100, .border-gray-300 {
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  .border-yellow-300, .border-yellow-200 { border-color: rgba(253, 224, 71, 0.4) !important; }
  .border-red-500, .border-red-300 { border-color: rgba(248, 113, 113, 0.5) !important; }
  .border-blue-500, .border-blue-200 { border-color: rgba(96, 165, 250, 0.5) !important; }
  .border-green-300 { border-color: rgba(110, 231, 183, 0.4) !important; }

  /* Hover */
  .hover\:bg-slate-50:hover, .hover\:bg-gray-50:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
  }
  .hover\:bg-slate-100:hover { background-color: rgba(255, 255, 255, 0.08) !important; }
  .hover\:bg-slate-200:hover { background-color: rgba(255, 255, 255, 0.1) !important; }
  .hover\:bg-slate-300:hover { background-color: rgba(255, 255, 255, 0.12) !important; }
  .hover\:bg-white:hover { background-color: rgba(255, 255, 255, 0.08) !important; }
  .hover\:bg-green-200:hover { background-color: rgba(16, 185, 129, 0.2) !important; }
  .hover\:bg-blue-100:hover, .hover\:bg-blue-200:hover { background-color: rgba(59, 130, 246, 0.2) !important; }
  .hover\:bg-red-50:hover { background-color: rgba(239, 68, 68, 0.1) !important; }
  .hover\:bg-gray-400:hover { background-color: rgba(255, 255, 255, 0.15) !important; }
  .bg-white\/70 { background-color: var(--color-surface-alt) !important; }

  /* Input fields */
  input[type="text"], input[type="search"], input[type="email"], textarea {
    background-color: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
  }
  .placeholder-slate-400::placeholder, .placeholder\:text-slate-400::placeholder {
    color: #9a9ab0 !important;
  }

  /* Components */
  .social-node { background: var(--glass-bg); }
  .bilingual-field { background: var(--color-border); border-color: var(--color-border); }
  .bilingual-field input,
  .bilingual-field textarea { background: var(--color-surface-alt); color: var(--color-text); }
  .skeleton {
    background: linear-gradient(90deg, #1a1a24 25%, #222230 50%, #1a1a24 75%);
    background-size: 200% 100%;
  }
  .btn-google { background: var(--color-surface-alt); border-color: var(--color-border); color: var(--color-text); }

  /* Badge system */
  .badge-personal  { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
  .badge-event     { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
  .badge-sensitive { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
  .badge-bound     { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
  .badge-revoked   { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
  .badge-active    { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
  .badge-suspended { background: rgba(251, 146, 60, 0.2); color: #fdba74; }

  /* Dividers */
  .divide-slate-100 > :not(:last-child) { border-color: rgba(255, 255, 255, 0.08) !important; }

  /* Code blocks */
  code:not([class]) { background-color: var(--color-surface-alt); color: var(--color-text-secondary); }

  /* Ensure text inheritance in containers */
  .glass-card, .glass-panel, .glass-surface, .crystal-container {
    color: var(--color-text);
  }
  h1, h2, h3, h4, h5, h6 { color: var(--color-text) !important; }
  h1.text-moda, h2.text-moda, .text-moda { color: var(--color-primary) !important; }

  /* Card Display dark mode (from v4-design.css) */
  .card-face {
      box-shadow:
          0 4px 16px 0 rgba(0, 0, 0, 0.3),
          0 1px 4px 0 rgba(0, 0, 0, 0.2),
          inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.08);
  }

  @media (min-width: 1024px) {
      .card-face {
          border: 8px solid rgba(255, 255, 255, 0.08);
          box-shadow:
              0 0 0 1px rgba(255, 255, 255, 0.05),
              0 2px 4px rgba(0, 0, 0, 0.2),
              0 8px 16px rgba(0, 0, 0, 0.3),
              0 30px 60px -10px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
      }
      .card-inner:hover .card-face {
          box-shadow:
              0 0 0 1px rgba(255, 255, 255, 0.08),
              0 4px 8px rgba(0, 0, 0, 0.3),
              0 16px 32px rgba(0, 0, 0, 0.4),
              0 50px 100px -15px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
      }
  }

  .info-chip:hover {
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .error-message {
      background: var(--color-surface-elevated);
      border-color: #f87171;
      color: #fca5a5;
  }

  .notification {
      background: var(--color-surface-elevated);
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  }

  /* === Card Display: force dark text on light card face === */
  .card-face { background: #f8f8fc !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .card-face::before { display: none !important; }
  .card-face h1, .card-face h2, .card-face h3 { color: #111128 !important; }
  .card-face .text-slate-900, .card-face .font-black { color: #111128 !important; }
  .card-face .text-slate-700, .card-face .font-bold { color: #1a1a35 !important; }
  .card-face .text-slate-600 { color: #222244 !important; }
  .card-face .text-slate-500 { color: #2a2a4e !important; }
  .card-face .text-slate-400 { color: #333360 !important; }
  .card-face .text-slate-300 { color: #444470 !important; }
  .card-face .text-moda-dark { color: #2a2a5a !important; }
  .card-face .text-moda { color: #4a4a8a !important; }
  .card-face .hud-text { color: #2a2a4e !important; }
  .card-face .opacity-40 { opacity: 1 !important; }
  .card-face .info-chip { background: rgba(104,104,172,0.06) !important; border-color: rgba(104,104,172,0.12) !important; }
  .card-face .info-chip:hover { background: rgba(104,104,172,0.1) !important; }
  .card-face .social-node { background: rgba(104,104,172,0.06) !important; border-color: rgba(104,104,172,0.12) !important; color: #4a4a8a !important; }
  .card-face .bg-white { background-color: rgba(104,104,172,0.06) !important; }

}
