/**
 * ============================================================
 * Workspace Page Styles — StudyHub
 * Personal Workspace: Repository, Starred, Search
 * ============================================================
 */

/* ── Navbar: Base Styles for Workspace Page ───────────────── */
.workspace-page .navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height, 64px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.workspace-page .navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  padding: 0 24px;
  height: 100%;
}

.workspace-page .navbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 20px;
  color: #1a1a1a;
  text-decoration: none;
}

.workspace-page .navbar__logo-icon {
  width: 32px;
  height: 32px;
}

/* ── Navbar: Nav Links (for workspace page with full navbar) ─ */
.workspace-page .navbar__links {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

.workspace-page .navbar__link {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
  padding: var(--spacing-xs) 0;
}

.workspace-page .navbar__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.workspace-page .navbar__link:hover {
  color: var(--color-text-primary);
}

.workspace-page .navbar__link:hover::after {
  width: 100%;
}

/* Active link state - shows current page */
.workspace-page .navbar__link--active {
  color: var(--color-accent-primary);
  font-weight: 600;
}

.workspace-page .navbar__link--active::after {
  width: 100%;
}

/* ── Navbar: Actions ─ */
.workspace-page .navbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.workspace-page .navbar__user-email {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.workspace-page .navbar__login-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #0071e3, #00a2ff);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.workspace-page .navbar__login-btn:hover {
  transform: scale(1.05);
}

/* ── Navbar: Back Button (legacy, kept for compatibility) ─ */
.workspace-page .navbar__back {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs, 0.5rem);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-text-secondary, #666);
  text-decoration: none;
  padding: var(--spacing-xs, 0.5rem) var(--spacing-sm, 0.75rem);
  border-radius: var(--radius-md, 10px);
  transition: color 0.2s, background 0.2s;
}

.workspace-page .navbar__back:hover {
  color: var(--color-text-primary, #1a1a1a);
  background: rgba(0, 0, 0, 0.04);
}

.workspace-page .navbar__back svg {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.workspace-page .navbar__back:hover svg {
  transform: translateX(-3px);
}

/* Hide back text on very narrow screens */
@media (max-width: 480px) {
  .workspace-page .navbar__back-text {
    display: none;
  }
}

/* ── Navbar: Language Switcher ─ */
.workspace-page .navbar__lang {
  position: relative;
}

.workspace-page .navbar__lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.workspace-page .navbar__lang-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.workspace-page .navbar__lang-flag {
  font-size: 16px;
}

.workspace-page .navbar__lang-arrow {
  font-size: 10px;
}

.workspace-page .navbar__lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--color-bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  z-index: 100;
}

.workspace-page .navbar__lang-dropdown.is-open {
  opacity: 1;
  visibility: visible;
}

.workspace-page .navbar__lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.workspace-page .navbar__lang-option:hover {
  background: rgba(0, 0, 0, 0.04);
}

.workspace-page .navbar__lang-option.is-active {
  background: rgba(0, 113, 227, 0.08);
}

/* ── Navbar: Hamburger Menu ─ */
.workspace-page .navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  gap: 5px;
}

.workspace-page .navbar__toggle-bar {
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.workspace-page .navbar__toggle.active .navbar__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.workspace-page .navbar__toggle.active .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}

.workspace-page .navbar__toggle.active .navbar__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 767px) {
  .workspace-page .navbar__toggle {
    display: flex;
  }
  
  .workspace-page .navbar__links {
    display: none;
  }
  
  .workspace-page .navbar__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-height, 64px);
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
}

/* ── Main Container ───────────────────────────────────────── */
.workspace-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--navbar-height) + var(--spacing-3xl) + 1rem) 1.5rem 4rem;
}

/* ── Page Header ──────────────────────────────────────────── */
.workspace-header {
  text-align: center;
  margin-bottom: 2rem;
}

.workspace-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0 0 0.5rem;
}

.workspace-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
}

/* ── Search Bar ───────────────────────────────────────────── */
.workspace-search {
  margin-bottom: 2rem;
}

.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary, #999);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 1rem 3rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--color-border, #e5e5e5);
  border-radius: 12px;
  background: var(--color-bg-primary, #fff);
  color: var(--color-text-primary, #1a1a1a);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder {
  color: var(--color-text-secondary, #999);
}

.search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--color-text-secondary, #999);
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.search-clear:hover {
  color: var(--color-text-primary, #1a1a1a);
  background: var(--color-bg-secondary, #f5f5f5);
}

/* ── Tab Navigation ───────────────────────────────────────── */
.workspace-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--color-border, #e5e5e5);
  padding-bottom: 0;
}

.workspace-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-text-secondary, #666);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.workspace-tab:hover {
  color: var(--color-text-primary, #1a1a1a);
}

.workspace-tab.is-active {
  color: var(--color-primary, #2563eb);
  border-bottom-color: var(--color-primary, #2563eb);
}

.workspace-tab svg {
  flex-shrink: 0;
}

/* ── Tab Panels ───────────────────────────────────────────── */
.workspace-panels {
  min-height: 400px;
}

.workspace-panel {
  display: none;
}

.workspace-panel.is-active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Section Title ────────────────────────────────────────── */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0 0 1.5rem;
}

/* ── Upload Section ───────────────────────────────────────── */
.upload-section {
  margin-bottom: 2rem;
}

.upload-area {
  position: relative;
  border: 2px dashed rgba(0, 113, 227, 0.28);
  border-radius: var(--radius-xl, 24px);
  padding: 2.5rem 2rem;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(0, 113, 227, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(0, 113, 227, 0.02) 100%);
  transition:
    border-color 280ms cubic-bezier(0.22, 1, 0.36, 1),
    background 280ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 280ms cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  overflow: hidden;
}

.upload-area::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at 50% 50%, rgba(0, 113, 227, 0.10) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.upload-area:hover {
  border-color: rgba(0, 113, 227, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -14px rgba(0, 113, 227, 0.25);
}

.upload-area:hover::before {
  opacity: 1;
}

.upload-area.drag-over {
  border-style: solid;
  border-color: var(--color-accent-primary, #0071e3);
  background:
    radial-gradient(ellipse at top, rgba(0, 113, 227, 0.10) 0%, transparent 70%),
    linear-gradient(180deg, rgba(0, 113, 227, 0.05) 0%, rgba(88, 86, 214, 0.05) 100%);
  transform: scale(1.005);
  box-shadow: 0 18px 44px -12px rgba(0, 113, 227, 0.32);
}

.upload-area > * {
  position: relative;
  z-index: 1;
}

.upload-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--color-gradient, linear-gradient(135deg, #0071e3, #5856d6));
  color: #fff;
  margin: 0 auto 1.25rem;
  box-shadow: 0 10px 24px -8px rgba(0, 113, 227, 0.45);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.upload-area:hover .upload-icon {
  transform: translateY(-4px) rotate(-3deg);
}

.upload-area.drag-over .upload-icon {
  animation: uploadIconBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes uploadIconBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1.06); }
}

.upload-icon svg {
  width: 30px;
  height: 30px;
}

.upload-text {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.upload-hint {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary, #8a8a8a);
  margin: 0 0 1.25rem;
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--color-gradient, linear-gradient(135deg, #0071e3, #5856d6));
  border: none;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(0, 113, 227, 0.5);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 3;
}

.upload-btn:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 26px -8px rgba(0, 113, 227, 0.55);
}

.upload-btn:active {
  transform: scale(0.97);
}

.upload-btn svg {
  flex-shrink: 0;
}

/* ── Upload Progress ──────────────────────────────────────── */
.upload-progress {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.1);
  animation: progressSlideIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.upload-progress[hidden] {
  display: none;
}

@keyframes progressSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.upload-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.upload-progress__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.upload-progress__spinner {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--color-gradient, linear-gradient(135deg, #0071e3, #5856d6));
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(0, 113, 227, 0.45);
  transition: background 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.upload-progress__spinner svg {
  width: 16px;
  height: 16px;
}

.upload-progress__spinner-arc {
  transform-origin: 12px 12px;
  animation: progressSpin 1.1s linear infinite;
}

.upload-progress__spinner-check,
.upload-progress__spinner-x {
  display: none;
}

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

.upload-progress.is-done .upload-progress__spinner {
  background: linear-gradient(135deg, #34c759, #00b341);
  box-shadow: 0 4px 12px -3px rgba(52, 199, 89, 0.45);
}
.upload-progress.is-done .upload-progress__spinner-arc { display: none; }
.upload-progress.is-done .upload-progress__spinner-check {
  display: block;
  animation: progressIconPop 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upload-progress.is-error .upload-progress__spinner {
  background: linear-gradient(135deg, #ff3b30, #ff6b6b);
  box-shadow: 0 4px 12px -3px rgba(255, 59, 48, 0.45);
}
.upload-progress.is-error .upload-progress__spinner-arc { display: none; }
.upload-progress.is-error .upload-progress__spinner-x {
  display: block;
  animation: progressIconPop 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes progressIconPop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.upload-progress__text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.upload-progress__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}

.upload-progress__count {
  font-size: 0.75rem;
  color: var(--color-text-tertiary, #8a8a8a);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress__count:empty {
  display: none;
}

.upload-progress__percent {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--color-gradient, linear-gradient(135deg, #0071e3, #5856d6));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.02em;
  transition: opacity 200ms ease;
}

.upload-progress.is-done .upload-progress__percent {
  background: linear-gradient(135deg, #34c759, #00b341);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.upload-progress.is-error .upload-progress__percent {
  background: linear-gradient(135deg, #ff3b30, #ff6b6b);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-bar {
  position: relative;
  height: 8px;
  background: rgba(0, 113, 227, 0.08);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  background: var(--color-gradient, linear-gradient(135deg, #0071e3, #5856d6));
  border-radius: var(--radius-full, 9999px);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1),
              background 280ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  animation: progressShimmer 1.4s linear infinite;
}

@keyframes progressShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.upload-progress.is-done .progress-fill {
  background: linear-gradient(135deg, #34c759, #00b341);
}

.upload-progress.is-done .progress-fill::after {
  animation: none;
  opacity: 0;
}

.upload-progress.is-error .progress-fill {
  background: linear-gradient(135deg, #ff3b30, #ff6b6b);
}

.upload-progress.is-error .progress-fill::after {
  animation: none;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill::after,
  .upload-progress__spinner-arc {
    animation: none !important;
  }
  .upload-progress,
  .upload-area .upload-icon {
    animation: none !important;
    transition: none !important;
  }
  .progress-fill {
    transition: none !important;
  }
}

/* ── Files Grid ───────────────────────────────────────────── */
.files-section {
  margin-top: 2rem;
}

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

.files-empty,
.starred-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-secondary, #999);
}

.files-empty svg,
.starred-empty svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.files-empty p,
.starred-empty p {
  font-size: 1.125rem;
  margin: 0;
}

.starred-hint {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ── File Card ────────────────────────────────────────────── */
.file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg-primary, #fff);
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 12px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.file-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.file-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary, #f5f5f5);
  border-radius: 8px;
  color: var(--color-primary, #2563eb);
}

.file-icon.pdf { color: #e53e3e; }
.file-icon.docx { color: #3182ce; }
.file-icon.txt { color: #38a169; }
.file-icon.image { color: #d69e2e; }

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.8125rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.file-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 8px;
  color: var(--color-text-secondary, #666);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.file-action-btn:hover {
  color: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.05);
}

.file-action-btn.delete:hover {
  color: #e53e3e;
  border-color: #e53e3e;
  background: rgba(229, 62, 62, 0.05);
}

/* ── Starred Grid ─────────────────────────────────────────── */
.starred-section {
  margin-top: 2rem;
}

.starred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* ── Starred Card ─────────────────────────────────────────── */
.starred-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-bg-primary, #fff);
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 12px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.starred-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.starred-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 8px;
  color: #fff;
}

.starred-info {
  flex: 1;
  min-width: 0;
}

.starred-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0 0 0.25rem;
}

.starred-date {
  font-size: 0.8125rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
}

.starred-actions {
  display: flex;
  gap: 0.5rem;
}

.starred-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 8px;
  color: var(--color-text-secondary, #666);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.starred-action-btn:hover {
  color: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.05);
}

.starred-action-btn.remove:hover {
  color: #e53e3e;
  border-color: #e53e3e;
  background: rgba(229, 62, 62, 0.05);
}

/* ── Search Results ───────────────────────────────────────── */
.search-results {
  margin-top: 1rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg-primary, #fff);
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: var(--color-bg-secondary, #f5f5f5);
}

.search-result-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary, #f5f5f5);
  border-radius: 8px;
  color: var(--color-primary, #2563eb);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0 0 0.25rem;
}

.search-result-type {
  font-size: 0.8125rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
}

/* ── Responsive ───────────────────────────────────────────── */

/* Small Mobile (320px - 479px) */
@media (max-width: 479px) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 1rem) 0.5rem 2.5rem;
  }

  .workspace-header {
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .workspace-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .workspace-subtitle {
    font-size: 0.875rem;
    text-align: center;
  }

  .workspace-search {
    width: 100%;
  }

  .workspace-search-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .workspace-tabs {
    flex-direction: column;
    align-items: stretch;
    border-bottom: none;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .workspace-tab {
    justify-content: center;
    padding: 0.75rem;
    border-bottom: none;
    border: 2px solid var(--color-border, #e5e5e5);
    border-radius: 8px;
    font-size: 0.875rem;
  }

  .workspace-tab.is-active {
    border-color: var(--color-primary, #2563eb);
    background: rgba(37, 99, 235, 0.05);
  }

  .workspace-content {
    padding: 0.5rem;
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .file-card,
  .starred-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .file-icon,
  .starred-icon {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }

  .file-info,
  .starred-info {
    width: 100%;
  }

  .file-name,
  .starred-name {
    font-size: 0.875rem;
  }

  .file-meta,
  .starred-meta {
    font-size: 0.75rem;
  }

  .file-actions,
  .starred-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.25rem;
    gap: 0.25rem;
  }

  .file-action-btn,
  .starred-action-btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  .workspace-empty {
    padding: 2rem 0.5rem;
  }

  .workspace-empty-icon {
    font-size: 2.5rem;
  }

  .workspace-empty-title {
    font-size: 1rem;
  }

  .workspace-empty-desc {
    font-size: 0.875rem;
  }

  .search-results {
    padding: 0.5rem;
  }

  .search-result-item {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .search-result-icon {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }

  .search-result-name {
    font-size: 0.875rem;
  }

  .search-result-type {
    font-size: 0.75rem;
  }
}

/* Mobile (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 1.5rem) 1rem 3rem;
  }

  .workspace-title {
    font-size: 2rem;
  }

  .workspace-subtitle {
    font-size: 1rem;
  }

  .workspace-tabs {
    flex-direction: column;
    align-items: stretch;
    border-bottom: none;
  }

  .workspace-tab {
    justify-content: center;
    border-bottom: none;
    border: 2px solid var(--color-border, #e5e5e5);
    border-radius: 8px;
    margin-bottom: 0.5rem;
  }

  .workspace-tab.is-active {
    border-color: var(--color-primary, #2563eb);
    background: rgba(37, 99, 235, 0.05);
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: 1fr;
  }

  .file-card,
  .starred-card {
    flex-wrap: wrap;
  }

  .file-actions,
  .starred-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
}

/* Tablet Portrait (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 2rem) 1.5rem 4rem;
  }

  .workspace-title {
    font-size: 2.25rem;
  }

  .workspace-subtitle {
    font-size: 1rem;
  }

  .workspace-tabs {
    gap: 0.5rem;
  }

  .workspace-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .workspace-content {
    padding: 1rem 1.5rem;
  }
}

/* Tablet Landscape / Small Desktop (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 2rem) 2rem 4rem;
  }

  .workspace-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .workspace-title {
    font-size: 2.5rem;
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .workspace-content {
    padding: 1.5rem 2rem;
  }
}

/* Desktop (1280px - 1439px) */
@media (min-width: 1280px) and (max-width: 1439px) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 2.5rem) 2.5rem 4rem;
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .workspace-content {
    padding: 1.5rem 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 3rem) 3rem 5rem;
  }

  .workspace-header {
    max-width: 1400px;
    margin: 0 auto 2rem;
  }

  .workspace-title {
    font-size: 2.75rem;
  }

  .workspace-subtitle {
    font-size: 1.125rem;
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .workspace-content {
    padding: 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Extra Large Desktop (1920px+) */
@media (min-width: 1920px) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 3.5rem) 4rem 6rem;
  }

  .workspace-header {
    max-width: 1600px;
  }

  .workspace-title {
    font-size: 3rem;
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }

  .workspace-content {
    max-width: 1600px;
  }
}

/* Landscape orientation for mobile/tablet */
@media (max-width: 1023px) and (orientation: landscape) {
  .workspace-main {
    padding: calc(var(--navbar-height) + 1rem) 1rem 2rem;
  }

  .workspace-header {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .workspace-title {
    font-size: 1.75rem;
  }

  .workspace-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .workspace-tab {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
  }

  .files-grid,
  .starred-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .file-icon,
  .starred-icon,
  .search-result-icon {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .loading-spinner {
    animation: none;
  }
}

/* ── Loading State ────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border, #e5e5e5);
  border-top-color: var(--color-primary, #2563eb);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Upload Section Responsive Tweaks ─────────────────────── */
@media (max-width: 767px) {
  .upload-area {
    padding: 2rem 1.25rem;
    border-radius: 18px;
  }
  .upload-icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    margin-bottom: 1rem;
  }
  .upload-icon svg {
    width: 26px;
    height: 26px;
  }
  .upload-text {
    font-size: 0.9375rem;
  }
  .upload-hint {
    font-size: 0.75rem;
  }
  .upload-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
  }
  .upload-progress {
    padding: 0.875rem 1rem;
    border-radius: 14px;
  }
  .upload-progress__spinner {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }
  .upload-progress__spinner svg {
    width: 14px;
    height: 14px;
  }
  .upload-progress__title {
    font-size: 0.8125rem;
  }
  .upload-progress__count {
    font-size: 0.7rem;
  }
  .upload-progress__percent {
    font-size: 0.875rem;
  }
}

@media (max-width: 479px) {
  .upload-area {
    padding: 1.5rem 1rem;
  }
  .upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }
  .upload-icon svg {
    width: 22px;
    height: 22px;
  }
  .upload-btn {
    width: 100%;
    justify-content: center;
  }
  .upload-progress {
    padding: 0.75rem 0.875rem;
  }
  .upload-progress__header {
    margin-bottom: 0.625rem;
  }
}

/* ── Toast Customization ──────────────────────────────────── */
.toast-container {
  z-index: 9999;
}