/* ============================================
   CloudKu — Backup Center & Wizard Styles
   Premium dark glassmorphism theme
   ============================================ */

/* === BACKUP MODAL === */
.modal-backup {
  max-width: 900px;
  width: 95vw;
  max-height: 90vh;
}

.modal-backup .modal-body {
  overflow-y: auto;
  max-height: calc(90vh - 140px);
  padding: 24px;
}

/* === DISK USAGE HERO === */
.disk-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.disk-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.disk-chart-container {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.disk-chart-container canvas {
  width: 100%;
  height: 100%;
}

.disk-chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.disk-chart-percent {
  font-size: 28px;
  font-weight: 800;
  color: #f87171;
  line-height: 1;
}

.disk-chart-label {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
}

.disk-info-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.disk-info-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.disk-info-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(139, 92, 246, 0.3);
}

.disk-info-card .info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 4px;
}

.disk-info-card .info-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
}

.disk-info-card .info-value.text-danger {
  color: #f87171;
}

.disk-info-card .info-value.text-emerald {
  color: #34d399;
}

.disk-info-card .info-value.text-purple {
  color: #a78bfa;
}

.disk-info-card .info-value.text-amber {
  color: #fbbf24;
}

/* === SCAN CONTROLS === */
.scan-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.scan-controls .btn {
  min-width: 160px;
}

.scan-status-text {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.scan-status-text i {
  animation: spin 1s linear infinite;
}

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

/* === CATEGORY BREAKDOWN === */
.category-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.category-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.category-chip.active {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.1);
}

.category-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.category-chip-info {
  overflow: hidden;
}

.category-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-chip-meta {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* === FILE TABLE === */
.backup-file-table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.backup-file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.backup-file-table thead {
  background: rgba(255, 255, 255, 0.04);
  position: sticky;
  top: 0;
  z-index: 1;
}

.backup-file-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.backup-file-table th.col-check {
  width: 40px;
  text-align: center;
}

.backup-file-table th.col-size {
  width: 100px;
  text-align: right;
}

.backup-file-table th.col-cat {
  width: 80px;
  text-align: center;
}

.backup-file-table th.col-status {
  width: 100px;
  text-align: center;
}

.backup-file-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease;
}

.backup-file-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.backup-file-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.backup-file-table tbody tr:nth-child(even):hover {
  background: rgba(255, 255, 255, 0.05);
}

.backup-file-table td {
  padding: 10px 14px;
  color: var(--text-primary, #e2e8f0);
  vertical-align: middle;
}

.backup-file-table td.col-check {
  text-align: center;
}

.backup-file-table td.col-size {
  text-align: right;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.backup-file-table td.col-cat {
  text-align: center;
}

.backup-file-table td.col-status {
  text-align: center;
}

.file-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 350px;
}

.file-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.file-path-text {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category badges */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cat-badge.video { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.cat-badge.photo { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.cat-badge.audio { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.cat-badge.doc { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.cat-badge.archive { background: rgba(251, 113, 133, 0.15); color: #fb7185; }
.cat-badge.code { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.cat-badge.other { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

.status-badge.pending { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.status-badge.uploading { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-badge.done { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.status-badge.failed { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.status-badge.too-large { background: rgba(251, 146, 60, 0.15); color: #fb923c; }

/* Custom checkbox */
.backup-file-table input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.backup-file-table input[type="checkbox"]:checked {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

.backup-file-table input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* === BACKUP PROGRESS === */
.backup-progress-section {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.05), rgba(56, 189, 248, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.backup-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.backup-progress-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 8px;
}

.backup-progress-title i {
  color: #34d399;
}

.backup-progress-stats {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.backup-progress-bar-bg {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.backup-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #38bdf8, #8b5cf6);
  border-radius: 99px;
  transition: width 0.4s ease;
  background-size: 200% 100%;
  animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.backup-progress-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

/* === SAFE TO DELETE ZONE === */
.safe-delete-section {
  margin-top: 20px;
}

.safe-delete-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.safe-delete-title {
  font-size: 16px;
  font-weight: 700;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 8px;
}

.safe-delete-badge {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* === WIZARD STEPPER === */
.wizard-modal {
  max-width: 700px;
  width: 90vw;
}

.wizard-stepper {
  display: flex;
  justify-content: space-between;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 4px;
  overflow-x: auto;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #64748b);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.wizard-step.active .wizard-step-num {
  border-color: #8b5cf6;
  background: #8b5cf6;
  color: white;
}

.wizard-step.active {
  color: var(--text-primary, #e2e8f0);
  font-weight: 600;
}

.wizard-step.completed .wizard-step-num {
  border-color: #34d399;
  background: #34d399;
  color: white;
}

.wizard-step.completed .wizard-step-num::after {
  content: '✓';
}

.wizard-step.completed {
  color: #34d399;
}

.wizard-step-connector {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 12px;
}

.wizard-step-connector.completed {
  background: #34d399;
}

/* Wizard content */
.wizard-body {
  padding: 28px;
  min-height: 300px;
}

.wizard-step-content {
  display: none;
}

.wizard-step-content.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

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

.wizard-step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 8px;
}

.wizard-step-desc {
  font-size: 14px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 20px;
  line-height: 1.6;
}

.wizard-instructions {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.wizard-instructions ol {
  padding-left: 20px;
  margin: 0;
}

.wizard-instructions ol li {
  color: var(--text-primary, #e2e8f0);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 4px;
}

.wizard-instructions ol li strong {
  color: #a78bfa;
}

.wizard-input-group {
  margin-top: 16px;
}

.wizard-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 6px;
}

.wizard-input-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-primary, #e2e8f0);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.wizard-input-group input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.wizard-input-group input::placeholder {
  color: var(--text-muted, #64748b);
}

.wizard-check-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}

.wizard-check-result.success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: #34d399;
}

.wizard-check-result.error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.wizard-check-result.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

/* Wizard footer */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.wizard-footer .btn {
  min-width: 120px;
}

/* === EMPTY SCAN STATE === */
.scan-empty {
  text-align: center;
  padding: 48px 24px;
}

.scan-empty-icon {
  font-size: 56px;
  color: rgba(139, 92, 246, 0.3);
  margin-bottom: 16px;
}

.scan-empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 8px;
}

.scan-empty p {
  font-size: 14px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* === FILE LIST SCROLLABLE === */
.backup-file-table-scroll {
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.backup-file-table-scroll::-webkit-scrollbar {
  width: 6px;
}

.backup-file-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.backup-file-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 99px;
}

/* === PAGINATION === */
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.table-pagination-info {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.table-pagination-btns {
  display: flex;
  gap: 6px;
}

.table-pagination-btns button {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary, #e2e8f0);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-pagination-btns button:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
}

.table-pagination-btns button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.table-pagination-btns button.active-page {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: white;
}

/* === TAB SWITCHER INSIDE BACKUP MODAL === */
.backup-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.backup-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.backup-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #e2e8f0);
}

.backup-tab.active {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.backup-tab-content {
  display: none;
}

.backup-tab-content.active {
  display: block;
  animation: fadeInUp 0.2s ease;
}

/* === RESTORE LIST === */
.restore-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.restore-file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.15s ease;
}

.restore-file-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(139, 92, 246, 0.2);
}

.restore-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.restore-file-info {
  flex: 1;
  overflow: hidden;
}

.restore-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restore-file-meta {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.restore-file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .disk-hero {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 20px;
  }

  .disk-info-grid {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

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

  .backup-file-table .file-path-text {
    display: none;
  }

  .wizard-stepper {
    gap: 2px;
    padding: 12px 16px;
  }

  .wizard-step span:not(.wizard-step-num) {
    display: none;
  }

  .backup-tabs {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .disk-info-grid {
    grid-template-columns: 1fr;
  }

  .disk-chart-container {
    width: 120px;
    height: 120px;
  }
}
