/* ═══════════════════════════════════════════
   ShadowDrop — Ultra Minimal Flat UI
   ═══════════════════════════════════════════ */

/* ─── Variables & Tokens ──────────────────── */
:root {
  --bg: #0A0A0A;
  --bg-offset: #111111;
  --surface: #1A1A1A;
  --surface-hover: #222222;
  --border: #333333;
  --border-focus: #444444;

  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --accent: #00DC82;
  /* Volt Green */
  --accent-hover: #00F490;
  --error: #FF3366;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 6px;
  /* Sharp minimal corners */
  --transition: 0.15s ease-out;
  /* Snap-fast transitions */
}

/* ─── Reset ───────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--bg);
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  /* Prevent body scroll for split layout */
}

/* ─── Typography & Utilities ─────────────── */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.fw-medium {
  font-weight: 500;
}

.hidden {
  display: none !important;
}

/* ─── Split Layout ────────────────────────── */
.split-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Left Panel - Branding */
.brand-panel {
  width: 45%;
  background-color: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.brand-content {
  position: relative;
  z-index: 10;
  max-width: 480px;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: auto;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-text-block {
  margin: auto 0;
}

.hero-text-block h2 {
  font-size: clamp(3rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
  line-height: 1.05;
}

.hero-text-block .tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 90%;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.side-footer {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.15;
  z-index: 1;
  mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
}

/* Right Panel - App Wrapper */
.app-panel {
  width: 55%;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  overflow-y: auto;
}

.widget-container {
  width: 100%;
  max-width: 540px;
}

/* ─── Tabs Navigation (Ultra Minimal) ─────── */
.tabs-nav {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.tab-btn {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color var(--transition);
  position: relative;
  z-index: 2;
}

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

.tab-btn.active {
  color: var(--accent);
}

.tab-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background-color: var(--accent);
  width: 33.333%;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.2, 1);
  z-index: 3;
}

/* Tab Active States */
.tabs-nav:has(#tab-text.active) .tab-indicator {
  transform: translateX(0);
}

.tabs-nav:has(#tab-file.active) .tab-indicator {
  transform: translateX(100%);
}

.tabs-nav:has(#tab-retrieve.active) .tab-indicator {
  transform: translateX(200%);
}

/* ─── Panels & Cards ──────────────────────── */
.panels-wrapper {
  position: relative;
}

.panel {
  display: none;
  animation: fadeSlide 0.2s ease-out forwards;
}

.panel.active {
  display: block;
}

.minimal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  /* Flat dark shadow */
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-header h2 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Form Elements (Terminal Style) ──────── */
.input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.minimal-input {
  width: 100%;
  background: var(--bg-offset);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition);
  outline: none;
}

.minimal-input:focus {
  border-color: var(--accent);
}

.minimal-input::placeholder {
  color: var(--text-dim);
}

.text-input-wrapper textarea {
  min-height: 200px;
  resize: vertical;
  font-size: 0.95rem;
  line-height: 1.6;
}

.char-count {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  pointer-events: none;
}

/* Dropzone */
.dropzone {
  border: 1px dashed var(--border-focus);
  background: var(--bg-offset);
  border-radius: var(--radius);
  padding: 3.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1.5rem;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(0, 220, 130, 0.05);
  /* Very subtle tint */
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: color var(--transition);
}

.dropzone:hover .upload-icon,
.dropzone.drag-over .upload-icon {
  color: var(--accent);
}

.dropzone h3 {
  font-size: 1.1rem;
}

/* File Info Box */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-offset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.file-details {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.file-details svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.file-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#fileName {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

#fileSize {
  font-size: 0.8rem;
}

.remove-file-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.remove-file-btn:hover {
  background: rgba(255, 51, 102, 0.1);
  color: var(--error);
}

.remove-file-btn svg {
  width: 16px;
  height: 16px;
}

/* Pin Input Layout */
.code-input-container {
  position: relative;
}

.pin-input {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
}

.pin-input::placeholder {
  letter-spacing: 0.25em;
  font-weight: 400;
}

/* ─── Buttons ─────────────────────────────── */
.action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.primary-btn {
  background: var(--accent);
  color: #000;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  /* No upward translation, pure flat UI */
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.secondary-btn {
  background: var(--bg-offset);
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
}

/* Loading Spinner */
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.action-btn.loading .loading-spinner {
  display: block;
}

.action-btn.loading svg:not(.loading-spinner),
.action-btn.loading span {
  display: none;
}

/* ─── Modals & Overlay (Minimal) ──────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  /* Darker, solid blur less needed */
  animation: fadeIn 0.2s ease-out;
}

.result-modal {
  width: 100%;
  max-width: 480px;
  z-index: 1;
  text-align: left;
  animation: modalEnter 0.2s ease-out;
}

.result-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 220, 130, 0.1);
  color: var(--accent);
}

.result-icon svg {
  width: 20px;
  height: 20px;
}

.result-modal h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.result-modal p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Code Output */
.clipboard-group {
  margin-bottom: 2rem;
}

.result-code-large {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: var(--bg-offset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition);
}

.result-code-large:hover {
  border-color: var(--accent);
}

/* Text Output */
.retrieved-text-box {
  background: var(--bg-offset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

/* ─── Toasts (Flat) ───────────────────────── */
.toast-board {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  pointer-events: auto;
  width: 380px;
  animation: toastSlide 0.2s ease-out;
}

.toast.toast-out {
  animation: toastSlideOut 0.2s ease-out forwards;
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: var(--accent);
}

.toast-error .toast-icon {
  color: var(--error);
}

.toast-info .toast-icon {
  color: #3B82F6;
}

/* ─── Keyframes ───────────────────────────── */
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.5;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ─── Responsive (Split to Stacked) ──────── */
@media (max-width: 900px) {
  .split-layout {
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body {
    overflow: visible;
  }

  .brand-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 3rem 1.5rem;
    min-height: auto;
  }

  .brand-content {
    padding: 0;
    max-width: 100%;
  }

  .hero-text-block {
    margin: 2.5rem 0;
  }

  .side-footer {
    display: none;
  }

  /* Hide on mobile to save space */

  .app-panel {
    width: 100%;
    padding: 2.5rem 1.5rem;
    overflow: visible;
  }

  .tabs-nav {
    margin-bottom: 1.5rem;
  }

  .tab-btn {
    padding: 0.75rem 1rem;
    flex: 1;
    text-align: center;
  }

  .minimal-card {
    padding: 1.5rem;
  }

  .toast-board {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .hero-text-block h2 {
    font-size: 2.5rem;
  }

  .hero-text-block .tagline {
    max-width: 100%;
    font-size: 1rem;
    word-break: break-word;
    /* Ensure it breaks rather than overflowing */
  }

  .logo-text {
    font-size: 1.4rem;
  }

  .tabs-nav {
    flex-wrap: wrap;
    border-bottom: none;
  }

  .tab-btn {
    flex: 1 1 33%;
    padding: 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
  }

  .tab-indicator {
    display: none;
  }

  .tab-btn.active {
    border-bottom: 2px solid var(--accent);
  }

  .action-btn {
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
  }

  .result-code-large {
    font-size: 2rem;
    letter-spacing: 0.15em;
    padding: 0.85rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .pin-input {
    font-size: 1.8rem;
    letter-spacing: 0.3em;
    padding: 1rem;
  }
}