/* ==========================================================================
   SAURUS STUDIO ULTRA - CYBER OBSIDIAN / ASTRALUNE DESIGN SYSTEM
   Domain: enc.saurus.qzz.io
   ========================================================================== */

:root {
  --bg-deep: #060807;
  --bg-surface: #0c0f0d;
  --bg-panel: #111513;
  --bg-editor: #080b09;
  --border-subtle: #1c2621;
  --border-hover: #2a3a32;
  --border-active: #00fa9a;
  
  --neon-green: #00fa9a;
  --neon-glow: rgba(0, 250, 154, 0.22);
  --neon-subtle: rgba(0, 250, 154, 0.08);
  --neon-dark: #00b070;
  
  --text-main: #f2f7f4;
  --text-muted: #83968d;
  --text-dim: #44544d;
  --text-accent: #00fa9a;

  --accent-cyan: #38bdf8;
  --accent-yellow: #eab308;
  --accent-red: #ef4444;

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Geist Mono', monospace;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(0, 250, 154, 0.07) 0%, transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(0, 250, 154, 0.03) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-deep) 0%, #040505 100%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-dark);
}

/* Container */
.app-container {
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 7, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 250, 154, 0.15), rgba(0, 250, 154, 0.03));
  border: 1px solid rgba(0, 250, 154, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-green);
  box-shadow: 0 0 16px var(--neon-glow);
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text h1 span {
  color: var(--neon-green);
  text-shadow: 0 0 10px var(--neon-glow);
}

.brand-text .subtext {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shield-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 250, 154, 0.08);
  border: 1px solid rgba(0, 250, 154, 0.28);
  border-radius: var(--radius-lg);
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-green);
}

.pulsing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

/* Main Area */
.main-content {
  flex: 1;
  padding: 20px 0 40px;
}

/* Control Hub: Language Tabs & Protection Config */
.control-hub {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

/* Language Switcher */
.lang-selector-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  scrollbar-width: none;
}
.lang-selector-strip::-webkit-scrollbar {
  display: none;
}

.lang-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.lang-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.lang-tab.active {
  background: var(--neon-subtle);
  border-color: rgba(0, 250, 154, 0.35);
  color: var(--neon-green);
  box-shadow: 0 0 16px var(--neon-glow);
}

.lang-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  opacity: 0.8;
}

/* Secondary Toolbar: Levels & Extra Options */
.toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.level-button-group {
  display: flex;
  gap: 4px;
  background: var(--bg-deep);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.level-btn {
  padding: 5px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.level-btn:hover {
  color: var(--text-main);
}

.level-btn.active {
  background: rgba(0, 250, 154, 0.12);
  color: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-glow);
}

.tag-input-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}
.tag-prefix {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 600;
}
.tag-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--neon-green);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  width: 80px;
}
.tag-input:focus {
  color: #ffffff;
}

.safe-guarantee-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 250, 154, 0.04);
  border: 1px solid rgba(0, 250, 154, 0.15);
}

.safe-guarantee-pill svg {
  color: var(--neon-green);
}

/* Responsive Mobile Tab Bar for Dual Editor */
.mobile-view-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.mobile-view-btn {
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.mobile-view-btn.active {
  background: var(--neon-subtle);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

/* Dual Editor Workspace */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 992px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .mobile-view-tabs {
    display: grid;
  }
  .editor-pane-output.mobile-hidden {
    display: none !important;
  }
  .editor-pane-input.mobile-hidden {
    display: none !important;
  }
  .center-action-bridge {
    flex-direction: row !important;
    padding: 6px 0 !important;
  }
}

/* Editor Pane Container */
.editor-pane {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s ease;
}

.editor-pane:focus-within {
  border-color: rgba(0, 250, 154, 0.4);
}

/* Top bar of pane */
.pane-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(14, 18, 16, 0.95);
  border-bottom: 1px solid var(--border-subtle);
}

.pane-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-green);
}

.pane-toolset {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.tool-btn.highlight {
  border-color: rgba(0, 250, 154, 0.3);
  color: var(--neon-green);
}

/* Code Editor Body with Line Numbers */
.editor-core {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 480px;
  background: var(--bg-editor);
  overflow: hidden;
}

.line-numbers-gutter {
  width: 44px;
  padding: 16px 0;
  background: rgba(6, 8, 7, 0.6);
  border-right: 1px solid rgba(28, 38, 33, 0.6);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: right;
  padding-right: 10px;
  user-select: none;
  overflow: hidden;
}

.code-field {
  flex: 1;
  padding: 16px 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  resize: none;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
}

.code-field::placeholder {
  color: var(--text-dim);
}

/* Pane Footer Bar */
.pane-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(10, 13, 11, 0.9);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.stat-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Center Action Bridge */
.center-action-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
}

.encrypt-trigger-btn {
  background: linear-gradient(135deg, #00fa9a 0%, #00d27f 100%);
  color: #050806;
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 25px var(--neon-glow);
  transition: var(--transition);
  min-width: 130px;
}

.encrypt-trigger-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(0, 250, 154, 0.45);
}

.encrypt-trigger-btn:active {
  transform: translateY(0) scale(0.98);
}

.encrypt-trigger-btn.processing {
  opacity: 0.8;
  pointer-events: none;
}

.btn-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-shortcut {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.75;
  font-family: var(--font-mono);
}

/* Result Stats Banner */
.stats-strip {
  margin-top: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--neon-green);
  font-family: var(--font-mono);
}

/* Bottom Information Grid */
.info-section {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
}

.info-card:hover {
  border-color: rgba(0, 250, 154, 0.3);
  transform: translateY(-2px);
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--neon-subtle);
  color: var(--neon-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Floating Toast */
.toast-shelf {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: #0f1412;
  border: 1px solid var(--neon-green);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px var(--neon-glow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast-msg.error {
  border-color: var(--accent-red);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(239, 68, 68, 0.2);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Loading Spinner */
.spin-anim {
  animation: spinKey 1s linear infinite;
}
@keyframes spinKey {
  100% { transform: rotate(360deg); }
}
