/* Tech Dark Theme (glass + neon) */

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

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

:root {
  --bg-0: #05060c;
  --bg-1: #0a0b14;
  --bg-2: #0f1220;

  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --border-2: rgba(255, 255, 255, 0.16);

  --text: #e9eefc;
  --muted: rgba(233, 238, 252, 0.72);
  --muted-2: rgba(233, 238, 252, 0.55);

  --accent: #00e5ff;
  --accent-2: #a855f7;
  --accent-3: #22c55e;

  --shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  --radius: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(168, 85, 247, 0.22), transparent 55%),
    radial-gradient(1100px 700px at 90% 20%, rgba(0, 229, 255, 0.18), transparent 60%),
    radial-gradient(900px 700px at 50% 90%, rgba(34, 197, 94, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 35%, var(--bg-2));
  color: var(--text);
  overflow-x: hidden;
}

/* grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(60% 60% at 50% 25%, #000 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: -40px;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 229, 255, 0.10), transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(168, 85, 247, 0.10), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(34, 197, 94, 0.08), transparent 45%);
  filter: blur(18px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(5, 6, 12, 0.45);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  height: 4.2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  user-select: none;
}

.logo span:first-child {
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.35));
}

.logo span:last-child {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.nav-btn {
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.95rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
}

.nav-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.btn-publish {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.92), rgba(168, 85, 247, 0.92));
  color: #05060c;
  padding: 0.55rem 1.05rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, filter 0.2s ease;
  box-shadow: 0 14px 30px rgba(0, 229, 255, 0.12);
}

.btn-publish:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  margin-top: 4.2rem;
}

.hero-content {
  text-align: center;
  max-width: 980px;
}

.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.visitor-icon {
  width: 1.2rem;
  height: 1.2rem;
  stroke: var(--accent);
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.35));
}

.visitor-label {
  font-size: 0.72rem;
  color: var(--muted-2);
}

.visitor-count {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(168, 85, 247, 0.10);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 9999px;
  padding: 0.5rem 0.95rem;
  margin-bottom: 0.8rem;
}

.badge-text {
  font-size: 0.85rem;
  color: var(--muted);
}

#userLine {
  margin: 0.75rem 0 1.25rem;
  color: var(--muted);
  display: none;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 1.12;
  margin-bottom: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-text {
  filter: drop-shadow(0 0 22px rgba(168, 85, 247, 0.24)) drop-shadow(0 0 18px rgba(0, 229, 255, 0.20));
}

.hero p {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.92), rgba(168, 85, 247, 0.92));
  color: #05060c;
  padding: 0.95rem 1.4rem;
  border-radius: 9999px;
  border: none;
  font-size: 1.02rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 18px 38px rgba(0, 229, 255, 0.10);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-secondary {
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 0.92rem 1.35rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
}

.arrow-icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* Research */
.research-section {
  padding: 4.25rem 0 2.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

#researchCount {
  color: var(--muted);
}

.search-filters {
  display: flex;
  gap: 0.9rem;
  margin-top: 1.5rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  stroke: var(--muted-2);
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem 0.8rem 2.7rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
}

.search-input:focus {
  border-color: rgba(0, 229, 255, 0.55);
  background: rgba(255, 255, 255, 0.07);
}

.filter-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: rgba(168, 85, 247, 0.55);
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
  margin-top: 1.25rem;
}

.research-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.research-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.30);
  box-shadow: 0 22px 60px rgba(0, 229, 255, 0.06), 0 22px 60px rgba(168, 85, 247, 0.06);
}

.research-image {
  width: 100%;
  height: 190px;
  background:
    radial-gradient(500px 240px at 20% 20%, rgba(0, 229, 255, 0.14), transparent 55%),
    radial-gradient(520px 240px at 80% 30%, rgba(168, 85, 247, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.research-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.research-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.03);
}

.file-type {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: rgba(233, 238, 252, 0.75);
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.16);
  z-index: 1;
}

.research-body {
  padding: 1.1rem 1.15rem 1.2rem;
}

.research-title {
  font-size: 1.05rem;
  font-weight: 900;
  margin-bottom: 0.35rem;
}

.research-author {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.research-desc {
  font-size: 0.92rem;
  color: var(--muted-2);
  margin-bottom: 0.95rem;
  line-height: 1.55;
}

.download-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.download-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(0, 229, 255, 0.30);
  transform: translateY(-1px);
}

.empty-state {
  text-align: center;
  padding: 2.6rem 1.5rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 900;
}

.close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-label {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-input,
.form-textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: rgba(0, 229, 255, 0.40);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

.file-input {
  display: none;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.file-upload-label:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.upload-icon {
  width: 1.2rem;
  height: 1.2rem;
  stroke: var(--accent);
}

.file-name {
  font-weight: 800;
}

.file-format {
  font-size: 0.78rem;
  color: var(--muted-2);
}

.error-message {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 0.85rem;
  color: rgba(255, 192, 192, 0.95);
  display: none;
}

.error-message.show {
  display: block;
}

.modal-footer {
  padding: 1.1rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
}

.btn-cancel {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.btn-submit {
  flex: 1;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.92), rgba(168, 85, 247, 0.92));
  color: #05060c;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2.75rem 0 1.5rem;
  margin-top: 3.5rem;
  background: rgba(5, 6, 12, 0.32);
  backdrop-filter: blur(12px);
}

.external-counter {
  display: flex;
  justify-content: center;
  padding: 1.25rem 0 0.25rem;
}

.external-counter a {
  display: inline-flex;
}

.external-counter img {
  max-width: 100%;
  height: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-bottom: 1.75rem;
}

.footer-section h4 {
  font-weight: 900;
  margin-bottom: 0.85rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.footer-section a {
  color: var(--muted);
  text-decoration: none;
}

.footer-section a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  text-align: center;
  color: var(--muted-2);
}

@media (max-width: 768px) {
  .nav-right {
    gap: 0.5rem;
  }

  .btn-publish {
    padding: 0.5rem 0.85rem;
  }

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

  .search-filters {
    flex-direction: column;
  }
}
