:root {
  --bg: #05070a;
  --card: #0f121a;
  --text: #e0e0e0;
  --header-text: #ffffff;
  --subtext: #a0a0a0;
  --border: #2a2e38;
  --input-bg: #161b22;
  --accent: #5865f2;
  --calendar-filter: invert(45%) sepia(85%) saturate(1200%) hue-rotate(200deg) brightness(100%) contrast(105%);
  --grad-main: linear-gradient(90deg, #0d1117, #1e3a8a, #3b82f6, #60a5fa, #3b82f6, #1e3a8a, #0d1117);
  --grad-btn: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
  color-scheme: dark;
}

body.light-theme {
  --bg: #2d2b23;
  --card: #3d3b32;
  --text: #eee8d5;
  --header-text: #f0ead6;
  --subtext: #b5af9c;
  --border: #4d4b42;
  --input-bg: #32312a;
  --accent: #d4af37;
  --calendar-filter: invert(75%) sepia(50%) saturate(600%) hue-rotate(10deg) brightness(100%) contrast(95%);
  --grad-main: linear-gradient(90deg, #2d2b23, #856404, #d4af37, #f0ead6, #d4af37, #856404, #2d2b23);
  --grad-btn: linear-gradient(90deg, #856404, #d4af37, #856404);
}

body.ecstatic-theme {
  --bg: #05070a;
  --card: rgba(15, 18, 26, 0.9);
  --text: #ffffff;
  --header-text: #ffffff;
  --subtext: #f0f0f0;
  --border: rgba(255, 255, 255, 0.2);
  --accent: #ff00ff;
  --calendar-filter: invert(100%);
  --grad-main: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  --grad-btn: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  --calendar-filter: brightness(0) invert(1);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
  transition: background 0.5s ease-in-out, color 0.5s ease-in-out;
  overflow-x: hidden;
}

body.ecstatic-theme::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--grad-main);
  background-size: 400% 400%;
  z-index: -2;
  animation: ecstatic-bg 15s ease infinite;
  opacity: 0.15;
}

@keyframes ecstatic-bg {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.page-wrapper {
  width: 100%;
  max-width: 750px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  box-sizing: border-box;
}

.theme-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: -0.5rem;
}

.theme-btn {
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.theme-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent);
}

body.ecstatic-theme .theme-btn.active {
  border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad-main) border-box;
  background-size: 100% 100%, 400% 100%;
  animation: ecstatic-button-border 8s linear infinite;
}

@keyframes ecstatic-button-border {
  from {
    background-position: 0% 0%, 0% 0%;
  }
  to {
    background-position: 0% 0%, -400% 0%;
  }
}

.container {
  background: var(--card);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.5s ease-in-out;
  box-sizing: border-box;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1000%;
  height: 5px;
  background: var(--grad-main);
  background-size: 50% 100%;
  animation: border-glide-zoom 25s linear infinite;
  will-change: transform;
}

@keyframes border-glide-zoom {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

h1 {
  font-size: 2.2rem;
  margin: 0 0 1rem 0;
  font-weight: 300;
  color: var(--header-text);
}

h3.label-box {
  font-size: 1.8rem;
  margin: 0 0 1.5rem 0;
  color: var(--header-text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}

p {
  line-height: 1.6;
  color: var(--subtext);
}

h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-top: 1.5rem;
}

ul {
  padding-left: 1.2rem;
  color: var(--subtext);
}

li {
  margin-bottom: 0.5rem;
}

input[type="datetime-local"] {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  width: 100%;
  padding: 14px;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  outline: none;
  box-sizing: border-box;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: var(--calendar-filter);
}

.result-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  transition: background 0.2s, transform 0.2s ease;
  min-height: 70px;
}

.result-row:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.label-box {
  font-size: 0.7rem;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.preview-text {
  color: var(--text);
  font-size: 0.95rem;
}

code {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.copy-btn {
  position: relative;
  overflow: hidden;
  border: none;
  color: white;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  min-width: 100px;
  background: #1e3a8a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  z-index: 1;
  transform: translateZ(0);
  text-shadow: 0 0 8px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 1);
  font-weight: 800;
}

.copy-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 600%;
  background: var(--grad-btn);
  background-size: 50% 100%;
  animation: button-glide-large 12s linear infinite;
  z-index: -1;
  will-change: transform;
}

body.ecstatic-theme .copy-btn::before {
  width: 2000%;
  background-size: 50% 100%;
  animation: button-glide-large 20s linear infinite;
}

@keyframes button-glide-large {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.copy-btn.saved {
  background: #43b581;
}

.copy-btn.saved::before {
  opacity: 0;
}

.preview-image-wrapper {
  margin-top: 1.5rem;
  width: 100%;
  background: #313338;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-sizing: border-box;
}

.preview-image-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 650px) {
  .result-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .theme-controls {
    justify-content: center;
  }
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: -0.5rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-link {
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.home-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  transform: translateY(-2px);
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.profile-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  transform: translateY(-2px);
}

body.ecstatic-theme .home-link,
body.ecstatic-theme .profile-link {
  border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad-main) border-box;
  background-size: 100% 100%, 400% 100%;
  animation: ecstatic-button-border 8s linear infinite;
}

.theme-controls {
  margin-bottom: 0;
}
