@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  --bg-dark: #050507;
  --bg-panel: rgba(15, 15, 20, 0.7);
  --bg-panel-hover: rgba(25, 25, 35, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent-cyan: #00f0ff;
  --accent-blue: #2563eb;
  --accent-indigo: #4f46e5;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.3);
  --glow-indigo: 0 0 20px rgba(79, 70, 229, 0.4);
}

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

body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(-45deg, #050507, #0f0c29, #1c143d, #050507);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  padding: 1rem 0;
  /* Added padding to prevent stickiness on scroll */
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Background mesh/grid effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: radial-gradient(rgba(0, 240, 255, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
  z-index: -1;
  pointer-events: none;
}

.container {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 45px 40px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  margin: 6rem auto;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 580px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0;
  /* For GSAP */
  position: relative;
  overflow: hidden;
}

/* Container accent line */
.container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-indigo), transparent);
}

.title {
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2rem;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.email-input,
.subject-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  outline: none;
  margin-bottom: 1.2rem;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  transition: all 0.3s ease;
}

.email-input:focus,
.subject-input:focus {
  border-color: var(--accent-indigo);
  box-shadow: var(--glow-indigo);
  background: rgba(0, 0, 0, 0.6);
}

.email-input::placeholder,
.subject-input::placeholder {
  color: var(--text-muted);
}

.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.mode-toggle button {
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-toggle button:hover {
  color: var(--text-main);
}

.mode-toggle button.active {
  background: rgba(79, 70, 229, 0.2);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1);
}

.mode-toggle button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.content {
  width: 100%;
  position: relative;
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  outline: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
  resize: none;
  transition: all 0.3s ease;
}

textarea:focus {
  border-color: var(--accent-indigo);
  box-shadow: var(--glow-indigo);
  background: rgba(0, 0, 0, 0.6);
}

textarea::placeholder {
  color: var(--text-muted);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-indigo);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(79, 70, 229, 0.5);
  border-radius: 12px;
  height: 220px;
  color: var(--text-muted);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
}

.file-drop svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  fill: var(--text-muted);
  transition: all 0.3s ease;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
  color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.file-drop:hover svg {
  fill: var(--accent-cyan);
  transform: translateY(-5px);
}

#uploadList {
  width: 100%;
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
}

#uploadList .file {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

#uploadList .file .file-info {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  justify-content: space-between;
  width: 100%;
}

#uploadList .file .file-info .filename {
  white-space: nowrap;
  max-width: 80%;
  overflow-x: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

#uploadList .file .file-info .remove-icon {
  cursor: pointer;
  color: #ef4444;
  transition: all 0.2s;
}

#uploadList .file .file-info .remove-icon:hover {
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

#uploadList .file .file-info .remove-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#uploadList .file .progress-outer {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.5);
}

#uploadList .file .progress-outer .progress-inner {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
  animation: uploading 3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  box-shadow: var(--glow-cyan);
}

@keyframes uploading {
  0% {
    width: 0%;
  }

  30% {
    width: 40%;
  }

  70% {
    width: 70%;
  }

  100% {
    width: 98%;
  }
}

#uploadList .file .progress-outer .uploaded {
  width: 100%;
  animation: hideProgress 0.8s ease forwards;
  animation-delay: 0.5s;
}

@keyframes hideProgress {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    height: 0;
  }
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.8), rgba(0, 240, 255, 0.5));
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

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

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(0, 240, 255, 0.7));
}

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

.submit-btn:active {
  transform: translateY(1px);
}

/* --- RESPONSIVE CARD SPACING --- */
@media (max-width: 768px) {
  .container {
    margin: 6rem auto 2rem;
    padding: 35px 25px;
    width: 95%;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 5rem auto 1.5rem;
    padding: 30px 20px;
    width: 95%;
  }

  .title {
    font-size: 2.2rem;
  }

  .email-input,
  .subject-input,
  textarea,
  .file-drop {
    font-size: 1rem;
  }

  .mode-toggle button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* --- STORY INTRO OVERLAY --- */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#intro-skip {
  position: absolute;
  top: 30px;
  right: 40px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s;
  z-index: 10000;
}

#intro-skip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.intro-scene {
  position: absolute;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.intro-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  filter: drop-shadow(var(--glow-cyan));
}

.intro-scene h2 {
  font-size: 2.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(to right, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-title {
  font-size: 4.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  background: linear-gradient(to right, var(--accent-indigo), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.4);
}

@media (max-width: 768px) {
  .intro-scene h2 {
    font-size: 1.8rem;
  }

  .intro-title {
    font-size: 2.5rem;
  }

  .intro-icon {
    width: 80px;
    height: 80px;
  }
}