/* Core Design System Tokens */
:root {
  --bg-color: #0b0d19;
  --card-bg: rgba(20, 24, 46, 0.55);
  --card-bg-hover: rgba(28, 33, 61, 0.7);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-purple: #8b5cf6;
  --accent-purple-hover: #7c3aed;
  --accent-purple-glow: rgba(139, 92, 246, 0.15);

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-glow: rgba(59, 130, 246, 0.15);

  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);

  --accent-pink: #ec4899;
  --accent-pink-glow: rgba(236, 72, 153, 0.15);

  --danger: #ef4444;
  --danger-hover: #dc2626;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: blur(14px);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Glowing Background Blobs */
.glass-bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  mix-blend-mode: screen;
  animation: blob-float 25s infinite alternate ease-in-out;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  top: -10%;
  right: -5%;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: var(--accent-blue);
  bottom: -10%;
  left: -5%;
  animation-delay: -5s;
  animation-duration: 20s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: var(--accent-pink);
  top: 40%;
  left: 30%;
  animation-delay: -10s;
  animation-duration: 30s;
}

@keyframes blob-float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(60px, -50px) scale(1.15);
  }

  100% {
    transform: translate(-40px, 80px) scale(0.9);
  }
}

/* Glassmorphism Common Styles */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

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

/* Buttons Styling */
button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 18px;
  transition: all var(--transition-fast);
}

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

.btn-primary:hover {
  background: var(--accent-purple-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.btn-close {
  background: transparent;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 50%;
}

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

/* Authentication Layout */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding: 20px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 30px;
}

.logo-icon {
  background: var(--accent-purple-glow);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  box-shadow: 0 8px 24px 0 rgba(139, 92, 246, 0.15);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
}

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

.input-group input,
.input-group textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--accent-purple);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.input-group-row {
  margin-bottom: 20px;
}

.input-group-row>label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-help {
  font-size: 11px;
  color: var(--text-muted);
}

.radio-group {
  display: flex;
  gap: 12px;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.radio-label input {
  accent-color: var(--accent-purple);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 15px;
}

.hidden {
  display: none !important;
}

/* Dashboard Layout */
.dashboard-wrapper {
  width: 100%;
  max-width: 1300px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.4s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dashboard Header */
.dashboard-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-sm {
  background: var(--accent-purple-glow);
  color: var(--accent-purple);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.header-brand h1 {
  font-size: 20px;
  font-weight: 600;
}

/* Bot status info */
.bot-status-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background-color: var(--text-muted);
}

.status-pulse.connected {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-glow 1.5s infinite alternate;
}

.status-pulse.disconnected {
  background-color: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }

  100% {
    transform: scale(1.2);
    opacity: 1;
  }
}

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

.bot-username {
  color: var(--accent-purple);
  font-weight: 600;
}

/* Grid Dashboard Content */
.dashboard-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

/* Status Cards / Sidebar */
.status-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.status-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

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

.status-header h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-header svg {
  opacity: 0.8;
}

.accent-purple {
  color: var(--accent-purple);
}

.accent-blue {
  color: var(--accent-blue);
}

.accent-emerald {
  color: var(--accent-emerald);
}

.accent-pink {
  color: var(--accent-pink);
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
}

.metric-value .unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 4px;
}

.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease-in-out;
}

#cpu-progress {
  background: var(--accent-purple);
}

#ram-progress {
  background: var(--accent-blue);
}

#disk-progress {
  background: var(--accent-emerald);
}

.status-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Info card details */
.info-card {
  padding: 20px 24px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-val {
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Main Panel Sections */
.main-display-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* File Browser Section */
.file-browser-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

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

.card-title-group h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-title-group p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Breadcrumbs path */
.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.folder-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.breadcrumb-root {
  color: var(--accent-purple);
  font-weight: 600;
  cursor: pointer;
}

.breadcrumb-root:hover {
  text-decoration: underline;
}

.breadcrumb-part {
  color: var(--text-secondary);
  cursor: pointer;
}

.breadcrumb-part:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-muted);
  user-select: none;
}

/* Files Table */
.files-table-container {
  overflow-x: auto;
  flex-grow: 1;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.files-table th {
  padding: 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.files-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  vertical-align: middle;
}

.files-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-primary);
}

.col-name {
  width: 45%;
}

.col-size {
  width: 15%;
}

.col-date {
  width: 25%;
}

.col-actions {
  width: 15%;
  text-align: right;
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  flex-shrink: 0;
}

.file-icon-dir {
  color: #fbbf24;
}

.file-icon-video {
  color: var(--accent-purple);
}

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

.clickable-name {
  cursor: pointer;
  font-weight: 500;
}

.clickable-name:hover {
  color: var(--accent-purple);
  text-decoration: underline;
}

.empty-loading {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px auto;
}

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

.btn-action-send {
  background: var(--accent-purple-glow);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-action-send:hover {
  background: var(--accent-purple);
  color: #fff;
  border-color: transparent;
}

/* Logs Section */
.logs-card {
  padding: 24px;
}

.logs-console {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  height: 250px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-line {
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  border-left: 2px solid transparent;
  padding-left: 8px;
}

.log-line.info {
  border-color: var(--accent-blue);
  color: #93c5fd;
}

.log-line.success {
  border-color: var(--accent-emerald);
  color: #a7f3d0;
}

.log-line.warn {
  border-color: var(--accent-pink);
  color: #fbcfe8;
}

.log-line.error {
  border-color: var(--danger);
  color: #fca5a5;
}

/* Modal Styles */
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 18, 0.8);
  backdrop-filter: var(--glass-blur);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  padding: 30px;
  position: relative;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.file-details-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.file-icon-lg {
  background: rgba(255, 255, 255, 0.05);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-details-text h4 {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 2px;
}

.file-details-text span {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.loading-box {
  width: 100%;
  max-width: 400px;
  padding: 40px 30px;
  text-align: center;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px auto;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.loading-box h3 {
  font-size: 20px;
  margin-bottom: 8px;
  font-weight: 600;
}

.loading-box p {
  color: var(--accent-purple);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 20px;
  word-break: break-all;
}

.loading-warning {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Responsive details */
@media (max-width: 900px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dashboard-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .bot-status-container {
    width: 100%;
    justify-content: center;
  }

  .btn-action-send span {
    display: none;
  }

  .files-table th.col-date,
  .files-table td:nth-child(3) {
    display: none;
  }
}