/* ZipKop - Custom Premium Styling Sheet */

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Color Palette - Vibrant Dark Theme with Warm Orange accents */
  --bg-deep: #06090e;
  --bg-card: rgba(12, 17, 28, 0.6);
  --bg-card-hover: rgba(18, 25, 42, 0.75);
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glass-focused: rgba(249, 115, 22, 0.4);
  
  --primary-start: #f97316; /* Warm Orange */
  --primary-end: #ea580c;   /* Deep Orange */
  --accent: #6366f1;        /* Indigo */
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --shadow-glow: 0 0 25px rgba(249, 115, 22, 0.15);
  --shadow-glow-large: 0 0 50px rgba(249, 115, 22, 0.25);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Background Blobs */
.glass-bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.2;
  mix-blend-mode: screen;
  animation: float-around 22s infinite alternate ease-in-out;
}

.blob-1 {
  width: 550px;
  height: 550px;
  background: var(--primary-start);
  top: -10%;
  left: 15%;
  animation-duration: 18s;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: var(--accent);
  bottom: -5%;
  right: 10%;
  animation-duration: 25s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: #ec4899; /* Pink */
  top: 35%;
  left: 45%;
  animation-duration: 20s;
}

@keyframes float-around {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.1); }
  100% { transform: translate(40px, -30px) scale(0.9); }
}

/* App Container */
.app-container {
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
}

/* Header */
.app-header {
  margin-bottom: 25px;
  text-align: center;
}

.logo-area {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  box-shadow: var(--shadow-glow);
  transform: rotate(-3deg);
  transition: var(--transition-normal);
}

.logo-icon:hover {
  transform: rotate(0deg) scale(1.08);
  box-shadow: var(--shadow-glow-large);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 30%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 3px;
  font-weight: 400;
}

/* Privacy Banner */
.privacy-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fade-in-up 0.5s ease-out;
}

.privacy-icon {
  font-size: 20px;
  color: var(--success);
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.privacy-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
}

.privacy-text strong {
  color: var(--text-primary);
}

/* General Glass Cards */
.card {
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 30px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card.hidden {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.card.active {
  display: block;
  animation: fade-in-up 0.5s var(--transition-normal) forwards;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Drag & Drop Zone */
.drop-zone {
  border: 2px dashed rgba(249, 115, 22, 0.3);
  border-radius: 16px;
  padding: 60px 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  background: rgba(249, 115, 22, 0.01);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary-start);
  background: rgba(249, 115, 22, 0.04);
  box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.03);
}

.file-input-hidden {
  display: none;
}

.upload-icon-container {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: var(--transition-normal);
  color: var(--text-secondary);
}

.drop-zone:hover .upload-icon-container {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.2);
  color: var(--text-primary);
  transform: translateY(-4px);
}

.upload-icon {
  font-size: 24px;
  background: linear-gradient(135deg, #ffedd5, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.drop-zone h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.drop-zone p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff8432, #f96316);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-browse {
  pointer-events: none; /* bubble up click to dropzone */
}

/* Loading Panel */
.processing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  text-align: center;
}

.spinner-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(249, 115, 22, 0.1);
  border-top-color: var(--primary-start);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

.spinner-ring-inner {
  position: absolute;
  width: 80%;
  height: 80%;
  border: 4px solid rgba(99, 102, 241, 0.05);
  border-bottom-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.4s infinite linear reverse;
}

.processing-logo {
  font-size: 26px;
  color: var(--text-primary);
  animation: pulse-soft 2.5s infinite ease-in-out;
  z-index: 1;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-soft {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 1; }
}

.processing-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.processing-subtitle {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 24px;
}

.progress-bar-container {
  width: 100%;
  max-width: 350px;
  height: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.01);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-start), var(--accent));
  border-radius: 10px;
  transition: width 0.3s ease-out;
}

.progress-percentage {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-start);
}

/* Step 3: Explorer Card Layout */
.explorer-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px;
}

.archive-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.archive-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary-start);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.archive-details h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.archive-details p {
  font-size: 12px;
  color: var(--text-secondary);
}

.explorer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0 14px;
  flex-grow: 1;
  max-width: 400px;
  height: 38px;
  transition: var(--transition-fast);
  position: relative;
}

.search-wrapper:has(input:focus) {
  border-color: var(--border-glass-focused);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.08);
}

.search-icon {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 10px;
}

.search-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 100%;
  height: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.clear-search-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.toolbar-actions .btn {
  height: 38px;
}

/* Two Column Layout */
.explorer-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  min-height: 400px;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 8px;
}

.explorer-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding-right: 16px;
  display: flex;
  flex-direction: column;
}

.folder-tree-root {
  overflow-y: auto;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Scrollbars */
.folder-tree-root::-webkit-scrollbar, .files-table-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.folder-tree-root::-webkit-scrollbar-track, .files-table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.folder-tree-root::-webkit-scrollbar-thumb, .files-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

/* Folder Tree Nodes */
.tree-node {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  gap: 8px;
  transition: var(--transition-fast);
  user-select: none;
}

.tree-node:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.tree-node.active {
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary-start);
  border-left: 3px solid var(--primary-start);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 7px;
}

.tree-node-icon {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.tree-node.active .tree-node-icon {
  color: var(--primary-start);
}

/* Content Area - Right Panel */
.explorer-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.path-text {
  font-family: monospace;
  color: var(--primary-start);
  text-transform: none;
  font-size: 13.5px;
  background: rgba(259, 115, 22, 0.03);
  padding: 2px 8px;
  border-radius: 6px;
}

.files-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.files-table th, .files-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.files-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  user-select: none;
}

.files-table tbody tr {
  transition: var(--transition-fast);
}

.files-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.files-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary-start);
  cursor: pointer;
}

.file-row-name-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.row-file-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.row-file-icon.folder { color: #f59e0b; }
.row-file-icon.image { color: var(--accent); }
.row-file-icon.pdf { color: var(--error); }
.row-file-icon.code { color: var(--primary-start); }
.row-file-icon.doc { color: #3b82f6; }
.row-file-icon.text { color: var(--text-secondary); }

.file-row-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.file-row-name.clickable-folder {
  cursor: pointer;
}

.file-row-name.clickable-folder:hover {
  color: var(--primary-start);
  text-decoration: underline;
}

.file-row-size {
  color: var(--text-secondary);
}

.file-actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-icon-only {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  font-size: 12px;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 750px;
  max-height: 80vh;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
  text-align: left;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.modal-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.modal-file-icon {
  font-size: 18px;
  color: var(--primary-start);
}

.modal-file-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.modal-body {
  overflow-y: auto;
  max-height: 45vh;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 16px;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
}

/* Modal text file viewer */
.modal-body pre {
  margin: 0;
  font-family: Consolas, Monaco, monospace;
  font-size: 12.5px;
  background: transparent !important; /* overrides Prism */
  border: none !important;
}

/* Modal image viewer */
.modal-image-preview {
  max-width: 100%;
  max-height: 40vh;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Markdown render inside modal */
.modal-markdown-body {
  font-family: -apple-system, sans-serif;
  color: var(--text-primary);
}
.modal-markdown-body h1, .modal-markdown-body h2 { margin-top: 14px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 4px; }
.modal-markdown-body p { margin-bottom: 10px; }
.modal-markdown-body ul, .modal-markdown-body ol { margin-left: 20px; margin-bottom: 10px; }

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.modal-file-size {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Footer info */
.app-footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.app-footer p {
  color: var(--text-muted);
  font-size: 11.5px;
}

/* Responsive Explorer Layout */
@media (max-width: 768px) {
  .explorer-layout {
    grid-template-columns: 1fr;
  }
  .explorer-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-right: 0;
    padding-bottom: 16px;
    max-height: 150px;
  }
  .folder-tree-root {
    max-height: 100px;
  }
  .app-container {
    padding: 20px 10px;
  }
  .card {
    padding: 20px;
  }
}
