/* Core Design System & Variables */
:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: rgba(13, 20, 38, 0.7);
  --glass-bg: rgba(22, 34, 64, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  --accent-glow: rgba(59, 130, 246, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --status-green: #10b981;
  --status-yellow: #f59e0b;
  --status-red: #ef4444;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 16px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px -5px var(--accent-cyan-glow);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

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

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Background Glowing Accents */
.glass-bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  top: -200px;
  left: -200px;
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
  animation: float-glow 20s infinite alternate;
}

.glass-bg-glow.secondary {
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
  top: auto;
  left: auto;
  animation: float-glow 25s infinite alternate-reverse;
}

@keyframes float-glow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, 80px) scale(1.15); }
}

/* Glassmorphism Panel Class */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-premium);
  border-radius: 20px;
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
}

/* App Container Layout */
.app-container {
  width: 100%;
  max-width: 1200px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  flex: 1;
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px var(--accent-cyan-glow));
}

.logo-text h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-text h1 span {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.logo-text p {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 300;
}

/* Connection Badging */
.connection-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: pulse-ring 1.5s infinite;
  opacity: 0.4;
}

.status-indicator.yellow { background-color: var(--status-yellow); color: var(--status-yellow); }
.status-indicator.green { background-color: var(--status-green); color: var(--status-green); }
.status-indicator.red { background-color: var(--status-red); color: var(--status-red); }

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

/* Stats Grid Layout */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.stats-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
  top: -50px;
  right: -50px;
  border-radius: 50%;
}

.stats-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-icon svg {
  width: 24px;
  height: 24px;
}

.stats-card:nth-child(2) .stats-icon {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--status-green);
}

.stats-info {
  flex: 1;
  min-width: 0; /* Helps with truncation inside flexbox */
}

.stats-info h3 {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0;
  font-family: 'Space Grotesk', sans-serif;
}

.stats-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  display: block;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Button Customizer */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.btn-icon-only {
  padding: 8px;
  border-radius: 8px;
}

.btn-icon-only svg {
  width: 18px;
  height: 18px;
}


/* Main Explorer Section */
.explorer-section {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 450px;
}

/* Toolbar & Breadcrumbs */
.explorer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 16px;
}

.breadcrumbs-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 4px 0;
  max-width: 70%;
}

.breadcrumb-item {
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.breadcrumb-item:hover {
  color: var(--accent-cyan);
}

.breadcrumb-item.root {
  font-weight: 600;
  color: var(--text-primary);
}

.breadcrumbs-container::after {
  content: '';
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: var(--text-muted);
  pointer-events: none;
}

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

.toolbar-actions svg {
  width: 16px;
  height: 16px;
}

/* File Explorer List View */
.file-explorer-container {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 15, 29, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.explorer-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.explorer-body {
  min-height: 250px;
  max-height: 550px;
  overflow-y: auto;
}

.explorer-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.explorer-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.explorer-row.is-folder {
  cursor: pointer;
}

.explorer-row.is-folder:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* Item Name Section with Icon */
.item-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 500;
  min-width: 0;
}

.item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.item-icon.folder {
  color: #fbbf24; /* Amber folder */
  filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.2));
}

.item-icon.file {
  color: var(--text-secondary);
}

.item-icon.image {
  color: var(--accent-cyan);
}

.item-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-row.is-folder .item-name-text {
  color: #fbbf24;
}

.col-type {
  color: var(--text-secondary);
}

.col-size {
  color: var(--text-muted);
}

/* Actions Section */
.col-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: scale(1.08);
}

.action-btn.copy:hover {
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.action-btn.download:hover {
  color: var(--status-green);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.action-btn.delete:hover {
  color: var(--status-red);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

.action-btn svg {
  width: 15px;
  height: 15px;
}

/* Loading & Empty States */
.explorer-loading, .explorer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 15px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 0 5px var(--accent-cyan-glow));
}

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

.explorer-empty svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Drag and Drop Full Screen Overlay */
.drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border: 4px dashed var(--accent-cyan);
  margin: 10px;
  width: calc(100vw - 20px);
  height: calc(100vh - 20px);
  border-radius: 20px;
}

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

.drag-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.drag-overlay.active .drag-content {
  transform: scale(1);
}

.drag-content svg {
  width: 80px;
  height: 80px;
  color: var(--accent-cyan);
  animation: float-arrow 1s infinite alternate;
  filter: drop-shadow(0 0 15px var(--accent-cyan-glow));
}

@keyframes float-arrow {
  0% { transform: translateY(0); }
  100% { transform: translateY(-15px); }
}

.drag-content h2 {
  font-size: 24px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.drag-content p {
  color: var(--text-secondary);
}

/* Upload Progress Drawer */
.upload-drawer {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 360px;
  max-height: 400px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-color: rgba(6, 182, 212, 0.2);
}

.upload-drawer.active {
  transform: translateY(0);
  opacity: 1;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.drawer-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-smooth);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.drawer-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px;
  border-radius: 8px;
}

.upload-item-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.upload-item-name {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 75%;
}

.upload-item-pct {
  color: var(--accent-cyan);
  font-weight: 600;
}

.progress-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

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

/* Modals Overlay & Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  width: 420px;
  max-width: 90%;
  padding: 24px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.modal-body {
  margin-bottom: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.input-group input {
  background: rgba(10, 15, 29, 0.5);
  border: 1px solid var(--glass-border);
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Footer text */
.app-footer-text {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 300;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-container {
    padding: 20px 10px;
    gap: 20px;
  }
  
  .app-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .connection-badge {
    align-self: flex-start;
  }
  
  .explorer-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .breadcrumbs-container {
    max-width: 100%;
  }
  
  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .explorer-header {
    grid-template-columns: 2fr 1.2fr;
  }
  
  .col-type, .col-size {
    display: none;
  }
  
  .explorer-row {
    grid-template-columns: 2fr 1.2fr;
  }

  .upload-drawer {
    width: calc(100vw - 40px);
    right: 20px;
    left: 20px;
    bottom: 20px;
  }
}

/* Login Container Styles */
.login-container {
  width: 400px;
  padding: 40px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 30px;
  z-index: 10000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: login-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes login-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.login-logo {
  width: 56px;
  height: 56px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 10px var(--accent-cyan-glow));
}

.login-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-header h2 span {
  color: var(--accent-cyan);
}

.login-header p {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 300;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-error {
  padding: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--status-red);
  font-size: 13px;
  text-align: center;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.header-actions {
  display: flex;
  align-items: center;
}

/* File Details Styles */
.details-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(10, 15, 29, 0.4);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: 12px;
}

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

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  text-align: right;
}

.detail-url-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-url-container .action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
}

