/* Virtual Files Settings Page Styles */

.virtual-files-settings {
  max-width: 1400px;
  margin: 0 auto;
  padding-right: 15px; /* Add space for scrollbar */
}

/* Settings Layout - Main + Sidebar */
.vf-settings-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
  align-items: start;
}

.vf-settings-main {
  min-width: 0; /* Prevent grid blowout */
}

.vf-settings-sidebar {
  position: sticky;
  top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-right: 10px; /* Additional margin from scrollbar */
}

/* Sidebar Sections */
.vf-sidebar-section {
  background: #ffffff;
  border: 1px solid #e0e4e8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.vf-sidebar-section:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.vf-sidebar-section h3 {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 100%);
  margin: 0;
  padding: 14px 18px;
  border-bottom: 2px solid #e5e8eb;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  letter-spacing: -0.2px;
}

.vf-sidebar-section h3::before {
  content: "📊";
  margin-right: 8px;
  font-size: 16px;
}

.vf-backup-restore-widget h3::before {
  content: "💾";
  font-size: 16px;
}

/* Statistics Cards Grid */
.vf-sidebar-section .vf-stats-cards {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.vf-sidebar-section .vf-stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.vf-sidebar-section .vf-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

/* Stat Card Icons */
.vf-sidebar-section .vf-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.vf-stat-active .vf-stat-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.vf-stat-total .vf-stat-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.vf-stat-max .vf-stat-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.vf-sidebar-section .vf-stat-icon .dashicons {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

/* Stat Card Content */
.vf-sidebar-section .vf-stat-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vf-sidebar-section .vf-stat-number {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.vf-sidebar-section .vf-stat-label {
  font-size: 9px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 3px;
}

.virtual-files-settings .form-table {
  margin-top: 0;
  border: none;
  background: transparent;
}

.virtual-files-settings .form-table th {
  font-weight: 600;
  color: #1e1e1e;
  vertical-align: top;
  padding: 20px 20px 20px 0;
  width: 200px;
  font-size: 14px;
}

.virtual-files-settings .form-table td {
  padding: 20px 20px 20px 0;
  line-height: 1.5;
}

/* Checkbox styling */
.virtual-files-settings input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: middle;
}

/* Text inputs */
.virtual-files-settings input[type="text"],
.virtual-files-settings input[type="number"],
.virtual-files-settings select {
  width: 100%;
  max-width: 300px;
}

/* Textarea */
.virtual-files-settings textarea {
  width: 100%;
  height: 100px;
  resize: vertical;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
}

/* Buttons */
/* .virtual-files-settings .button {
    margin-right: 10px;
    margin-bottom: 10px;
} */

.virtual-files-settings .button-primary {
  background: #0073aa;
  border-color: #0073aa;
  color: #fff;
}

.virtual-files-settings .button-primary:hover {
  background: #005a87;
  border-color: #005a87;
}

.virtual-files-settings .button-secondary {
  background: #f7f7f7;
  border-color: #ccc;
  color: #555;
}

.virtual-files-settings .button-secondary:hover {
  background: #e0e0e0;
  border-color: #999;
}

/* Descriptions and help text */
.virtual-files-settings .description {
  color: #666;
  font-style: italic;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.4;
  display: block;
}

.virtual-files-settings .help-text {
  background: #f9f9f9;
  border-left: 4px solid #0073aa;
  padding: 10px 15px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.4;
}

/* Pro feature badges and upsells */
.vf-pro-badge {
  background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.6px;
  box-shadow: 0 2px 4px rgba(34, 113, 177, 0.2);
}

.vf-pro-feature {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin: 0 0 20px 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.vf-pro-feature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 50%, #f59e0b 100%);
}

.vf-pro-feature:hover {
  border-color: #f59e0b;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.15);
  transform: translateY(-2px);
}

.vf-pro-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.vf-pro-icon {
  font-size: 28px;
  line-height: 1;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.vf-pro-header h3 {
  margin: 0;
  color: #1e293b;
  font-size: 20px;
  font-weight: 700;
  flex: 1;
}

.vf-pro-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0 0 20px 0;
  padding: 0;
}

.vf-pro-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.vf-pro-feature-item:hover {
  border-color: #f59e0b;
  background: #fffbeb;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.vf-feature-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.vf-pro-feature-item > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.vf-pro-feature-item strong {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.vf-feature-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.3;
}

.vf-pro-feature .vf-upgrade-button {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
  width: 100%;
  max-width: 100%;
  margin: 0;
  justify-content: center;
  box-sizing: border-box;
}

.vf-pro-feature .vf-upgrade-button:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

@media screen and (max-width: 782px) {
  .vf-pro-features-grid {
    grid-template-columns: 1fr;
  }

  .vf-pro-feature {
    padding: 20px;
  }

  .vf-pro-header {
    flex-direction: row;
  }

  .vf-pro-icon {
    font-size: 24px;
  }

  .vf-pro-header h3 {
    font-size: 18px;
  }
}

/* Settings sections */
.vf-settings-section {
  background: #ffffff;
  border: 1px solid #e0e4e8;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.vf-settings-section:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.vf-settings-section h3 {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 100%);
  margin: 0;
  padding: 18px 24px;
  border-bottom: 2px solid #e5e8eb;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  letter-spacing: -0.2px;
}

.vf-settings-section h3::before {
  content: "⚙️";
  margin-right: 10px;
  font-size: 18px;
}

.vf-settings-section.performance h3::before {
  content: "⚡";
}

.vf-settings-section.files h3::before {
  content: "📄";
}

.vf-settings-section.pro h3::before {
  content: "🚀";
}

.vf-settings-section .inside {
  padding: 24px;
}

/* Advanced settings toggle */
.vf-advanced-toggle {
  background: #f7f7f7;
  border: 1px solid #ddd;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 600;
  margin: 20px 0;
  border-radius: 4px;
  display: inline-block;
}

.vf-advanced-toggle:hover {
  background: #e9e9e9;
}

.vf-advanced-settings {
  display: none;
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 20px;
  margin-top: 15px;
}

.vf-advanced-settings.show {
  display: block;
}

/* File Extensions - Compact Chip Layout */
.vf-file-extensions-container {
  margin: 16px 0;
}

.vf-extensions-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 16px;
  min-height: 60px;
  align-items: flex-start;
  align-content: flex-start;
}

.vf-extension-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
  font-size: 12px;
  line-height: 1.2;
}

.vf-extension-chip.chip-updating {
  transform: scale(1.05);
  transition: transform 0.15s ease;
}

.vf-extension-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.vf-extension-chip.allowed {
  border-color: var(--chip-color);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  box-shadow: 0 0 0 1px var(--chip-color);
}

.vf-extension-chip.allowed .chip-ext {
  background: var(--chip-color);
  color: white;
}

.vf-extension-chip.disabled {
  opacity: 0.6;
  background: #f9fafb;
}

.vf-extension-chip .chip-ext {
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  font-size: 10px;
  background: #6b7280;
  color: white;
  padding: 2px 5px;
  border-radius: 8px;
  text-transform: uppercase;
  min-width: 28px;
  text-align: center;
}

.vf-extension-chip .chip-name {
  font-weight: 500;
  color: #374151;
  margin-right: 2px;
}

.vf-extension-chip .chip-checkbox {
  position: absolute;
  top: -8px;
  right: -8px;
}

.vf-extension-chip .chip-checkbox input[type="checkbox"] {
  display: none;
}

.vf-extension-chip .chip-checkbox label {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.vf-extension-chip .chip-checkbox input[type="checkbox"]:checked + label {
  background: var(--chip-color);
  border-color: var(--chip-color);
}

.vf-extension-chip
  .chip-checkbox
  input[type="checkbox"]:checked
  + label::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
}

.vf-extension-details {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 12px;
}

.extension-details-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.detail-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-text {
  flex: 1;
}

.detail-text strong {
  color: #0c4a6e;
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}

.detail-text p {
  margin: 0;
  color: #0369a1;
  font-size: 12px;
  line-height: 1.4;
}

/* Responsive adjustments for extension chips */
@media screen and (max-width: 782px) {
  .vf-extensions-selector {
    padding: 8px;
    gap: 6px;
  }

  .vf-extension-chip {
    padding: 5px 8px;
    font-size: 11px;
  }

  .vf-extension-chip .chip-name {
    display: none; /* Hide name on mobile to save space */
  }

  .vf-extension-details {
    padding: 10px;
  }

  .detail-icon {
    font-size: 14px;
  }

  .detail-text strong {
    font-size: 12px;
  }

  .detail-text p {
    font-size: 11px;
  }
}

/* Statistics special colors */
.vf-stat-active-files {
  border-color: #d1fae5;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.vf-stat-active-files::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.vf-stat-active-files .number {
  color: #059669;
}

.vf-stat-total-files {
  border-color: #dbeafe;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.vf-stat-total-files::before {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.vf-stat-total-files .number {
  color: #1d4ed8;
}

.vf-stat-max-files {
  border-color: #d1fae5;
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}

.vf-stat-max-files::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.vf-stat-max-files .number {
  color: #10b981;
  font-weight: 800;
}

.vf-stat-max-files .number[data-unlimited="true"] {
  background: linear-gradient(135deg, #10b981, #059669, #047857);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 20px;
}

/* Backup & Restore section - Sidebar Version */
.vf-sidebar-section .vf-backup-restore {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.vf-sidebar-section .vf-backup-box {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.vf-sidebar-section .vf-backup-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vf-sidebar-section .vf-backup-box:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.vf-sidebar-section .vf-backup-box:hover::before {
  opacity: 1;
}

.vf-sidebar-section .vf-backup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.vf-sidebar-section .vf-backup-header .dashicons {
  color: #3b82f6;
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.vf-sidebar-section .vf-backup-box h4 {
  margin: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.vf-sidebar-section .vf-backup-box p {
  margin: 0 0 12px 0;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.5;
}

.vf-sidebar-section .vf-backup-box .button {
  width: 100%;
  text-align: center;
  font-size: 12px;
  padding: 8px 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  background: #f7f7f7 !important;
  border-color: #ccc !important;
  color: #555 !important;
}

.vf-sidebar-section .vf-backup-box .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #e0e0e0 !important;
  border-color: #999 !important;
  color: #555 !important;
}

/* Free Version Backup & Restore */
.vf-sidebar-section .vf-backup-restore-free {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.vf-sidebar-section .vf-pro-notice {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #fbbf24;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.vf-sidebar-section .vf-pro-notice .dashicons {
  width: 28px;
  height: 28px;
  font-size: 28px;
  color: #d97706;
  margin-bottom: 4px;
}

.vf-sidebar-section .vf-pro-notice p {
  margin: 0;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.vf-sidebar-section .vf-pro-notice .button-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #d97706;
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
  margin-top: 6px;
  text-decoration: none;
}

.vf-sidebar-section .vf-pro-notice .button-primary:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: #b45309;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.vf-sidebar-section .vf-backup-box-disabled {
  opacity: 0.65;
  position: relative;
  pointer-events: none;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-color: #d1d5db;
}

.vf-sidebar-section .vf-backup-box-disabled::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.02) 10px,
    rgba(0, 0, 0, 0.02) 20px
  );
  border-radius: 8px;
  pointer-events: none;
}

.vf-sidebar-section .vf-backup-box-disabled:hover {
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.vf-sidebar-section .vf-backup-box-disabled .dashicons {
  color: #9ca3af;
}

.vf-sidebar-section .vf-backup-box-disabled h4 {
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vf-sidebar-section .vf-backup-box-disabled h4 .vf-pro-badge {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 10px;
  vertical-align: middle;
}

.vf-sidebar-section .vf-backup-box-disabled p {
  color: #9ca3af;
}

.vf-sidebar-section .vf-backup-box-disabled .button:disabled {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

/* File uploader */
.vf-file-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vf-file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.vf-file-upload .button {
  margin: 0;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.vf-file-upload .button::before {
  content: "📁";
  margin-right: 6px;
}

.vf-file-selected {
  font-size: 13px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #f0f9ff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
  animation: vfFadeIn 0.3s ease;
}

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

.vf-file-upload:hover .button {
  background: #2271b1;
  border-color: #2271b1;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Progress indicator */
.vf-progress {
  background: #f0f0f1;
  border-radius: 4px;
  height: 8px;
  margin: 15px 0;
  overflow: hidden;
}

.vf-progress-bar {
  background: #0073aa;
  height: 100%;
  width: 0;
  transition: width 0.3s ease;
}

/* Notices */
.vf-notice {
  background: #fff;
  border-left: 4px solid #0073aa;
  padding: 12px 15px;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}

.vf-notice.success {
  border-left-color: #46b450;
}

.vf-notice.error {
  border-left-color: #dc3232;
}

.vf-notice.warning {
  border-left-color: #ffb900;
}

/* Responsive adjustments */
@media screen and (max-width: 1200px) {
  .vf-settings-layout {
    grid-template-columns: 1fr;
  }

  .vf-settings-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
}

@media screen and (max-width: 782px) {
  .virtual-files-settings .form-table th,
  .virtual-files-settings .form-table td {
    display: block;
    width: 100%;
    padding: 10px 0;
  }

  .virtual-files-settings .form-table th {
    padding-bottom: 0;
    font-weight: 600;
  }

  .virtual-files-settings input[type="text"],
  .virtual-files-settings input[type="number"],
  .virtual-files-settings select {
    max-width: 100%;
  }

  .vf-settings-sidebar {
    grid-template-columns: 1fr;
  }

  .vf-file-types-grid {
    grid-template-columns: 1fr;
  }
}

/* WordPress admin theme compatibility improvements */
.virtual-files-settings h1 {
  font-size: 23px;
  font-weight: 400;
  margin: 0 0 20px 0;
  padding: 9px 0 4px 0;
  line-height: 1.3;
  border-bottom: 1px solid #dcdcde;
}

/* Improved form styling */
.virtual-files-settings input[type="text"],
.virtual-files-settings input[type="number"],
.virtual-files-settings select {
  width: auto;
  min-width: 200px;
  max-width: 400px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #8c8f94;
  border-radius: 6px;
  background-color: #fff;
  color: #3c434a;
  transition: all 0.2s ease;
}

.virtual-files-settings input[type="text"]:focus,
.virtual-files-settings input[type="number"]:focus,
.virtual-files-settings select:focus {
  border-color: #2271b1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

/* Improved button styling */
.virtual-files-settings .submit {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
  display: flex;
  gap: 12px;
  align-items: center;
}

.virtual-files-settings .button {
  font-size: 14px;
  line-height: 1.5;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.virtual-files-settings .button-primary {
  background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
  border-color: #135e96;
  box-shadow: 0 2px 6px rgba(34, 113, 177, 0.2);
}

.virtual-files-settings .button-primary:hover {
  background: linear-gradient(135deg, #135e96 0%, #0f4e7c 100%);
  border-color: #0f4e7c;
  box-shadow: 0 3px 10px rgba(34, 113, 177, 0.3);
  transform: translateY(-1px);
}

/* Better checkbox styling */
.virtual-files-settings input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Improved description styling */
.virtual-files-settings .description {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #646970;
  font-style: normal;
}

/* Limit indicator styling */
.vf-limit-indicator {
  display: block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 12px;
}

.vf-limit-indicator.limit-ok {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.vf-limit-indicator.limit-warning {
  background: #fefce8;
  color: #ca8a04;
  border: 1px solid #fde047;
}

.vf-limit-indicator.limit-reached {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Better notification system - Reset all styles */
#vf-better-notices-container * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#vf-better-notices-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  max-width: 480px;
  min-width: 420px;
  pointer-events: none;
}

.vf-better-notice {
  background: #ffffff;
  border-radius: 14px;
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateX(480px) scale(0.95);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: none;
  border-left: 4px solid transparent;
  min-height: 72px;
}

.vf-better-notice::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  transition: all 0.3s ease;
}

.vf-better-notice--show {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.vf-better-notice:hover {
  transform: translateX(-4px) scale(1);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.12);
}

.vf-better-notice__content {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 20px 26px !important;
  padding-right: 64px !important;
  margin: 0 !important;
  min-height: 72px;
  box-sizing: border-box;
}

.vf-better-notice__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700;
  font-size: 18px;
  line-height: 1 !important;
  margin: 0 16px 0 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.vf-better-notice:hover .vf-better-notice__icon {
  transform: scale(1.05) rotate(5deg);
}

/* Success notification styling */
.vf-better-notice--success::before {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.vf-better-notice--success .vf-better-notice__icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}

.vf-better-notice--success {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

/* Error notification styling */
.vf-better-notice--error::before {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.vf-better-notice--error .vf-better-notice__icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

.vf-better-notice--error {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

/* Warning notification styling */
.vf-better-notice--warning::before {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.vf-better-notice--warning .vf-better-notice__icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}

.vf-better-notice--warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

/* Info notification styling */
.vf-better-notice--info::before {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.vf-better-notice--info .vf-better-notice__icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
}

.vf-better-notice--info {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.vf-better-notice__message {
  font-size: 15px;
  line-height: 1.5 !important;
  color: #1f2937;
  font-weight: 500;
  flex: 1;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

.vf-better-notice__close {
  position: absolute !important;
  top: 50% !important;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  cursor: pointer;
  border-radius: 8px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px;
  line-height: 1 !important;
  font-weight: 700;
  color: #6b7280;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateY(-50%) !important;
  transition: all 0.2s ease;
}

.vf-better-notice__close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #374151;
  transform: translateY(-50%) scale(1.1) rotate(90deg);
}

.vf-better-notice__close:active {
  transform: translateY(-50%) scale(0.95) rotate(90deg);
}

/* Progress bar for auto-dismiss */
.vf-better-notice__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: rgba(0, 0, 0, 0.1);
  transform-origin: left;
  transition: transform linear;
  border-radius: 0 0 14px 14px;
}

.vf-better-notice--success .vf-better-notice__progress {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.vf-better-notice--error .vf-better-notice__progress {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.vf-better-notice--warning .vf-better-notice__progress {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.vf-better-notice--info .vf-better-notice__progress {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Pause animation on hover */
.vf-better-notice:hover .vf-better-notice__progress {
  animation-play-state: paused;
}

/* Accessibility improvements */
.vf-better-notice:focus-within {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .vf-better-notice {
    transition: opacity 0.2s ease;
    animation: none;
  }

  .vf-better-notice--show {
    transform: translateX(0) scale(1);
  }

  .vf-better-notice:hover {
    transform: translateX(0) scale(1);
  }

  .vf-better-notice:hover .vf-better-notice__icon {
    transform: none;
  }

  .vf-better-notice__close {
    transform: translateY(-50%);
  }

  .vf-better-notice__close:hover {
    transform: translateY(-50%);
  }

  .vf-better-notice__close:active {
    transform: translateY(-50%);
  }

  @keyframes slideInNotification {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
}

/* Form success animation */
#virtual-files-settings-form.save-success {
  animation: saveSuccessPulse 1s ease;
}

@keyframes saveSuccessPulse {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 20px rgba(34, 113, 214, 0.3);
    border-color: #2271b1;
  }
}

/* Responsive adjustments for better notifications */
@media screen and (max-width: 768px) {
  #vf-better-notices-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    min-width: auto;
  }

  .vf-better-notice {
    border-radius: 12px;
    margin-bottom: 12px;
    min-height: 64px;
  }

  .vf-better-notice__content {
    padding: 18px 20px;
    padding-right: 56px;
    min-height: 64px;
  }

  .vf-better-notice__icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    line-height: 1;
    margin: 0 14px 0 0;
    padding: 0;
  }

  .vf-better-notice__message {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
  }

  .vf-better-notice__close {
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    top: 50%;
    right: 16px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
  }

  .vf-better-notice__close:hover {
    transform: translateY(-50%) scale(1.1) rotate(90deg);
  }

  .vf-better-notice__close:active {
    transform: translateY(-50%) scale(0.95) rotate(90deg);
  }
}

/* Stack multiple notifications with improved spacing */
#vf-better-notices-container .vf-better-notice {
  animation: slideInNotification 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInNotification {
  0% {
    transform: translateX(480px) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .vf-better-notice {
    background: #1f2937;
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .vf-better-notice__message {
    color: #f9fafb;
  }

  .vf-better-notice__close {
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
  }

  .vf-better-notice__close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
  }

  .vf-better-notice--success {
    background: linear-gradient(
      135deg,
      rgba(16, 185, 129, 0.15) 0%,
      #1f2937 100%
    );
  }

  .vf-better-notice--error {
    background: linear-gradient(
      135deg,
      rgba(239, 68, 68, 0.15) 0%,
      #1f2937 100%
    );
  }

  .vf-better-notice--warning {
    background: linear-gradient(
      135deg,
      rgba(245, 158, 11, 0.15) 0%,
      #1f2937 100%
    );
  }

  .vf-better-notice--info {
    background: linear-gradient(
      135deg,
      rgba(59, 130, 246, 0.15) 0%,
      #1f2937 100%
    );
  }
}

/* Loading state improvements */
.button.vf-loading {
  position: relative;
  color: #fff;
  background: #0073aa !important;
  border-color: #0073aa !important;
}

.button.vf-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: vfSpin 1s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* Form loading state */
#virtual-files-settings-form.vf-form-loading {
  opacity: 0.7;
  pointer-events: none;
}

#virtual-files-settings-form.vf-form-loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
}

@keyframes vfSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* Cache Statistics Styles */
.vf-cache-stats {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.vf-cache-stats::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981 0%, #059669 50%, #3b82f6 100%);
}

.vf-stats-wrapper {
  display: flex;
  gap: 14px;
  margin: 0 0 20px 0;
  padding: 0;
}

.vf-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.vf-stat-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.vf-stat-label {
  font-weight: 600;
  color: #334155;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.vf-stat-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  flex-shrink: 0;
}

.vf-stat-row:last-child .vf-stat-label::before {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.vf-stat-value {
  font-weight: 700;
  color: #1e293b;
  font-family:
    SF Mono,
    Monaco,
    Inconsolata,
    Roboto Mono,
    monospace;
  font-size: 18px;
  padding: 6px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.vf-cache-actions {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vf-cache-actions .button {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  height: auto;
  line-height: 1.4;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.vf-cache-actions #vf-warm-up-cache {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.vf-cache-actions #vf-warm-up-cache:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.vf-cache-actions #vf-clear-cache {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.vf-cache-actions #vf-clear-cache:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.vf-cache-actions .button:active {
  transform: translateY(0);
}

.vf-cache-actions .button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.vf-cache-actions .button:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

@media screen and (max-width: 782px) {
  .vf-cache-stats {
    padding: 18px;
  }

  .vf-stats-wrapper {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }

  .vf-stat-row {
    width: 100%;
    padding: 12px 14px;
  }

  .vf-stat-label {
    font-size: 13px;
  }

  .vf-stat-value {
    font-size: 16px;
  }

  .vf-cache-actions {
    margin-top: 16px;
  }

  .vf-cache-actions .button {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }
}

/* Danger Button - Reset Plugin Data */
#vf-reset-plugin-data:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%) !important;
  border-color: #991b1b !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4) !important;
}

#vf-reset-plugin-data:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3) !important;
}

/* Pro Upgrade Banner */
.vf-pro-upgrade-banner {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.vf-pro-upgrade-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.vf-banner-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.vf-banner-content {
  flex: 1;
}

.vf-banner-title {
  margin: 0 0 6px 0;
  color: white;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.vf-banner-description {
  margin: 0;
  opacity: 0.95;
  font-size: 13px;
  line-height: 1.5;
}

.vf-banner-button {
  background: white !important;
  border: none !important;
  color: #667eea !important;
  font-weight: 700 !important;
  padding: 10px 24px !important;
  font-size: 14px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease !important;
}

.vf-banner-button:hover {
  background: #f8f9fa !important;
  color: #5568d3 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.vf-banner-button:active {
  transform: translateY(0) !important;
}

/* Responsive design for banner */
@media (max-width: 782px) {
  .vf-pro-upgrade-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 12px;
  }

  .vf-banner-icon {
    font-size: 40px;
  }

  .vf-banner-button {
    width: 100%;
  }
}

/* AI Settings Styles */
.vf-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 400px;
}

.vf-password-wrapper input {
  width: 100%;
  padding-right: 30px;
}

.vf-toggle-password {
  position: absolute;
  right: 8px;
  cursor: pointer;
  color: #64748b;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.vf-toggle-password:hover {
  color: #3b82f6;
}

.vf-api-key-row {
  transition: all 0.3s ease;
}
