/* ==========================================================================
   Johann Grabmann — Modern Chat-Style Stylesheet
   ========================================================================== */

:root {
  --bg-dark: #0b0e14;
  --glass-bg: rgba(17, 22, 33, 0.72);
  --glass-border: rgba(255, 255, 255, 0.11);
  --bubble-bg: rgba(28, 35, 51, 0.88);
  --bubble-border: rgba(255, 255, 255, 0.09);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --accent: #f2a711;
  --accent-glow: rgba(242, 167, 17, 0.28);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 4.5rem;
  position: relative;
}

/* ==========================================================================
   Soft Animated Ambient Background
   ========================================================================== */

.ambient-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 35%, #131826 0%, #090b11 100%);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.55;
  will-change: transform;
}

.orb-1 {
  width: 55vw;
  height: 55vw;
  max-width: 680px;
  max-height: 680px;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(242, 167, 17, 0.24) 0%, rgba(249, 115, 22, 0.08) 55%, transparent 75%);
  animation: floatOrb1 24s ease-in-out infinite alternate;
}

.orb-2 {
  width: 50vw;
  height: 50vw;
  max-width: 620px;
  max-height: 620px;
  bottom: -15%;
  right: -8%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, rgba(99, 102, 241, 0.08) 55%, transparent 75%);
  animation: floatOrb2 28s ease-in-out infinite alternate;
}

.orb-3 {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  top: 30%;
  left: 35%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(242, 167, 17, 0.06) 55%, transparent 75%);
  animation: floatOrb3 32s ease-in-out infinite alternate;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.65) 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.65) 0%, transparent 80%);
}

@keyframes floatOrb1 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(12vw, 8vh, 0) scale(1.08);
  }
  100% {
    transform: translate3d(4vw, 18vh, 0) scale(0.95);
  }
}

@keyframes floatOrb2 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-14vw, -10vh, 0) scale(1.1);
  }
  100% {
    transform: translate3d(-6vw, -20vh, 0) scale(0.94);
  }
}

@keyframes floatOrb3 {
  0% {
    transform: translate3d(-8vw, -5vh, 0) scale(0.95);
  }
  50% {
    transform: translate3d(10vw, 6vh, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-4vw, 12vh, 0) scale(1);
  }
}

/* ==========================================================================
   Main Chat Container
   ========================================================================== */

#content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 560px;
  background: var(--glass-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 2rem 1.75rem 2.25rem;
  box-shadow: 0 25px 55px -12px rgba(0, 0, 0, 0.7),
              0 0 40px -10px rgba(242, 167, 17, 0.12);
}

/* Avatar (.me) */
.me {
  background: url('../avatar.jpg') center center no-repeat,
              url('https://www.gravatar.com/avatar/833a6210ad5079d67fe8ef2597280e04?s=300') center center no-repeat;
  background-size: cover;
  width: 96px;
  height: 96px;
  margin: 0 auto 1.75rem;
  border-radius: 50%;
  position: relative;
  border: 3px solid rgba(242, 167, 17, 0.65);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5),
              0 0 22px var(--accent-glow);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.35s ease,
              border-color 0.35s ease;
}

/* Online Status Indicator on Avatar */
.me::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background-color: #22c55e;
  border: 3px solid #131824;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.me:hover {
  transform: scale(1.06) translateY(-2px);
  border-radius: 24%;
  border-color: var(--accent);
}

/* ==========================================================================
   Chat Messages & Bubbles
   ========================================================================== */

#messages.cb__list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#messages.cb__list li {
  display: flex;
  justify-content: flex-start;
}

.cb__list .bubble {
  display: inline-block;
  position: relative;
  background: var(--bubble-bg);
  border: 1px solid var(--bubble-border);
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.55;
  padding: 0.85rem 1.2rem;
  margin: 0;
  border-radius: 20px 20px 20px 6px;
  max-width: 92%;
  min-width: 54px;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.45);
  animation: bubblePopIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: left bottom;
}

@keyframes bubblePopIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Typing state */
.cb__list .bubble.typing {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.7rem 1.15rem;
  animation: cb-pulse 1.1s ease-in-out infinite;
}

@keyframes cb-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Inline Links inside Chat Bubbles (a.bref) */
a.bref {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.55rem;
  margin: 0 0.1rem;
  border-radius: 8px;
  background: rgba(242, 167, 17, 0.15);
  border: 1px solid rgba(242, 167, 17, 0.35);
  color: #fbbf24;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

a.bref i {
  font-size: 0.92em;
}

a.bref:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0e14;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(242, 167, 17, 0.4);
}

a.bref:active {
  transform: translateY(0);
}

/* ==========================================================================
   Footer Info (Impressum & Datenschutz)
   ========================================================================== */

.info {
  position: fixed;
  bottom: 16px;
  left: 18px;
  z-index: 20;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: rgba(17, 22, 33, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
}

.info a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.info a:hover {
  color: var(--accent);
}

/* Responsive Adjustments */
@media screen and (max-width: 600px) {
  body {
    padding: 1.25rem 0.85rem 4.5rem;
  }

  #content {
    padding: 1.5rem 1.15rem 1.75rem;
    border-radius: 22px;
  }

  .me {
    width: 80px;
    height: 80px;
    margin-bottom: 1.25rem;
  }

  .cb__list .bubble {
    font-size: 0.98rem;
    padding: 0.75rem 1rem;
    max-width: 96%;
  }
}
