/* =========================================================
   NOUS PERSONAL HISTORY
   historychats.css
========================================================= */


/* =========================================================
   RESET
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}


:root {
  --history-bg: #020409;
  --history-bg-deep: #010207;

  --history-text: #f7f9ff;

  --history-soft:
    rgba(239, 243, 255, 0.72);

  --history-muted:
    rgba(239, 243, 255, 0.42);

  --history-faint:
    rgba(239, 243, 255, 0.22);

  --history-border:
    rgba(255, 255, 255, 0.10);

  --history-blue: #77a8ff;
  --history-purple: #a38aff;
  --history-green: #7ce0b9;

  --history-panel:
    rgba(5, 8, 14, 0.88);
}


html {
  min-height: 100%;

  background:
    var(--history-bg);

  color-scheme: dark;
}


body {
  min-height: 100vh;

  margin: 0;

  background:
    var(--history-bg);

  color:
    var(--history-text);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  -webkit-font-smoothing:
    antialiased;
}


a {
  color: inherit;
  text-decoration: none;
}


button,
input {
  font: inherit;
}


button {
  color: inherit;
}


button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline:
    1px solid
    rgba(119, 168, 255, 0.72);

  outline-offset: 4px;
}


.visually-hidden {
  position: absolute !important;

  width: 1px !important;
  height: 1px !important;

  padding: 0 !important;
  margin: -1px !important;

  overflow: hidden !important;

  clip:
    rect(0, 0, 0, 0) !important;

  white-space:
    nowrap !important;

  border: 0 !important;
}


/* =========================================================
   PAGE
========================================================= */

.history-page {
  position: relative;

  width: 100%;

  min-height:
    100vh;

  min-height:
    100dvh;

  isolation: isolate;

  overflow-x: hidden;

  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(65, 102, 215, 0.11),
      transparent 30%
    ),
    radial-gradient(
      circle at 88% 72%,
      rgba(128, 68, 202, 0.08),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #03050a,
      #010207
    );
}


/* =========================================================
   BACKGROUND
========================================================= */

.history-stars {
  position: fixed;

  inset: 0;

  z-index: -10;

  opacity: 0.62;

  pointer-events: none;

  background-image:
    radial-gradient(
      circle,
      rgba(255, 255, 255, 0.68) 1px,
      transparent 1.5px
    ),
    radial-gradient(
      circle,
      rgba(93, 143, 255, 0.58) 1px,
      transparent 1.5px
    );

  background-size:
    138px 138px,
    204px 204px;

  background-position:
    0 0,
    62px 77px;

  animation:
    historyStars
    58s
    linear
    infinite;
}


.history-nebula {
  position: fixed;

  z-index: -8;

  border-radius: 50%;

  filter:
    blur(70px);

  pointer-events: none;
}


.history-nebula-one {
  top: 10%;
  left: 14%;

  width: 460px;
  height: 460px;

  background:
    radial-gradient(
      circle,
      rgba(60, 103, 230, 0.11),
      transparent 72%
    );
}


.history-nebula-two {
  right: -180px;
  bottom: -220px;

  width: 640px;
  height: 640px;

  background:
    radial-gradient(
      circle,
      rgba(138, 83, 217, 0.11),
      transparent 72%
    );
}


/* =========================================================
   HEADER
========================================================= */

.history-header {
  position: fixed;

  top: 0;
  left: 50%;

  z-index: 50;

  width:
    calc(100% - 52px);

  height: 82px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  transform:
    translateX(-50%);

  border-bottom:
    1px solid
    var(--history-border);

  background:
    rgba(2, 4, 9, 0.66);

  backdrop-filter:
    blur(20px);

  -webkit-backdrop-filter:
    blur(20px);
}


.history-brand {
  display: inline-flex;

  align-items: center;

  gap: 12px;

  color:
    var(--history-text);

  font-size:
    0.88rem;

  font-weight:
    760;

  letter-spacing:
    0.19em;
}


.history-brand img {
  width: 31px;
  height: 31px;

  display: block;

  object-fit: contain;

  animation:
    historyLogoSpin
    14s
    linear
    infinite;
}


.history-header-actions {
  display: flex;

  align-items: center;

  gap: 20px;
}


.history-context {
  color:
    var(--history-faint);

  font-size:
    0.58rem;

  font-weight:
    700;

  letter-spacing:
    0.20em;
}


.history-back {
  min-height: 40px;

  display: inline-flex;

  align-items: center;

  padding:
    0 16px;

  border:
    1px solid
    var(--history-border);

  border-radius:
    999px;

  background:
    rgba(255, 255, 255, 0.025);

  color:
    var(--history-soft);

  font-size:
    0.69rem;

  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}


.history-back:hover {
  color: #ffffff;

  border-color:
    rgba(119, 168, 255, 0.34);

  background:
    rgba(119, 168, 255, 0.05);
}


/* =========================================================
   CONTENT
========================================================= */

.history-content {
  width:
    min(
      calc(100% - 64px),
      1320px
    );

  margin:
    0 auto;

  padding:
    150px 0 120px;
}


/* =========================================================
   INTRO
========================================================= */

.history-intro {
  width: 100%;

  padding-bottom:
    44px;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.07);
}


.history-intro > p:first-child {
  margin:
    0 0 18px;

  color:
    var(--history-blue);

  font-size:
    0.62rem;

  font-weight:
    800;

  letter-spacing:
    0.31em;
}


.history-intro h1 {
  max-width:
    900px;

  margin: 0;

  font-size:
    clamp(
      4rem,
      7vw,
      7.1rem
    );

  font-weight:
    480;

  letter-spacing:
    -0.073em;

  line-height:
    0.90;
}


.history-intro h1 span {
  display: block;

  margin-top:
    7px;

  color:
    rgba(234, 238, 250, 0.44);
}


.history-intro-bottom {
  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 30px;

  margin-top:
    28px;
}


.history-description {
  max-width:
    620px;

  margin: 0;

  color:
    var(--history-muted);

  font-size:
    0.82rem;

  line-height:
    1.75;
}


.history-new-chat {
  min-height:
    46px;

  flex:
    0 0 auto;

  padding:
    0 18px;

  border:
    1px solid
    rgba(119, 168, 255, 0.24);

  border-radius:
    999px;

  background:
    rgba(119, 168, 255, 0.06);

  color:
    var(--history-soft);

  font-size:
    0.72rem;

  font-weight:
    620;

  cursor: pointer;

  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}


.history-new-chat:hover {
  transform:
    translateY(-2px);

  border-color:
    rgba(119, 168, 255, 0.42);

  background:
    rgba(119, 168, 255, 0.10);
}


/* =========================================================
   SEARCH
========================================================= */

.history-search-section {
  padding:
    34px 0;
}


.history-search-shell {
  width:
    min(
      100%,
      720px
    );

  min-height:
    58px;

  display: grid;

  grid-template-columns:
    auto 1fr;

  align-items: center;

  gap: 13px;

  padding:
    0 18px;

  border:
    1px solid
    rgba(255, 255, 255, 0.10);

  border-radius:
    18px;

  background:
    rgba(5, 8, 14, 0.72);

  backdrop-filter:
    blur(20px);

  -webkit-backdrop-filter:
    blur(20px);

  box-shadow:
    0 18px 55px
    rgba(0, 0, 0, 0.28);

  transition:
    border-color 180ms ease,
    background 180ms ease;
}


.history-search-shell:focus-within {
  border-color:
    rgba(119, 168, 255, 0.34);

  background:
    rgba(5, 8, 14, 0.88);
}


.history-search-shell svg {
  width: 18px;
  height: 18px;

  color:
    rgba(119, 168, 255, 0.64);
}


.history-search-shell input {
  width: 100%;

  padding: 0;

  border: 0;

  outline: 0;

  background:
    transparent;

  color:
    var(--history-text);

  font-size:
    0.84rem;
}


.history-search-shell input::placeholder {
  color:
    rgba(239, 243, 255, 0.28);
}


/* =========================================================
   GROUPS
========================================================= */

.history-sections {
  display: grid;

  gap: 54px;
}


.history-group {
  width: 100%;
}


.history-group[hidden] {
  display: none;
}


.history-group-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 18px;

  margin-bottom:
    18px;

  padding-bottom:
    12px;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.055);
}


.history-group-header > span {
  color:
    rgba(119, 168, 255, 0.72);

  font-size:
    0.58rem;

  font-weight:
    800;

  letter-spacing:
    0.22em;
}


.history-group-count {
  color:
    var(--history-faint);

  font-size:
    0.61rem;
}


/* =========================================================
   HISTORY GRID
========================================================= */

.history-grid {
  display: grid;

  grid-template-columns:
    repeat(
      3,
      minmax(0, 1fr)
    );

  gap: 14px;
}


/* =========================================================
   CHAT CARD
========================================================= */

.history-card {
  position: relative;

  min-height:
    190px;

  display: flex;

  flex-direction: column;

  padding:
    22px;

  border:
    1px solid
    rgba(255, 255, 255, 0.08);

  border-radius:
    22px;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.018)
    );

  overflow: hidden;

  cursor: pointer;

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}


.history-card::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 1px;

  background:
    linear-gradient(
      to right,
      transparent,
      rgba(119, 168, 255, 0.34),
      transparent
    );

  opacity: 0;
}


.history-card:hover {
  transform:
    translateY(-4px);

  border-color:
    rgba(119, 168, 255, 0.25);

  background:
    rgba(119, 168, 255, 0.035);

  box-shadow:
    0 22px 60px
    rgba(0, 0, 0, 0.24);
}


.history-card:hover::before {
  opacity: 1;
}


.history-card-meta {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 12px;
}


.history-card-date {
  color:
    rgba(119, 168, 255, 0.66);

  font-size:
    0.56rem;

  font-weight:
    700;

  letter-spacing:
    0.14em;
}


.history-card-time {
  color:
    var(--history-faint);

  font-size:
    0.58rem;
}


.history-card h3 {
  margin:
    24px 0 10px;

  color:
    var(--history-text);

  font-size:
    1.08rem;

  font-weight:
    560;

  letter-spacing:
    -0.025em;

  line-height:
    1.35;
}


.history-card-preview {
  margin: 0;

  color:
    var(--history-muted);

  font-size:
    0.72rem;

  line-height:
    1.62;

  display:
    -webkit-box;

  -webkit-line-clamp:
    3;

  -webkit-box-orient:
    vertical;

  overflow: hidden;
}


.history-card-footer {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 14px;

  margin-top:
    auto;

  padding-top:
    24px;
}


.history-card-mode {
  color:
    var(--history-faint);

  font-size:
    0.55rem;

  letter-spacing:
    0.10em;

  text-transform:
    uppercase;
}


.history-card-open {
  color:
    rgba(119, 168, 255, 0.72);

  font-size:
    0.67rem;
}


/* =========================================================
   EMPTY GROUP
========================================================= */

.history-grid:empty::before {
  content:
    "No conversations in this period.";

  display: block;

  grid-column:
    1 / -1;

  min-height:
    110px;

  padding:
    32px;

  border:
    1px dashed
    rgba(255, 255, 255, 0.07);

  border-radius:
    18px;

  color:
    var(--history-faint);

  font-size:
    0.70rem;
}


/* =========================================================
   FULL EMPTY STATE
========================================================= */

.history-page-empty {
  min-height:
    420px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  text-align: center;

  padding:
    40px;

  border:
    1px solid
    rgba(255, 255, 255, 0.07);

  border-radius:
    28px;

  background:
    rgba(255, 255, 255, 0.018);
}


.history-page-empty[hidden] {
  display: none;
}


.history-page-empty img {
  width: 64px;
  height: 64px;

  margin-bottom:
    22px;

  object-fit: contain;

  animation:
    historyLogoSpin
    15s
    linear
    infinite;
}


.history-page-empty > span {
  color:
    var(--history-blue);

  font-size:
    0.56rem;

  font-weight:
    800;

  letter-spacing:
    0.22em;
}


.history-page-empty h2 {
  margin:
    14px 0 10px;

  font-size:
    clamp(
      2rem,
      4vw,
      3.2rem
    );

  font-weight:
    480;

  letter-spacing:
    -0.05em;
}


.history-page-empty p {
  max-width:
    430px;

  margin:
    0;

  color:
    var(--history-muted);

  font-size:
    0.75rem;

  line-height:
    1.7;
}


.history-page-empty a {
  min-height:
    44px;

  display: inline-flex;

  align-items: center;

  margin-top:
    22px;

  padding:
    0 18px;

  border:
    1px solid
    rgba(119, 168, 255, 0.24);

  border-radius:
    999px;

  background:
    rgba(119, 168, 255, 0.055);

  color:
    var(--history-soft);

  font-size:
    0.69rem;
}


/* =========================================================
   FOOTER
========================================================= */

.history-footer {
  width:
    calc(100% - 52px);

  min-height:
    62px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  margin:
    0 auto;

  border-top:
    1px solid
    rgba(255, 255, 255, 0.055);

  color:
    rgba(239, 243, 255, 0.18);

  font-size:
    0.55rem;

  letter-spacing:
    0.12em;
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes historyLogoSpin {

  from {
    transform:
      rotate(0deg);
  }

  to {
    transform:
      rotate(360deg);
  }

}


@keyframes historyStars {

  from {
    transform:
      translate3d(
        0,
        0,
        0
      );
  }

  to {
    transform:
      translate3d(
        -138px,
        86px,
        0
      );
  }

}


/* =========================================================
   TABLET
========================================================= */

@media (
  max-width: 1000px
) {

  .history-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }


  .history-intro h1 {
    font-size:
      clamp(
        3.6rem,
        8vw,
        6rem
      );
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (
  max-width: 720px
) {

  .history-header {
    width:
      calc(100% - 28px);

    height:
      70px;
  }


  .history-context {
    display:
      none;
  }


  .history-back {
    min-height:
      38px;

    padding:
      0 13px;

    font-size:
      0.64rem;
  }


  .history-content {
    width:
      calc(100% - 28px);

    padding:
      112px 0 90px;
  }


  .history-intro {
    padding-bottom:
      34px;
  }


  .history-intro h1 {
    font-size:
      clamp(
        3rem,
        14vw,
        4.8rem
      );
  }


  .history-intro-bottom {
    align-items:
      flex-start;

    flex-direction:
      column;
  }


  .history-new-chat {
    width: 100%;

    justify-content: center;
  }


  .history-search-shell {
    width: 100%;
  }


  .history-sections {
    gap:
      42px;
  }


  .history-grid {
    grid-template-columns:
      1fr;
  }


  .history-card {
    min-height:
      175px;
  }


  .history-footer {
    width:
      calc(100% - 28px);

    font-size:
      0.50rem;
  }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (
  max-width: 430px
) {

  .history-brand span {
    font-size:
      0.76rem;
  }


  .history-brand img {
    width:
      28px;

    height:
      28px;
  }


  .history-back {
    font-size:
      0.60rem;
  }


  .history-intro h1 {
    font-size:
      clamp(
        2.8rem,
        13vw,
        4rem
      );
  }


  .history-description {
    font-size:
      0.73rem;
  }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (
  prefers-reduced-motion:
  reduce
) {

  *,
  *::before,
  *::after {
    animation-duration:
      0.01ms !important;

    animation-iteration-count:
      1 !important;

    transition-duration:
      0.01ms !important;
  }

}