/* ═══════════════════════════════════════════════════════════════════════════
   BUBBLE THEME
   An optional look, switched on per browser by the bubbles button in the top
   bar (data-skin="bubble" on <html>, set by _theme_head.html before the page
   is drawn). The default theme is untouched: every rule here starts with
   html[data-skin="bubble"], so without that attribute none of it applies.
   It works with light and dark alike.

   The idea, carried from the Leave Balance card: glass surfaces, a dark
   indigo sidebar, glossy bubble buttons and fields, soft glow, and loose
   bubbles drifting behind the page.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── tokens ── light only (dark keeps portal.css's dark values for the rest) */
html[data-skin="bubble"]:not([data-theme="dark"]) {
  --brand: #6366F1;
  --brand-dark: #4F46E5;
  --brand-bg: rgba(99, 102, 241, .12);
  --surface: #F3F4FB;
  --bb-glass: rgba(255, 255, 255, .74);
  --bb-edge: rgba(255, 255, 255, .9);
  --bb-field: rgba(255, 255, 255, .86);
  --bb-ground: #F3F4FB;
}
html[data-skin="bubble"][data-theme="dark"] {
  --brand: #818CF8;
  --brand-dark: #A5B4FC;
  --brand-bg: rgba(129, 140, 248, .18);
  --bb-glass: rgba(22, 26, 46, .72);
  --bb-edge: rgba(255, 255, 255, .07);
  --bb-field: rgba(255, 255, 255, .05);
  --bb-ground: #0A0D1A;
}
html[data-skin="bubble"] {
  --radius: 18px;
  --bb-line: rgba(99, 102, 241, .18);
  --bb-glow: 0 10px 26px -10px rgba(99, 102, 241, .75);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 40px -28px rgba(39, 36, 102, .45);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 48px -28px rgba(39, 36, 102, .5);
}

/* ── the ground, with soft colour and drifting bubbles ── */
html[data-skin="bubble"] body {
  background:
    radial-gradient(60% 45% at 92% 0%, rgba(56, 189, 248, .15), transparent 70%),
    radial-gradient(55% 55% at 0% 100%, rgba(139, 92, 246, .14), transparent 70%),
    var(--bb-ground);
  background-attachment: fixed;
}
html[data-skin="bubble"] .ep-layout { position: relative; z-index: 1; }
.bb-floaters { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bb-fb {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 8%, rgba(255, 255, 255, .22) 22%,
              rgba(129, 140, 248, .12) 60%, rgba(129, 140, 248, .35) 100%);
  border: 1px solid rgba(129, 140, 248, .35);
  animation: bb-drift 16s ease-in-out infinite alternate;
}
.bb-fb.sky {
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 8%, rgba(255, 255, 255, .2) 22%,
              rgba(56, 189, 248, .12) 60%, rgba(56, 189, 248, .35) 100%);
  border-color: rgba(56, 189, 248, .35);
}
@keyframes bb-drift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(22px, -26px); }
  100% { transform: translate(-16px, 14px); }
}

/* ── sidebar: dark indigo with glass icon bubbles ── */
html[data-skin="bubble"] .ep-sidebar {
  background: radial-gradient(120% 60% at 0% 0%, #2A2770 0%, #141A3A 55%, #0B1024 100%);
  border-color: transparent;
  border-radius: 24px;
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, .7);
}
html[data-skin="bubble"] .ep-logo,
html[data-skin="bubble"] .hr-sidebar .ep-logo,
html[data-skin="bubble"] .ep-sidebar-footer { border-color: rgba(255, 255, 255, .08); }
html[data-skin="bubble"] .ep-logo-img { filter: brightness(0) invert(1); opacity: .95; }
html[data-skin="bubble"] .ep-nav-section,
html[data-skin="bubble"] .ep-nav-group-btn,
html[data-skin="bubble"] .ep-nav-chevron { color: #7C83B8; }
html[data-skin="bubble"] .ep-nav-group-btn:hover { color: #C7D2FE; }
html[data-skin="bubble"] .ep-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); }
html[data-skin="bubble"].sidebar-collapsed .ep-nav-section::before { background: rgba(255, 255, 255, .1); }
html[data-skin="bubble"] .ep-nav-item { color: #C7D2FE; border-radius: 14px; }
html[data-skin="bubble"] .ep-nav-item svg {
  box-sizing: border-box; width: 28px; height: 28px; padding: 6px; border-radius: 50%; color: #A5B4FC;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .3), rgba(255, 255, 255, .04) 60%);
  border: 1px solid rgba(255, 255, 255, .14);
}
html[data-skin="bubble"] .ep-nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
html[data-skin="bubble"] .ep-nav-item:hover svg { color: #fff; }
html[data-skin="bubble"] .ep-nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, .62), rgba(56, 189, 248, .36));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 24px -12px rgba(99, 102, 241, .9);
}
html[data-skin="bubble"] .ep-nav-item.active svg {
  color: #312E81; border-color: rgba(255, 255, 255, .5);
  background: radial-gradient(circle at 34% 30%, #fff, rgba(255, 255, 255, .4) 45%, rgba(129, 140, 248, .6));
}
html[data-skin="bubble"] .ep-sidebar-footer a { color: #A5B4FC; border-radius: 14px; }
html[data-skin="bubble"] .ep-sidebar-footer a:hover { background: rgba(222, 47, 47, .18); color: #FCA5A5; }
html[data-skin="bubble"] .ep-sidebar-toggle {
  background: radial-gradient(circle at 34% 28%, #fff, #E0E7FF); border-color: var(--bb-line); color: #4338CA;
}

/* ── top bar: glass ── */
html[data-skin="bubble"] .ep-topbar {
  background: var(--bb-glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bb-line);
}
html[data-skin="bubble"] .ep-theme-toggle {
  border-radius: 50%; border-color: var(--bb-line); color: var(--brand);
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55) 45%, rgba(129, 140, 248, .22));
  box-shadow: 0 8px 18px -10px rgba(99, 102, 241, .6);
}
html[data-skin="bubble"][data-theme="dark"] .ep-theme-toggle {
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .06) 45%, rgba(129, 140, 248, .2));
  color: #C7D2FE;
}

/* ── cards: glass ── */
html[data-skin="bubble"] .ep-card,
html[data-skin="bubble"] .ep-stat-card,
html[data-skin="bubble"] .hr-stat-card,
html[data-skin="bubble"] .ep-balance-card,
html[data-skin="bubble"] .ep-punch-card,
html[data-skin="bubble"] .emp-filter-card,
html[data-skin="bubble"] .emp-table-card,
html[data-skin="bubble"] .lbb-card,
html[data-skin="bubble"] .lbb-empty {
  background: var(--bb-glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--bb-edge);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
/* the punch card keeps a dark face: its name, clock and times are white */
html[data-skin="bubble"] .ep-punch-card {
  background: radial-gradient(120% 70% at 0% 0%, #2A2770 0%, #141A3A 55%, #0B1024 100%);
  border-color: rgba(255, 255, 255, .1);
}
html[data-skin="bubble"] .ep-alert { border-radius: 16px; }

/* stat icons become little glossy bubbles */
html[data-skin="bubble"] .ep-stat-icon,
html[data-skin="bubble"] .hr-stat-icon,
html[data-skin="bubble"] .ep-balance-icon {
  position: relative; border-radius: 50%;
  box-shadow: inset 0 -3px 6px rgba(15, 23, 42, .1), 0 6px 14px -8px rgba(15, 23, 42, .35);
}
html[data-skin="bubble"] .ep-stat-icon::after,
html[data-skin="bubble"] .hr-stat-icon::after,
html[data-skin="bubble"] .ep-balance-icon::after {
  content: ""; position: absolute; left: 16%; top: 12%; width: 40%; height: 22%;
  border-radius: 50%; background: rgba(255, 255, 255, .6); transform: rotate(-30deg); pointer-events: none;
}

/* ── buttons: glossy bubbles ── */
html[data-skin="bubble"] .ep-btn-primary,
html[data-skin="bubble"] .hr-filter-btn,
html[data-skin="bubble"] .hr-modal-submit,
html[data-skin="bubble"] .emp-add-btn,
html[data-skin="bubble"] .emp-search-btn,
html[data-skin="bubble"] .ep-login-btn {
  position: relative; overflow: hidden; border: 0; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, #6366F1, #8B5CF6 55%, #38BDF8);
  box-shadow: var(--bb-glow);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
html[data-skin="bubble"] .lbb-export { position: relative; overflow: hidden; border-radius: 999px;
  background: linear-gradient(135deg, #22C55E, #19CC64 50%, #10B981); box-shadow: 0 10px 24px -10px rgba(25, 204, 100, .8); }
html[data-skin="bubble"] .ep-btn-primary::before,
html[data-skin="bubble"] .hr-filter-btn::before,
html[data-skin="bubble"] .hr-modal-submit::before,
html[data-skin="bubble"] .emp-add-btn::before,
html[data-skin="bubble"] .emp-search-btn::before,
html[data-skin="bubble"] .ep-login-btn::before,
html[data-skin="bubble"] .lbb-export::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 2px; height: 42%; border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); pointer-events: none;
}
html[data-skin="bubble"] .ep-btn-primary:hover,
html[data-skin="bubble"] .hr-filter-btn:hover,
html[data-skin="bubble"] .hr-modal-submit:hover,
html[data-skin="bubble"] .emp-add-btn:hover,
html[data-skin="bubble"] .emp-search-btn:hover,
html[data-skin="bubble"] .ep-login-btn:hover,
html[data-skin="bubble"] .lbb-export:hover { transform: translateY(-1px); filter: brightness(1.06); }
html[data-skin="bubble"] .ep-btn-primary:active,
html[data-skin="bubble"] .hr-filter-btn:active,
html[data-skin="bubble"] .hr-modal-submit:active,
html[data-skin="bubble"] .emp-add-btn:active,
html[data-skin="bubble"] .emp-search-btn:active,
html[data-skin="bubble"] .ep-login-btn:active,
html[data-skin="bubble"] .lbb-export:active { transform: translateY(1px) scale(.98); }

html[data-skin="bubble"] .ep-btn,
html[data-skin="bubble"] .ep-btn-sm { border-radius: 999px; }
html[data-skin="bubble"] .ep-btn-outline,
html[data-skin="bubble"] .hr-modal-cancel,
html[data-skin="bubble"] .hr-clear-btn,
html[data-skin="bubble"] .emp-act-btn {
  border-radius: 999px; border: 1px solid var(--bb-line);
  background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .6));
  box-shadow: 0 8px 18px -14px rgba(39, 36, 102, .6);
}
html[data-skin="bubble"][data-theme="dark"] .ep-btn-outline,
html[data-skin="bubble"][data-theme="dark"] .hr-modal-cancel,
html[data-skin="bubble"][data-theme="dark"] .hr-clear-btn,
html[data-skin="bubble"][data-theme="dark"] .emp-act-btn { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }

/* ── fields: rounded glass with a soft glow when in use ── */
html[data-skin="bubble"] .hr-form-input,
html[data-skin="bubble"] .hr-select,
html[data-skin="bubble"] .ep-input,
html[data-skin="bubble"] .ep-select,
html[data-skin="bubble"] .hr-search-input,
html[data-skin="bubble"] .emp-search-input,
html[data-skin="bubble"] .emp-filter-select,
html[data-skin="bubble"] .lb-search,
html[data-skin="bubble"] .ep-login-input {
  border-radius: 999px; border: 1px solid var(--bb-line); background: var(--bb-field);
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, .05);
}
html[data-skin="bubble"] textarea.hr-form-input,
html[data-skin="bubble"] .hr-textarea,
html[data-skin="bubble"] .ep-textarea { border-radius: 16px; }
html[data-skin="bubble"] .hr-form-input:focus,
html[data-skin="bubble"] .hr-select:focus,
html[data-skin="bubble"] .ep-input:focus,
html[data-skin="bubble"] .ep-select:focus,
html[data-skin="bubble"] .hr-search-input:focus,
html[data-skin="bubble"] .emp-search-input:focus,
html[data-skin="bubble"] .lb-search:focus-within,
html[data-skin="bubble"] .ep-login-input:focus,
html[data-skin="bubble"] .hr-textarea:focus,
html[data-skin="bubble"] .ep-textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .16), inset 0 2px 6px rgba(15, 23, 42, .04);
}

/* ── tabs, badges, avatars, progress ── */
html[data-skin="bubble"] .hr-tab { border-radius: 999px; border-bottom-color: transparent; }
html[data-skin="bubble"] .hr-tab.active {
  color: #fff; border-bottom-color: transparent;
  background: linear-gradient(135deg, #6366F1, #38BDF8); box-shadow: var(--bb-glow);
}
html[data-skin="bubble"] .ep-badge { box-shadow: 0 0 0 1px rgba(15, 23, 42, .04), 0 4px 10px -6px currentColor; }
html[data-skin="bubble"] .ep-avatar,
html[data-skin="bubble"] .emp-avatar,
html[data-skin="bubble"] .hr-profile-avatar {
  background: radial-gradient(circle at 34% 28%, #fff 0 10%, #C7D2FE 55%, #818CF8); color: #312E81;
  box-shadow: inset 0 -3px 6px rgba(15, 23, 42, .12), 0 6px 14px -8px rgba(99, 102, 241, .7);
}
html[data-skin="bubble"] .ep-progress { border-radius: 999px; box-shadow: inset 0 2px 4px rgba(15, 23, 42, .08); }
html[data-skin="bubble"] .ep-progress-bar { border-radius: 999px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35); }

/* ── pop-ups: glass ── */
html[data-skin="bubble"] .hr-modal {
  background: var(--bb-glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--bb-edge); border-radius: 24px;
}
html[data-skin="bubble"] .hr-modal-overlay { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ── tables ── */
html[data-skin="bubble"] .hr-table tbody tr:hover td,
html[data-skin="bubble"] .ep-table tbody tr:hover td,
html[data-skin="bubble"] .emp-table tbody tr:hover td { background: rgba(99, 102, 241, .05); }
html[data-skin="bubble"] .emp-table tbody td,
html[data-skin="bubble"] .emp-table thead th { background: transparent; }

@media (prefers-reduced-motion: reduce) { .bb-fb { animation-duration: 40s; } }
