/* ==============================================================================================================================
   [ ROLEAGORA APP ]
   Public mobile shell styles — dark nightlife theme.
   ============================================================================================================================== */

/* ── Global overrides when RoleAgora public mode is active ─────── */

body.roleagora-public-layout {
  background: #0b0c11;
}

body.roleagora-public-layout #app {
  background: #0b0c11;
}

.module-roleagora.roleagora-public-active,
.module-roleagora:has(.roleagora-app) {
  background: #0b0c11;
}

.module-roleagora:has(.roleagora-app) #menu-module {
  display: none;
}

.module-roleagora:has(.roleagora-app) #content-submodule {
  background: transparent;
  padding: 0;
}

/* ── App shell ─────────────────────────────────────────────────── */

.roleagora-app,
.roleagora-app * {
  box-sizing: border-box;
}

.roleagora-app {
  --ra-bg: #0b0c11;
  --ra-surface: #14151c;
  --ra-border: rgba(255, 255, 255, 0.08);
  --ra-text: #f0f2f5;
  --ra-muted: rgba(240, 242, 245, 0.55);
  --ra-purple: #a855f7;
  --ra-blue: #4f6aff;
  --ra-green: #64e379;
  --ra-gradient: linear-gradient(135deg, #a855f7, #4f6aff);

  width: 100%;
  max-width: 480px;
  min-height: calc(100vh - 62px);
  margin: 0 auto;
  padding: 6px 14px 80px;
  color: var(--ra-text);
  background: transparent;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

/* ── Header ────────────────────────────────────────────────────── */

.roleagora-app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-top: 8px;
}

.roleagora-brand {
  margin: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.roleagora-brand span {
  background: var(--ra-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.roleagora-location {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ra-muted);
  font-size: 13px;
  cursor: pointer;
}

.roleagora-location .material-symbols-outlined {
  font-size: 16px;
  color: var(--ra-purple);
}

.roleagora-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  flex-shrink: 0;
}

.roleagora-icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: background 0.15s;
}

.roleagora-icon-button:hover {
  background: rgba(255, 255, 255, 0.11);
}

.roleagora-icon-button .material-symbols-outlined {
  font-size: 24px;
}

.roleagora-notification-dot {
  position: relative;
}

.roleagora-notification-dot::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ra-purple);
  border: 2px solid var(--ra-bg);
}

/* ── Period tabs / segmented control ───────────────────────────── */

.roleagora-period-menu {
  margin-bottom: 16px;
}

.roleagora-period-tabs {
  width: 100%;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04) !important;
  overflow: visible; /* let the active tab glow bleed outside the container */
}

.roleagora-period-tabs .config-nav {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.roleagora-period-tabs .tab-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: rgba(240, 242, 245, 0.5) !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.2s ease;
}

.roleagora-period-tabs .tab-item.active {
  color: #fff !important;
  border: 0 !important;
  background: var(--ra-gradient) !important;
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.25),
    0 4px 20px rgba(168, 85, 247, 0.7),
    0 8px 40px rgba(79, 106, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

.roleagora-period-tabs .tab-item .material-symbols-outlined {
  font-size: 18px;
}

.roleagora-period-tabs .tab-item.active .material-symbols-outlined.filled {
  font-variation-settings: "FILL" 1;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

/* ── Search bar ────────────────────────────────────────────────── */

.roleagora-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin-bottom: 16px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(18, 19, 26, 0.9);
  color: var(--ra-muted);
}

.roleagora-search .material-symbols-outlined {
  font-size: 22px;
  color: var(--ra-muted);
  flex-shrink: 0;
}

.roleagora-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ra-text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.roleagora-search input::placeholder {
  color: var(--ra-muted);
}

/* ── Generic section title ─────────────────────────────────────── */

.roleagora-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.roleagora-section-title h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.roleagora-section-title a {
  color: var(--ra-purple);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.roleagora-section-title a:hover {
  text-decoration: underline;
}

/* ── Bottom navigation ─────────────────────────────────────────── */

.module-roleagora .roleagora-bottom-nav {
  display: none;
}

.module-roleagora:has(.roleagora-app) .roleagora-bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 997; /* below #sidebar-top (998/1002) so dropdown inside it always wins */
  width: min(480px, 100vw);
  height: 68px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(11, 12, 17, 0.96);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center;
}

.roleagora-nav-btn {
  display: grid;
  place-items: center;
  gap: 1px;
  width: auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
}

.roleagora-nav-btn span:not(.material-symbols-outlined) {
  display: block;
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.roleagora-nav-btn .material-symbols-outlined {
  font-size: 26px;
  transition: font-variation-settings 0.15s;
}

.roleagora-nav-btn.active {
  color: #b66cff;
}

.roleagora-nav-btn.active .material-symbols-outlined {
  font-variation-settings: "FILL" 1;
  color: #a855f7;
}

/* ── Notify dropdown content ───────────────────────────────────── */

body.roleagora-public-layout .notify-header,
body.roleagora-public-layout .notify-title-header {
  color: rgba(240, 242, 245, 0.9) !important;
  border-bottom-color: rgba(255, 255, 255, 0.07) !important;
}

body.roleagora-public-layout .notify-icon {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.roleagora-public-layout .notify-icon i,
body.roleagora-public-layout .notify-icon .material-symbols-outlined {
  color: rgba(168, 85, 247, 0.9) !important;
}

body.roleagora-public-layout #notify-list {
  background-image: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)) !important;
}

body.roleagora-public-layout .notify-item {
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

body.roleagora-public-layout .notify-item::before {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(22, 23, 34, 0.9) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

body.roleagora-public-layout .notify-item.unread::before {
  background: #a855f7 !important;
}

body.roleagora-public-layout .notify-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

body.roleagora-public-layout .notify-title {
  color: rgba(240, 242, 245, 0.9) !important;
}

body.roleagora-public-layout .notify-message {
  color: rgba(240, 242, 245, 0.55) !important;
}

body.roleagora-public-layout .notify-date {
  color: rgba(240, 242, 245, 0.35) !important;
}

body.roleagora-public-layout .notify-empty {
  color: rgba(240, 242, 245, 0.45) !important;
}

body.roleagora-public-layout .notify-footer {
  background: rgba(0, 0, 0, 0.2) !important;
  border-top-color: rgba(255, 255, 255, 0.07) !important;
}

body.roleagora-public-layout .notify-footer button {
  color: #a855f7 !important;
}

body.roleagora-public-layout .notify-footer button:hover {
  color: #c084fc !important;
}

/* ── Modals dark theme ─────────────────────────────────────────── */

body.roleagora-public-layout .modal-box {
  background: #14151c !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

body.roleagora-public-layout .modal-title {
  color: rgba(240, 242, 245, 0.95) !important;
}

body.roleagora-public-layout .modal-header .modal-icon {
  background: rgba(168, 85, 247, 0.12) !important;
}

body.roleagora-public-layout .modal-header .modal-icon .material-symbols-outlined,
body.roleagora-public-layout .modal-header .modal-icon i {
  color: #a855f7 !important;
}

body.roleagora-public-layout .modal-close {
  color: rgba(255, 255, 255, 0.4) !important;
}

body.roleagora-public-layout .modal-close:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

body.roleagora-public-layout .modal-content {
  color: rgba(240, 242, 245, 0.85) !important;
}

body.roleagora-public-layout .modal-content label {
  color: rgba(240, 242, 245, 0.65) !important;
  font-size: 13px;
}

body.roleagora-public-layout .modal-footer {
  border-top-color: rgba(255, 255, 255, 0.07) !important;
  background: transparent !important;
}

/* Notify modal content (inline styles need !important to be overridden) */
body.roleagora-public-layout #notify-modal-title {
  color: rgba(240, 242, 245, 0.95) !important;
}

body.roleagora-public-layout #notify-modal-message {
  color: rgba(240, 242, 245, 0.75) !important;
}

body.roleagora-public-layout #notify-modal-date {
  color: rgba(240, 242, 245, 0.4) !important;
}

/* FexSelect inside dark modals */
body.roleagora-public-layout .modal-box .fex-select-wrapper {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.roleagora-public-layout .modal-box .fex-select-wrapper:hover {
  border-color: rgba(168, 85, 247, 0.4) !important;
}

body.roleagora-public-layout .modal-box .fex-select-content {
  color: rgba(240, 242, 245, 0.85) !important;
}

body.roleagora-public-layout .modal-box .fex-select-icon {
  color: rgba(255, 255, 255, 0.4) !important;
}

body.roleagora-public-layout .modal-box .fex-select-search-toggle {
  background: rgba(255, 255, 255, 0.04) !important;
  border-left-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.4) !important;
}

/* FexSelect options list */
body.roleagora-public-layout .modal-box .fex-select-options {
  background: #1a1b27 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

body.roleagora-public-layout .modal-box .fex-select-option {
  background-color: transparent !important;
  color: rgba(240, 242, 245, 0.85) !important;
}

body.roleagora-public-layout .modal-box .fex-select-option:hover,
body.roleagora-public-layout .modal-box .fex-select-option.highlighted {
  background-color: rgba(168, 85, 247, 0.12) !important;
  color: #fff !important;
}

body.roleagora-public-layout .modal-box .fex-select-option.selected {
  background: rgba(168, 85, 247, 0.18) !important;
  color: #c084fc !important;
}

body.roleagora-public-layout .modal-box .fex-select-option-check {
  color: #a855f7 !important;
}

/* Form container */
body.roleagora-public-layout .modal-box form {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Form inputs dark */
body.roleagora-public-layout .modal-box form input[type="text"],
body.roleagora-public-layout .modal-box form input[type="password"],
body.roleagora-public-layout .modal-box form input[type="email"],
body.roleagora-public-layout .modal-box form input[type="number"] {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(240, 242, 245, 0.9) !important;
  box-shadow: none !important;
}

body.roleagora-public-layout .modal-box form input[type="text"]:focus,
body.roleagora-public-layout .modal-box form input[type="password"]:focus,
body.roleagora-public-layout .modal-box form input[type="email"]:focus,
body.roleagora-public-layout .modal-box form input[type="number"]:focus {
  border-color: rgba(168, 85, 247, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12) !important;
}

body.roleagora-public-layout .modal-box form input::placeholder {
  color: rgba(240, 242, 245, 0.3) !important;
}

body.roleagora-public-layout .modal-box form label {
  color: rgba(240, 242, 245, 0.6) !important;
}

/* Confirmar button — gradient RoleAgora style */
body.roleagora-public-layout .modal-box .btn-save,
body.roleagora-public-layout .modal-box .btn-green {
  width: 100%;
  min-height: 46px;
  background: linear-gradient(135deg, #a855f7, #4f6aff) !important;
  border-color: transparent !important;
  border-radius: 12px !important;
  color: #fff !important;
  font-size: 15px !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35) !important;
}

body.roleagora-public-layout .modal-box .btn-save:hover,
body.roleagora-public-layout .modal-box .btn-green:hover {
  background: linear-gradient(135deg, #b668ff, #6079ff) !important;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5) !important;
  transform: translateY(-1px) !important;
}

/* Notification toast dark theme (top toast, not the dropdown) */
body.roleagora-public-layout .notification-container {
  background: #1a1b27 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.roleagora-public-layout .notification-title {
  color: rgba(240, 242, 245, 0.95) !important;
}

body.roleagora-public-layout .notification-message {
  color: rgba(240, 242, 245, 0.6) !important;
}

body.roleagora-public-layout .notification-icon {
  background: rgba(255, 255, 255, 0.07) !important;
}

body.roleagora-public-layout .notification-close {
  color: rgba(255, 255, 255, 0.4) !important;
}

body.roleagora-public-layout .notification-close:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

/* ── Dropdown dark theme ───────────────────────────────────────── */

@media (max-width: 768px) {
  body.roleagora-public-layout .dropdown,
  body.roleagora-public-layout #notify-dropdown {
    background: #16172280 !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.6) !important;
  }

  body.roleagora-public-layout .dropdown-header,
  body.roleagora-public-layout .notify-header {
    color: rgba(240, 242, 245, 0.9) !important;
    border-bottom-color: rgba(255, 255, 255, 0.07) !important;
    background: transparent !important;
  }

  body.roleagora-public-layout .dropdown-icon {
    background: rgba(255, 255, 255, 0.07) !important;
  }

  body.roleagora-public-layout .dropdown-icon .material-symbols-outlined,
  body.roleagora-public-layout .dropdown-icon i {
    color: rgba(168, 85, 247, 0.9) !important;
  }

  body.roleagora-public-layout .dropdown .btn-dropdown,
  body.roleagora-public-layout .dropdown .dropdown-item {
    color: rgba(240, 242, 245, 0.85) !important;
    border-radius: 10px !important;
  }

  body.roleagora-public-layout .dropdown .btn-dropdown .material-symbols-outlined,
  body.roleagora-public-layout .dropdown .dropdown-item .material-symbols-outlined,
  body.roleagora-public-layout .dropdown .btn-dropdown i,
  body.roleagora-public-layout .dropdown .dropdown-item i {
    color: rgba(255, 255, 255, 0.4) !important;
  }

  body.roleagora-public-layout .dropdown .btn-dropdown:hover,
  body.roleagora-public-layout .dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #fff !important;
  }

  body.roleagora-public-layout .dropdown .logout,
  body.roleagora-public-layout .dropdown .btn-dropdown.logout {
    color: rgba(248, 113, 113, 0.9) !important;
  }

  body.roleagora-public-layout .dropdown .logout:hover,
  body.roleagora-public-layout .dropdown .btn-dropdown.logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
  }

  /* notify-dropdown dark */
  body.roleagora-public-layout #notify-dropdown .notify-icon {
    background: rgba(255, 255, 255, 0.07) !important;
  }

  body.roleagora-public-layout #notify-dropdown .notify-icon i {
    color: rgba(255, 255, 255, 0.5) !important;
  }
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
  body.roleagora-public-layout #app {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 56px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    background: #0b0c11;
  }

  body.roleagora-public-layout .module-roleagora {
    background: transparent;
  }

  .roleagora-app {
    max-width: none;
    min-height: calc(100vh - 56px);
    padding: 6px 14px 80px;
  }
}

@media (max-width: 380px) {
  .roleagora-app {
    padding-inline: 12px;
  }

  .roleagora-brand {
    font-size: 25px;
  }

  .roleagora-period-tabs {
    border-radius: 14px;
    padding: 3px;
  }

  .roleagora-period-tabs .tab-item {
    gap: 4px;
    font-size: 12px;
    height: 34px;
    border-radius: 11px;
    padding: 0 6px;
  }

  .roleagora-period-tabs .tab-item .material-symbols-outlined {
    font-size: 16px;
  }
}
