@font-face {
  font-family: "GopikaLocal";
  src: url("/assets/Gopika.TTF") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "GopikaAlt";
  src: url("/assets/Gopika.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg-1: #f6f9ff;
  --bg-2: #edf3ff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(115, 149, 229, 0.28);
  --line-strong: rgba(93, 126, 221, 0.44);
  --blue: #2d5bff;
  --blue-deep: #203eb8;
  --green: #8ed8ae;
  --green-deep: #3a9562;
  --text: #0f1e52;
  --muted: #5b6d9b;
  --shadow: 0 28px 90px rgba(83, 111, 194, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 22%, rgba(185, 204, 255, 0.56), transparent 21%),
    radial-gradient(circle at 90% 18%, rgba(216, 226, 255, 0.82), transparent 20%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
}

body::before {
  inset: 9rem auto auto 0;
  width: 28rem;
  height: 18rem;
  background: linear-gradient(210deg, rgba(205, 220, 255, 0.48), rgba(205, 220, 255, 0));
  border-radius: 0 0 18rem 0;
}

body::after {
  inset: 7rem 3rem auto auto;
  width: 7rem;
  height: 7rem;
  background-image: radial-gradient(circle, rgba(91, 136, 255, 0.28) 1.1px, transparent 1.1px);
  background-size: 16px 16px;
  opacity: 0.9;
}

.window-frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar,
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 1.2rem;
}

.brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  color: #1d2745;
}

.brand-mini-mark,
.hero-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(155deg, #335ff8 0%, #4324b8 100%);
  box-shadow: 0 14px 28px rgba(65, 93, 206, 0.22);
}

.brand-mini-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.page-shell {
  width: min(1380px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 0.7rem;
  flex: 1;
}

.hero {
  position: relative;
  text-align: center;
  padding: 0.05rem 1rem 0.85rem;
}

.hero-mark {
  width: 1.9rem;
  height: 1.9rem;
  margin: 0 auto 0.22rem;
  border-radius: 0.45rem;
  font-size: 0.56rem;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.hero h1 span {
  color: var(--blue);
}

.hero-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.9vw, 1.55rem);
  font-weight: 500;
}

.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 0.45rem 0 0.45rem;
}

.hero-divider span {
  width: 5.4rem;
  height: 1px;
  background: rgba(66, 109, 239, 0.42);
}

.hero-divider i {
  width: 0.6rem;
  height: 0.6rem;
  background: var(--blue);
  transform: rotate(45deg);
  border-radius: 0.12rem;
}

.hero-copy {
  margin: 0;
  color: #52658f;
  font-size: 0.95rem;
  line-height: 1.45;
}

.workspace-card {
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  backdrop-filter: blur(20px);
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.tab-button {
  border: 1px solid rgba(95, 123, 216, 0.24);
  border-radius: 999px;
  padding: 0.78rem 1.2rem;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.tab-button:hover {
  transform: translateY(-1px);
}

.tab-button.active {
  border-color: rgba(61, 98, 233, 0.34);
  background: linear-gradient(135deg, rgba(241, 246, 255, 1), rgba(232, 239, 255, 0.92));
  color: var(--blue-deep);
  box-shadow: 0 12px 22px rgba(67, 100, 209, 0.12);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.action-grid,
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.55rem;
}

.action-panel,
.quick-panel {
  min-height: 20.5rem;
  border-radius: 1.7rem;
  background: var(--panel-strong);
  padding: 1.3rem 1.2rem;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.quick-panel {
  min-height: auto;
  text-align: left;
  border: 1px solid rgba(132, 155, 228, 0.26);
}

.upload-panel {
  border: 2px dashed rgba(63, 107, 255, 0.68);
}

.upload-panel.dragging {
  background: rgba(239, 245, 255, 0.98);
  border-color: var(--blue);
}

.download-panel {
  border: 1px solid rgba(127, 212, 162, 0.72);
}

.panel-icon {
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.panel-icon svg,
.security-icon svg {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-icon svg {
  width: 1.8rem;
  height: 1.8rem;
}

.blue-icon {
  background: radial-gradient(circle at 30% 30%, rgba(232, 239, 255, 1), rgba(218, 229, 255, 0.86));
}

.blue-icon svg {
  stroke: var(--blue);
}

.green-icon {
  background: radial-gradient(circle at 30% 30%, rgba(237, 248, 241, 1), rgba(220, 244, 229, 0.88));
}

.green-icon svg {
  stroke: var(--green-deep);
}

.action-panel h2,
.quick-panel h2 {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.panel-copy {
  margin: 0.55rem 0 0.95rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  min-height: 3rem;
  border: none;
  border-radius: 0.95rem;
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16rem;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  box-shadow: 0 18px 30px rgba(53, 92, 240, 0.24);
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.download-button {
  min-width: 16rem;
  color: #fff;
  background: linear-gradient(135deg, #8ed7ab 0%, #7dc8aa 100%);
  box-shadow: 0 18px 30px rgba(124, 190, 151, 0.2);
}

.download-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-button {
  min-width: 9rem;
  background: linear-gradient(180deg, rgba(244, 247, 255, 1), rgba(233, 239, 255, 0.9));
  color: var(--blue-deep);
  border: 1px solid rgba(105, 133, 220, 0.24);
}

.panel-hint,
.file-name,
.status-message {
  color: var(--muted);
}

.panel-hint {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
}

.file-name {
  margin: 0.7rem 0 0;
  min-height: 1.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.status-badge {
  width: min(100%, 21rem);
  margin: 0.95rem auto 0;
  border: 1px solid rgba(127, 212, 162, 0.55);
  border-radius: 1rem;
  padding: 0.7rem 0.85rem;
  background: linear-gradient(180deg, rgba(238, 249, 243, 0.96), rgba(228, 245, 236, 0.9));
  color: #2d8757;
  font-size: 0.9rem;
  line-height: 1.35;
}

.status-badge[data-state="pending"] {
  border-color: rgba(74, 119, 255, 0.34);
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.98), rgba(229, 238, 255, 0.92));
  color: #3152c4;
}

.status-badge[data-state="error"] {
  border-color: rgba(211, 108, 108, 0.34);
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.98), rgba(255, 234, 234, 0.92));
  color: #b24343;
}

.status-message,
.quick-status {
  margin: 0.55rem 0 0;
  min-height: 1.2rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.quick-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.quick-kicker {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.count-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(114, 141, 220, 0.24);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: rgba(245, 248, 255, 0.8);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.quick-textarea {
  width: 100%;
  min-height: 21rem;
  border: 1px solid rgba(133, 160, 235, 0.32);
  border-radius: 1.15rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1.7;
  resize: vertical;
}

.quick-textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(86, 118, 228, 0.08);
}

.legacy-textarea {
  font-family: "GopikaLocal", "GopikaAlt", "Gujarati Sangam MN", sans-serif;
  font-size: 1.45rem;
}

.unicode-textarea {
  font-family: "Noto Sans Gujarati", "Gujarati Sangam MN", "Kohinoor Gujarati", sans-serif;
}

.quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.security-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(128, 161, 241, 0.34);
  border-radius: 1.3rem;
  background: linear-gradient(180deg, rgba(243, 247, 255, 0.95), rgba(236, 242, 255, 0.88));
  padding: 0.8rem 1rem;
}

.security-icon {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.security-icon svg {
  width: 1.7rem;
  height: 1.7rem;
  stroke: var(--blue);
}

.security-strip h3,
.security-strip p {
  margin: 0;
}

.security-strip h3 {
  font-size: 0.95rem;
}

.security-strip p {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-bar {
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dot {
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(91, 109, 155, 0.8);
}

@media (max-width: 1100px) {
  .workspace-card {
    padding: 1.45rem;
  }

  .action-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .action-panel,
  .quick-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100%, calc(100% - 1rem));
  }

  .topbar,
  .footer-bar {
    padding-inline: 1rem;
  }

  .hero {
    padding-inline: 0.2rem;
  }

  .hero h1 {
    font-size: 2.9rem;
  }

  .hero-mark {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.66rem;
  }

  .workspace-card {
    border-radius: 1.45rem;
    padding: 1rem;
  }

  .action-panel,
  .quick-panel {
    padding: 1.35rem 1rem;
    border-radius: 1.25rem;
  }

  .quick-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-textarea {
    min-height: 16rem;
  }

  .primary-button,
  .secondary-button,
  .upload-button,
  .download-button {
    width: 100%;
    min-width: 0;
  }

  .quick-actions {
    justify-content: stretch;
  }
}

@media (max-width: 560px) {
  body::before,
  body::after {
    display: none;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tab-button {
    width: 100%;
  }

  .hero-subtitle {
    font-size: 1.15rem;
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .footer-bar,
  .footer-left,
  .footer-right,
  .security-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    gap: 0.4rem;
  }
}
