/* ===========================
   GOshare – Dashboard Styles
   =========================== */

/* ── Layout ── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 70px;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-dark);
  border-right: 1px solid var(--bg-border);
  position: fixed;
  top: 70px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 4px; }

.sidebar-inner {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 16px 12px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}

.sidebar-link .link-icon {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link .link-badge {
  margin-left: auto;
  background: rgba(0,200,83,0.15);
  color: var(--green-400);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--glass-bg);
  color: var(--green-400);
}

.sidebar-link.active {
  background: rgba(0,200,83,0.12);
  border: 1px solid rgba(0,200,83,0.2);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 3px;
  background: var(--grad-green);
  border-radius: 0 2px 2px 0;
}

/* Storage Indicator */
.sidebar-storage {
  padding: 16px;
  border-top: 1px solid var(--bg-border);
  margin-top: auto;
}

.storage-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.storage-label span:first-child { color: var(--text-secondary); }
.storage-label span:last-child  { color: var(--green-400); font-weight: 600; }

.sidebar-storage.premium .storage-fill {
  background: linear-gradient(90deg, #ffd700, #ff8f00) !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}
.sidebar-storage.premium .storage-label span:last-child {
  color: #ffd700 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4) !important;
}
.sidebar-storage.premium [data-storage-max] {
  color: #ffd700 !important;
  font-weight: 700 !important;
}

.storage-bar {
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.storage-fill {
  height: 100%;
  background: var(--grad-green);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}
.storage-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

.storage-upgrade {
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  padding: 8px;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  min-height: calc(100vh - 70px);
}

/* ── Dashboard Header ── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-title h1 {
  font-size: 1.6rem;
  font-weight: 700;
}
.dash-title p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

.dash-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search */
.search-wrap {
  position: relative;
}
.search-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-full);
  padding: 10px 16px 10px 40px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  width: 240px;
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--green-500);
  background: rgba(0,200,83,0.06);
  width: 300px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 var(--radius-lg) 0 80px;
  opacity: 0.05;
}
.stat-card.green::before  { background: var(--green-400); }
.stat-card.diamond::before { background: var(--diamond-400); }

.stat-card:hover { border-color: rgba(0,200,83,0.3); transform: translateY(-3px); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.stat-icon.green   { background: rgba(0,200,83,0.15); color: var(--green-400); }
.stat-icon.diamond { background: rgba(77,208,225,0.15); color: var(--diamond-400); }
.stat-icon.orange  { background: rgba(255,152,0,0.15); color: #FF9800; }
.stat-icon.purple  { background: rgba(156,39,176,0.15); color: #9C27B0; }

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { color: var(--text-muted); font-size: 0.85rem; }
.stat-change {
  margin-top: 8px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up   { color: var(--green-400); }
.stat-change.down { color: #ef5350; }

/* ── Upload Zone ── */
.upload-section { margin-bottom: 32px; }

.upload-zone {
  border: 2px dashed rgba(0, 200, 83, 0.3);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  background: rgba(0, 200, 83, 0.02);
}
.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--green-500);
  background: rgba(0, 200, 83, 0.06);
  box-shadow: 0 0 40px rgba(0,200,83,0.15) inset;
}

.upload-icon {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  background: rgba(0,200,83,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  border: 2px solid rgba(0,200,83,0.2);
  transition: var(--transition);
}
.upload-zone:hover .upload-icon,
.upload-zone.dragging .upload-icon {
  background: rgba(0,200,83,0.2);
  transform: scale(1.1);
}

.upload-text h3 { font-size: 1.1rem; margin-bottom: 6px; }
.upload-text p  { color: var(--text-muted); font-size: 0.9rem; }

.upload-input { display: none; }

.upload-types {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.upload-type {
  padding: 4px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Upload Progress */
.upload-progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.upload-progress-item {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.upload-file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.upload-file-info { flex: 1; min-width: 0; }
.upload-file-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-file-size { color: var(--text-muted); font-size: 0.8rem; }
.upload-file-progress { height: 4px; margin-top: 8px; }
.upload-pct { font-size: 0.8rem; color: var(--green-400); font-weight: 600; flex-shrink: 0; }

/* ── Toolbar ── */
.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.view-toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.view-btn {
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}
.view-btn.active,
.view-btn:hover {
  background: rgba(0,200,83,0.15);
  color: var(--green-400);
}

/* ── File Grid ── */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  group: true;
}
.file-card:hover {
  border-color: rgba(0,200,83,0.3);
  background: var(--bg-card2);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.file-card-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--bg-border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.file-card:hover .file-card-checkbox,
.file-card.selected .file-card-checkbox { opacity: 1; }
.file-card.selected .file-card-checkbox {
  background: var(--green-500);
  border-color: var(--green-500);
}

.file-card-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-card2);
  border: 1px solid var(--bg-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
  font-size: 0.85rem;
}
.file-card:hover .file-card-menu { opacity: 1; }

.file-card-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
  transition: var(--transition);
}
.file-card:hover .file-card-icon { transform: scale(1.1); }

.file-card-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.file-card-meta { color: var(--text-muted); font-size: 0.75rem; }

/* ── File List ── */
.files-list { display: none; flex-direction: column; gap: 8px; }
.files-list.active { display: flex; }
.files-grid.active { display: grid; }

.file-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}
.file-list-item:hover {
  border-color: rgba(0,200,83,0.25);
  background: var(--bg-card2);
}
.file-list-icon { font-size: 1.5rem; flex-shrink: 0; }
.file-list-name { flex: 1; font-size: 0.92rem; font-weight: 500; }
.file-list-size  { color: var(--text-muted); font-size: 0.85rem; width: 80px; text-align: right; }
.file-list-date  { color: var(--text-muted); font-size: 0.85rem; width: 100px; text-align: right; }
.file-list-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: var(--transition);
}
.file-list-item:hover .file-list-actions { opacity: 1; }

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-card2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 6px;
  z-index: 3000;
  min-width: 180px;
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.15s ease;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.context-menu-item:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}
.context-menu-item.danger { color: #ef5350; }
.context-menu-item.danger:hover { background: rgba(239,83,80,0.1); }
.context-menu-divider { height: 1px; background: var(--bg-border); margin: 4px 0; }

/* ── Responsive Dashboard ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search-input { width: 160px; }
  .search-input:focus { width: 200px; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .files-grid { grid-template-columns: repeat(2, 1fr); }
  .file-list-size, .file-list-date { display: none; }
}
