/* ============================================================
   SarvTools — My Files Zero-Cloud Vault Workspace Styles
   ============================================================ */

:root {
  --c-surface: var(--surface, #ffffff);
  --c-surface-2: var(--surface-2, #f4f6f9);
  --c-border: var(--border, #d1d5db);
  --c-border-strong: var(--border-strong, #94a3b8);
  --c-text: var(--text-1, #0f172a);
  --c-muted: var(--text-3, #64748b);
  --c-danger: #ef4444;
}

[data-theme="dark"] {
  --c-surface: var(--surface, #151f33);
  --c-surface-2: var(--surface-2, #1e2a44);
  --c-border: var(--border, rgba(255, 255, 255, 0.16));
  --c-border-strong: var(--border-strong, rgba(255, 255, 255, 0.28));
  --c-text: var(--text-1, #ffffff);
  --c-muted: var(--text-3, #94a3b8);
}

.workspace-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--c-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--c-border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.storage-meter-wrap {
  flex: 1;
  min-width: 260px;
}

.storage-meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--c-muted, #888);
  margin-bottom: 0.5rem;
}

.storage-meter-header strong {
  color: var(--c-text, #fff);
}

.storage-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.storage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cloud-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.category-filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-filter-bar::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--c-surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--c-border, rgba(255, 255, 255, 0.1));
  color: var(--c-muted, #aaa);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-btn:hover {
  color: var(--c-text, #fff);
  border-color: rgba(255, 255, 255, 0.25);
}

.cat-btn.active {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.cat-count {
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.search-input-wrap {
  position: relative;
  min-width: 240px;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.3rem;
  border-radius: 999px;
  background: var(--surface-2, #f1f3f7);
  border: 1px solid var(--border, #d1d5db);
  color: var(--text-1, #0f172a) !important;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-input-wrap input::placeholder {
  color: var(--text-3, #64748b);
  opacity: 0.85;
}

.search-input-wrap input:focus {
  outline: none;
  background: var(--surface, #ffffff);
  border-color: var(--accent, #38bdf8);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(56, 189, 248, 0.25));
  color: var(--text-1, #0f172a) !important;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3, #64748b);
  pointer-events: none;
}

.file-cloud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.file-cloud-card {
  background: var(--c-surface, rgba(18, 18, 24, 0.95));
  border: 1px solid var(--c-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.file-cloud-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.file-card-preview {
  height: 130px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--c-border, rgba(255, 255, 255, 0.05));
}

.file-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-type-badge.mobile {
  background: rgba(16, 185, 129, 0.8);
}

.file-card-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.file-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text, #fff);
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-meta {
  font-size: 0.78rem;
  color: var(--c-muted, #888);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.open-with-dropdown-btn {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.open-with-dropdown-btn:hover {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
}

.file-secondary-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-icon-label {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--c-muted, #aaa);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-label:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-danger-icon {
  color: #ef4444 !important;
}

.btn-danger-icon:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Modal for Open With Selection */
.modal-open-with {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-open-content {
  background: #121218;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.tool-launch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  color: #fff;
  text-decoration: none;
}

.tool-launch-item:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(4px);
}

/* Mobile & Tablet Responsive Media Queries */
@media (max-width: 768px) {
  .workspace-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 1.1rem;
    gap: 1rem;
  }
  .workspace-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .cloud-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrap {
    width: 100%;
  }
  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 0.75rem !important;
  }
  .file-card-preview {
    height: 120px !important;
  }
  .modal-open-content {
    padding: 1rem !important;
    max-height: 90vh !important;
  }
}

@media (max-width: 480px) {
  .workspace-actions {
    grid-template-columns: 1fr;
  }
  .files-grid {
    grid-template-columns: 1fr !important;
  }
  .file-card-preview {
    height: 150px !important;
  }
}

/* PC Hard Drive Vault & Drag-and-Drop Enhancements */
.vault-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pc-vault-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  background: var(--c-surface, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--c-border, rgba(255, 255, 255, 0.1));
}

.pc-vault-badge.connected {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.pc-vault-badge code {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 700;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
  display: inline-block;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.vault-btn-link {
  background: none;
  border: none;
  color: var(--c-accent, #6366f1);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vault-btn-link:hover {
  text-decoration: underline;
  background: rgba(255, 255, 255, 0.05);
}

.vault-btn-link.text-primary {
  color: #10b981;
}

.vault-btn-link.text-danger {
  color: #ef4444;
}

.vault-drop-zone {
  position: relative;
  transition: all 0.2s ease-in-out;
  border-radius: 16px;
}

.vault-drop-zone.drag-over {
  outline: 3px dashed #10b981;
  outline-offset: 4px;
  background: rgba(16, 185, 129, 0.04);
}

.file-type-badge.pc-disk {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
}

