﻿/* ============================================================
   CyberSentinel Sentinel-Only UI
   Applies only when body has .csai-page
   Homepage stays untouched.
   ============================================================ */

body:not(.csai-page) .csai-root,
body:not(.csai-page) .csai-backdrop,
body:not(.csai-page) .csai-profile-launcher,
body:not(.csai-page) .csai-popover,
body:not(.csai-page) .csai-header-settings {
  display: none !important;
}

body.csai-page {
  background:
    radial-gradient(circle at 12% 0%, rgba(36, 137, 255, 0.22), transparent 28%),
    radial-gradient(circle at 92% 88%, rgba(22, 207, 171, 0.16), transparent 26%),
    linear-gradient(135deg, #071527 0%, #081322 45%, #03101e 100%) !important;
}

body.csai-page,
body.csai-page * {
  box-sizing: border-box;
}

body.csai-page input,
body.csai-page textarea {
  color: #f6fbff !important;
}

body.csai-page input::placeholder,
body.csai-page textarea::placeholder {
  color: rgba(220, 230, 245, 0.55) !important;
}

.csai-root,
.csai-root * {
  box-sizing: border-box;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.csai-header-settings {
  border: 1px solid rgba(76, 205, 255, 0.32);
  border-radius: 18px;
  padding: 12px 17px;
  background: rgba(13, 30, 54, 0.92);
  color: #f6fbff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
}

.csai-header-settings:hover {
  background: rgba(25, 63, 105, 0.94);
  border-color: rgba(78, 229, 255, 0.66);
}

.csai-profile-launcher {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 99970;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 245px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(84, 164, 255, 0.35);
  background: linear-gradient(135deg, rgba(6, 18, 38, 0.98), rgba(3, 10, 24, 0.98));
  color: #f6fbff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.csai-profile-launcher:hover {
  transform: translateY(-1px);
  border-color: rgba(64, 220, 255, 0.7);
}

.csai-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 850;
  color: #ffffff;
  background:
    radial-gradient(circle at 32% 24%, rgba(80, 236, 255, 0.95), transparent 34%),
    linear-gradient(135deg, #176dff, #031b4d 75%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 4px rgba(28, 131, 255, 0.13);
}

.csai-profile-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.csai-profile-name {
  color: #f8fbff;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csai-profile-plan {
  margin-top: 4px;
  color: #a9bbd4;
  font-size: 13px;
}

.csai-chevron {
  margin-left: auto;
  color: #a9bbd4;
  font-size: 24px;
}

.csai-popover {
  position: fixed;
  left: 18px;
  bottom: 86px;
  z-index: 99980;
  width: min(430px, calc(100vw - 32px));
  display: none;
  padding: 10px;
  border-radius: 24px;
  border: 1px solid rgba(84, 164, 255, 0.34);
  background: linear-gradient(180deg, rgba(12, 28, 54, 0.99), rgba(5, 14, 31, 0.99));
  color: #f6fbff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.csai-popover.csai-active {
  display: block;
}

.csai-popover-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f6fbff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
}

.csai-popover-row:hover {
  background: rgba(47, 140, 255, 0.14);
}

.csai-account-row {
  background: rgba(255, 255, 255, 0.06);
}

.csai-popover-sub {
  display: block;
  margin-top: 2px;
  color: #a9bbd4;
  font-size: 13px;
}

.csai-divider {
  height: 1px;
  margin: 8px 6px;
  background: rgba(255, 255, 255, 0.09);
}

.csai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.csai-backdrop.csai-active {
  display: grid;
}

.csai-settings-modal,
.csai-profile-modal {
  width: min(1180px, calc(100vw - 36px));
  height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  display: grid;
  grid-template-columns: 300px 1fr;
  border-radius: 28px;
  border: 1px solid rgba(84, 164, 255, 0.34);
  background: linear-gradient(180deg, rgba(15, 31, 58, 0.99), rgba(6, 15, 34, 0.99));
  color: #f6fbff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
}

.csai-profile-modal {
  display: block;
  width: min(760px, calc(100vw - 36px));
  height: auto;
  max-height: calc(100vh - 36px);
  padding: 28px;
  overflow: auto;
}

.csai-sidebar {
  padding: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.16);
  overflow: auto;
}

.csai-close {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6fbff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.csai-close:hover {
  background: rgba(47, 140, 255, 0.18);
}

.csai-nav {
  margin-top: 24px;
  display: grid;
  gap: 8px;
}

.csai-tab {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f6fbff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
}

.csai-tab:hover {
  background: rgba(47, 140, 255, 0.11);
}

.csai-tab.csai-active {
  background: linear-gradient(135deg, rgba(47, 140, 255, 0.26), rgba(77, 231, 255, 0.08));
  outline: 1px solid rgba(77, 231, 255, 0.18);
}

.csai-content {
  padding: 26px 34px;
  overflow: auto;
}

.csai-title {
  margin: 0 0 26px;
  color: #f7fbff;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 820;
}

.csai-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 0;
}

.csai-section:first-of-type {
  border-top: 0;
}

.csai-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.csai-row:last-child {
  border-bottom: 0;
}

.csai-row strong {
  display: block;
  margin-bottom: 5px;
  color: #f7fbff;
  font-size: 18px;
}

.csai-row span {
  color: #a9bbd4;
  font-size: 14.5px;
  line-height: 1.45;
}

.csai-pill,
.csai-button,
.csai-danger {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  padding: 10px 17px;
  color: #f6fbff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
}

.csai-button {
  background: linear-gradient(135deg, #36d5df, #20c67a);
  color: #041622;
  border-color: rgba(77, 231, 255, 0.3);
}

.csai-danger {
  color: #ffabab;
  background: rgba(255, 80, 80, 0.1);
  border-color: rgba(255, 98, 98, 0.52);
}

.csai-card {
  margin-bottom: 14px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid rgba(77, 231, 255, 0.17);
  background:
    radial-gradient(circle at top left, rgba(47, 140, 255, 0.2), transparent 38%),
    rgba(0, 0, 0, 0.28);
}

.csai-card h3 {
  margin: 0 0 8px;
  color: #f7fbff;
  font-size: 22px;
}

.csai-card p {
  margin: 0 0 18px;
  color: #a9bbd4;
  line-height: 1.48;
}

.csai-toggle {
  width: 54px;
  height: 31px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  position: relative;
  cursor: pointer;
}

.csai-toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background: white;
  transition: left 0.18s ease;
}

.csai-toggle.csai-on {
  background: #2f8cff;
}

.csai-toggle.csai-on::after {
  left: 27px;
}

.csai-storage {
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin: 14px 0 24px;
}

.csai-storage-fill {
  width: 11%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f8cff, #4de7ff);
}

.csai-profile-avatar {
  width: 190px;
  height: 190px;
  margin: 16px auto 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 58px;
  font-weight: 900;
  background:
    radial-gradient(circle at 35% 20%, rgba(77, 231, 255, 0.95), transparent 34%),
    linear-gradient(135deg, #0b5cff, #031a48 74%);
  border: 4px solid rgba(255, 255, 255, 0.84);
  box-shadow: 0 0 0 8px rgba(47, 140, 255, 0.14), 0 30px 70px rgba(0, 0, 0, 0.35);
}

.csai-field {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.04);
}

.csai-field label {
  display: block;
  color: #a9bbd4;
  font-size: 13px;
  margin-bottom: 6px;
}

.csai-field div {
  color: #f7fbff;
  font-size: 19px;
}

.csai-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 850px) {
  .csai-settings-modal {
    grid-template-columns: 1fr;
  }

  .csai-sidebar {
    max-height: 230px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .csai-content {
    padding: 22px;
  }

  .csai-profile-launcher {
    right: 18px;
    min-width: 0;
  }
}
