/**
 * Cache Management Panel Styles
 * CloudFront-style cache management UI
 */

.cache-panel {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Panel Header */
.cache-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--bs-border-color);
}

.cache-panel .panel-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--bs-dark);
}

.cache-panel .panel-header .header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Section Titles */
.cache-panel .section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--bs-dark);
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bs-border-color);
}

/* Statistics Grid */
.cache-panel .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.cache-panel .stat-card {
  background: white;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
}

.cache-panel .stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.cache-panel .stat-icon {
  font-size: 2rem;
  line-height: 1;
}

.cache-panel .stat-content {
  flex: 1;
}

.cache-panel .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bs-primary);
  margin-bottom: 5px;
}

.cache-panel .stat-label {
  font-size: 0.875rem;
  color: var(--bs-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cache-panel .stat-card small {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
}

/* Loading States */
.cache-panel .stat-loading,
.cache-panel .table-loading {
  padding: 40px;
  text-align: center;
  color: var(--bs-secondary);
  font-style: italic;
}

/* Key Browser Controls */
.cache-panel .key-browser-controls {
  background: var(--bs-light);
  padding: 15px;
  border-radius: 8px;
}

/* Key Browser Table */
.cache-panel .key-browser-table {
  background: white;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  overflow: hidden;
}

.cache-panel .key-browser-table .table {
  margin-bottom: 0;
}

.cache-panel .key-browser-table th {
  background: var(--bs-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--bs-border-color);
}

.cache-panel .key-browser-table .text-truncate {
  max-width: 300px;
}

/* Operations Cards */
.cache-panel .operations-section .card {
  height: 100%;
  transition: all 0.3s ease;
}

.cache-panel .operations-section .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cache-panel .operations-section .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--bs-dark);
}

.cache-panel .operations-section .card.border-danger {
  border-width: 2px;
}

.cache-panel .operations-section .card.border-danger:hover {
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

/* Circuit Breakers Table */
.cache-panel .circuit-breakers-table {
  background: white;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  overflow: hidden;
}

.cache-panel .circuit-breakers-table .table {
  margin-bottom: 0;
}

.cache-panel .circuit-breakers-table th {
  background: var(--bs-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
}

/* Analytics Container */
.cache-panel .analytics-container {
  background: white;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 20px;
}

.cache-panel .analytics-container h6 {
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--bs-dark);
}

/* Pagination */
.cache-panel .pagination {
  margin-top: 20px;
  margin-bottom: 0;
}

/* Badges */
.cache-panel .badge {
  font-size: 0.875rem;
  padding: 0.35em 0.65em;
}

/* Button Styles */
.cache-panel .btn-sm {
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cache-panel {
    padding: 15px;
  }

  .cache-panel .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .cache-panel .stats-grid {
    grid-template-columns: 1fr;
  }

  .cache-panel .key-browser-controls .row {
    flex-direction: column;
  }

  .cache-panel .operations-section .row {
    flex-direction: column;
  }
}

/* Dark Mode Support */
body[data-theme="dark"] .cache-panel .panel-header h2,
body[data-theme="dark"] .cache-panel .section-title,
body[data-theme="dark"] .cache-panel .operations-section .card-title,
body[data-theme="dark"] .cache-panel .analytics-container h6 {
  color: var(--text-primary);
}

body[data-theme="dark"] .cache-panel .stat-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body[data-theme="dark"] .cache-panel .stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .cache-panel .stat-label {
  color: var(--text-muted);
}

body[data-theme="dark"] .cache-panel .key-browser-table,
body[data-theme="dark"] .cache-panel .circuit-breakers-table,
body[data-theme="dark"] .cache-panel .analytics-container {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body[data-theme="dark"] .cache-panel .key-browser-table th,
body[data-theme="dark"] .cache-panel .circuit-breakers-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-bottom-color: var(--border);
}

body[data-theme="dark"] .cache-panel .key-browser-controls {
  background: var(--bg-tertiary);
}

body[data-theme="dark"] .cache-panel .operations-section .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .cache-panel .table-responsive::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.cache-panel .stat-card,
.cache-panel .card {
  animation: fadeIn 0.3s ease;
}

/* Custom Scrollbar */
.cache-panel .table-responsive::-webkit-scrollbar {
  height: 8px;
}

.cache-panel .table-responsive::-webkit-scrollbar-track {
  background: var(--bs-light);
  border-radius: 4px;
}

.cache-panel .table-responsive::-webkit-scrollbar-thumb {
  background: var(--bs-secondary);
  border-radius: 4px;
}

.cache-panel .table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--bs-primary);
}
