/* Theme: Cosmos (default) */
:root, [data-theme="cosmos"] {
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-highlight: rgba(255, 255, 255, 0.25);
  --glass-shadow: rgba(0, 0, 0, 0.3);
  --glass-blur: 20px;
  --accent-purple: rgba(147, 112, 219, 0.4);
  --accent-blue: rgba(100, 149, 237, 0.3);
  --accent-pink: rgba(219, 112, 147, 0.2);
  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.7);
  --bg-base: #0a0a12;
  --bg-gradient: linear-gradient(180deg, #0a0a12 0%, #12121f 50%, #0f0f1a 100%);
  --star-color: #ffffff;
}

/* Theme: Ocean */
[data-theme="ocean"] {
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.2);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  --accent-purple: rgba(0, 105, 148, 0.5);
  --accent-blue: rgba(0, 168, 204, 0.4);
  --accent-pink: rgba(0, 200, 180, 0.2);
  --text-primary: #e8f4f8;
  --text-secondary: rgba(232, 244, 248, 0.7);
  --bg-base: #041c24;
  --bg-gradient: linear-gradient(180deg, #041c24 0%, #063545 50%, #042a35 100%);
  --star-color: #a8d8e8;
}

/* Theme: Aurora - Northern lights inspired */
[data-theme="aurora"] {
  --glass-bg: rgba(150, 255, 200, 0.06);
  --glass-border: rgba(100, 255, 180, 0.2);
  --glass-highlight: rgba(180, 255, 220, 0.25);
  --glass-shadow: rgba(0, 20, 10, 0.4);
  --accent-purple: rgba(0, 255, 150, 0.35);
  --accent-blue: rgba(0, 220, 180, 0.3);
  --accent-pink: rgba(255, 100, 200, 0.25);
  --text-primary: #e8fff4;
  --text-secondary: rgba(200, 255, 230, 0.75);
  --bg-base: #020a08;
  --bg-gradient: linear-gradient(180deg, #020a08 0%, #041a12 30%, #082015 60%, #051510 100%);
  --star-color: #a0ffd0;
}

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

html {
  background: var(--bg-base);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 20% 20%, var(--accent-purple) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, var(--accent-blue) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, var(--accent-pink) 0%, transparent 60%),
    var(--bg-gradient);
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Cormorant Garamond', serif;
  overflow-x: hidden;
  position: relative;
  /* Extend background under status bar */
  padding-top: env(safe-area-inset-top);
  transition: background 0.5s ease;
}

/* Stars background - multiple layers for depth */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stars {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  contain: strict;
}

.stars-layer-1 { animation: drift 80s linear infinite; }
.stars-layer-2 { animation: drift 120s linear infinite; }
.stars-layer-3 { animation: drift 200s linear infinite; }

@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(2%, 1%) rotate(0.5deg); }
  50% { transform: translate(0, 2%) rotate(0deg); }
  75% { transform: translate(-2%, 1%) rotate(-0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.star {
  position: absolute;
  background: var(--star-color);
  border-radius: 50%;
  animation: twinkle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
  will-change: transform, opacity;
}

.star.bright {
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.5);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--opacity); transform: scale(1); }
  50% { opacity: 0.2; transform: scale(0.8); }
}

/* Shooting stars */
.shooting-star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px 3px rgba(255, 255, 255, 0.7);
  animation: shoot linear forwards;
}

.shooting-star::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 2px;
  background: linear-gradient(to right, rgba(255,255,255,0.95), rgba(147,112,219,0.5), transparent);
  transform: translateX(-100%) translateY(-50%);
  top: 50%;
  right: 0;
}

@keyframes shoot {
  0% { transform: translateX(0) translateY(0) rotate(45deg); opacity: 1; }
  100% { transform: translateX(var(--travel-x)) translateY(var(--travel-y)) rotate(45deg); opacity: 0; }
}

/* Satellites */
.satellite {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.8;
  animation: satellite-move var(--duration) linear forwards;
}

.satellite::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 6px;
  width: 8px;
  height: 1px;
  background: rgba(100, 149, 237, 0.6);
  transform: rotate(-20deg);
  box-shadow: 0 0 4px rgba(100, 149, 237, 0.4);
}

.satellite::after {
  content: '';
  position: absolute;
  top: -1px;
  right: 6px;
  width: 8px;
  height: 1px;
  background: rgba(100, 149, 237, 0.6);
  transform: rotate(20deg);
  box-shadow: 0 0 4px rgba(100, 149, 237, 0.4);
}

.satellite.blink {
  animation: satellite-move var(--duration) linear forwards, satellite-blink 1s ease-in-out infinite;
}

@keyframes satellite-move {
  0% { transform: translateX(0); }
  100% { transform: translateX(var(--travel-x)); }
}

@keyframes satellite-blink {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.4; }
}

/* Glass effect mixin-like class */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Main container */
.container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title {
  font-family: 'Space Mono', monospace;
  font-size: clamp(2.5rem, 10vw, 5rem);
  font-weight: 700;
  letter-spacing: 1.2rem;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, rgba(200, 200, 220, 0.9) 50%, rgba(147, 112, 219, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(147, 112, 219, 0.4));
}

.subtitle {
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  letter-spacing: 0.15rem;
}

/* Main content area */
.main-content {
  max-width: 500px;
  width: 100%;
}

/* Sections */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.5s ease-out; }

/* Section title */
.section-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Send form - Glass Card */
.send-form {
  padding: 1.5rem;
}

.send-form textarea {
  width: 100%;
  height: 160px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  padding: 1.25rem;
  resize: none;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.send-form textarea:focus {
  outline: none;
  border-color: rgba(147, 112, 219, 0.5);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(147, 112, 219, 0.2);
}

.send-form textarea::placeholder {
  color: rgba(240, 240, 245, 0.35);
  font-style: italic;
}

.char-counter {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-align: right;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  padding-right: 0.5rem;
}

.char-counter.warning {
  color: #ff7b7b;
}

/* Glass Buttons */
.btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  padding: 1rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: var(--text-primary);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.5s ease;
}

.btn:hover {
  border-color: rgba(147, 112, 219, 0.5);
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(147, 112, 219, 0.3),
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Receive section */
.receive-section {
  text-align: center;
}

.receive-intro {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Message display - Glass Card */
.message-display {
  display: none;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 1px 0 var(--glass-highlight);
  text-align: left;
}

.message-display.active {
  display: block;
  animation: glassIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes glassIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    backdrop-filter: blur(var(--glass-blur));
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  color: rgba(147, 112, 219, 0.8);
  margin-bottom: 1rem;
}

.message-content {
  font-size: 1.25rem;
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 1.25rem;
  animation: typeIn 0.8s ease-out;
}

@keyframes typeIn {
  from { opacity: 0; filter: blur(8px); }
  to { opacity: 1; filter: blur(0); }
}

.message-date {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.message-error {
  font-style: italic;
  color: var(--text-secondary);
  text-align: center;
}

.message-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-report {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  transition: all 0.3s ease;
  padding: 0.5rem 0.75rem;
}

.btn-report:hover {
  background: rgba(255, 100, 100, 0.1);
  border-color: rgba(255, 100, 100, 0.3);
  color: #ff7b7b;
}

.btn-report.reported {
  opacity: 0.3;
  cursor: default;
}

.btn-another {
  margin-top: 1.5rem;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    rgba(147, 112, 219, 0.4) 0%,
    rgba(100, 149, 237, 0.3) 50%,
    rgba(147, 112, 219, 0.4) 100%
  );
  border-color: rgba(147, 112, 219, 0.5);
}

.btn-primary:hover {
  border-color: rgba(147, 112, 219, 0.8);
  box-shadow:
    0 8px 40px rgba(147, 112, 219, 0.4),
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
  font-size: 0.85rem;
  padding: 0.9rem 1.5rem;
  opacity: 0.8;
}

.btn-ghost:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
  transform: none;
}

.btn-back {
  margin-top: 2rem;
  font-size: 0.75rem;
  padding: 0.6rem 1.2rem;
  opacity: 0.5;
}

/* Home section */
.home-intro {
  font-size: 1.15rem;
  line-height: 1.8;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.home-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 0.35rem;
  max-width: 95%;
  width: fit-content;
  margin: 0 auto;
}

.btn-pill {
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.7rem, 2.5vw, 0.9rem);
  padding: 0.9rem clamp(1rem, 3vw, 1.8rem);
  background: linear-gradient(
    135deg,
    rgba(147, 112, 219, 0.3) 0%,
    rgba(100, 149, 237, 0.2) 50%,
    rgba(147, 112, 219, 0.3) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(147, 112, 219, 0.3);
  border-radius: 50px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-pill:hover {
  background: linear-gradient(
    135deg,
    rgba(147, 112, 219, 0.5) 0%,
    rgba(100, 149, 237, 0.4) 50%,
    rgba(147, 112, 219, 0.5) 100%
  );
  border-color: rgba(147, 112, 219, 0.5);
  box-shadow: 0 4px 20px rgba(147, 112, 219, 0.3);
}

.btn-link {
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.7rem, 2.5vw, 0.9rem);
  padding: 0.9rem clamp(0.8rem, 2.5vw, 1.5rem);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}

.btn-link:hover {
  color: var(--text-primary);
}

.home-stats {
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2rem;
  opacity: 0.6;
}

/* Top bar - Glass Pills */
.top-bar {
  position: fixed;
  top: env(safe-area-inset-top, 1.5rem);
  right: 1.5rem;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}

/* Mini select for theme/language */
.select-mini {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  padding: 0.4rem 0.6rem;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
}

.select-mini:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-highlight);
}

.select-mini option {
  background: #1a1a2e;
  color: var(--text-primary);
}

/* Language dropdown */
.lang-dropdown {
  position: relative;
}

.lang-toggle {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-highlight);
}

.lang-toggle .lang-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(20, 20, 35, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 0.5rem;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  max-height: 400px;
  overflow-y: auto;
}

.lang-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-option.active {
  background: rgba(147, 112, 219, 0.2);
  color: #fff;
}

.lang-option .lang-flag {
  font-size: 1.3rem;
  line-height: 1;
}

/* Scrollbar for lang menu */
.lang-menu::-webkit-scrollbar {
  width: 6px;
}

.lang-menu::-webkit-scrollbar-track {
  background: transparent;
}

.lang-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* Personal stats */
.personal-stats {
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  opacity: 0.5;
}

/* Sound toggle - Glass Circle */
.sound-toggle {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 15px var(--glass-shadow),
    inset 0 1px 0 var(--glass-highlight);
}

.sound-toggle:hover {
  border-color: rgba(147, 112, 219, 0.5);
  box-shadow:
    0 4px 20px rgba(147, 112, 219, 0.3),
    inset 0 1px 0 var(--glass-highlight);
}

.sound-toggle.muted {
  opacity: 0.5;
}

.sound-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.8;
}

/* Footer */
.footer {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 1rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-secondary);
  z-index: 1;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.app-version {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  font-style: normal;
  color: var(--text-secondary);
  opacity: 0.3;
  letter-spacing: 0.05rem;
  transition: opacity 0.3s ease;
}

.app-version:hover {
  opacity: 0.6;
}

/* Loading - Glass Spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(147, 112, 219, 0.8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast - Glass Notification */
.toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 1px 0 var(--glass-highlight);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Visually hidden - for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .title {
    letter-spacing: 0.5rem;
  }

  .send-form {
    padding: 1.25rem;
  }

  .send-form textarea {
    height: 140px;
    font-size: 1rem;
  }

  .top-bar {
    top: env(safe-area-inset-top, 0.75rem);
    right: 0.75rem;
    padding-top: 0.5rem;
  }

  .main-content {
    padding: 0 0.5rem;
  }

  .btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.85rem;
  }
}

/* RTL support for Arabic */
[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .top-bar {
  right: auto;
  left: 1.5rem;
}

[dir="rtl"] .btn-back {
  direction: ltr;
}

[dir="rtl"] .char-counter {
  text-align: left;
}

[dir="rtl"] .message-actions {
  flex-direction: row-reverse;
}

@media (max-width: 600px) {
  [dir="rtl"] .top-bar {
    left: 0.75rem;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
