/* ================================================
   Playground Pages Styles
   Consistent styling for all admin playground pages
   ================================================ */

/* Base Playground Styles */
.page-playground {
  background: #f8f9fa;
  min-height: calc(100vh - 200px);
}

/* Compact Page Header */
.page-heading--compact {
  padding: 2rem 0;
  background: white;
  border-bottom: 1px solid #e3e6f0;
  margin-bottom: 0;
}

.page-heading--compact .page-heading__title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.page-heading--compact .breadcrumb {
  margin-bottom: 0;
  background: transparent;
  padding: 0;
}

/* Playground Content Area */
.playground-content {
  padding: 2rem 0 3rem;
}

.playground-header {
  background: white;
  border: 1px solid #e3e6f0;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border: 1px solid #e3e6f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0,123,255,0.1);
  transform: translateY(-2px);
}

.stat-card__icon {
  color: #667eea;
  background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
  padding: 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.stat-card__content {
  flex: 1;
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card__label {
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Playground Cards */
.playground-card {
  border: 1px solid #e3e6f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border-radius: 0.5rem;
  overflow: hidden;
}

.playground-card .card-header {
  background: white;
  border-bottom: 2px solid #f8f9fa;
  padding: 1.25rem;
}

.playground-card .card-body {
  padding: 1.5rem;
}

/* Tab Navigation in Cards */
.playground-card .nav-tabs {
  border-bottom: 2px solid #e3e6f0;
}

.playground-card .nav-tabs .nav-link {
  color: #6c757d;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.playground-card .nav-tabs .nav-link:hover {
  color: #495057;
  border-bottom-color: #dee2e6;
}

.playground-card .nav-tabs .nav-link.active {
  color: #007bff;
  background: transparent;
  border-bottom-color: #007bff;
}

/* Code Snippets */
.code-snippet-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.code-snippet {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.5rem;
  font-size: 0.75rem;
  overflow-x: auto;
  margin-bottom: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Copy Button */
.btn-icon-copy {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.25rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-icon-copy:hover {
  background: #007bff;
  border-color: #007bff;
  color: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.btn-icon-copy.copied {
  background: #28a745 !important;
  border-color: #28a745 !important;
  color: white !important;
  opacity: 1 !important;
}

.code-snippet-wrapper:hover .btn-icon-copy,
.btn-icon-copy:focus {
  opacity: 1;
}

/* Icon Preview Areas */
#icon-preview {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

#icon-preview:hover {
  border-color: #007bff;
  background: white;
}

/* Responsive Grid */
@media (max-width: 1199px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 767px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card__icon {
    min-width: 48px;
    padding: 0.5rem;
  }
  
  .stat-card__value {
    font-size: 1.25rem;
  }
}

@media (max-width: 575px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .page-heading--compact {
    padding: 1.5rem 0;
  }
  
  .page-heading--compact .page-heading__title {
    font-size: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .code-snippet {
    font-size: 0.65rem;
    padding: 0.375rem;
  }
  
  .btn-icon-copy {
    width: 24px;
    height: 24px;
    right: 0.25rem;
  }
}

/* Loading States */
.playground-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: #6c757d;
}

.playground-loading::after {
  content: "";
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 1rem;
}

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

/* Empty States */
.playground-empty {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.playground-empty__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.playground-empty__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.playground-empty__text {
  font-size: 0.925rem;
}

/* Utility Classes */
.playground-mb-1 { margin-bottom: 0.5rem !important; }
.playground-mb-2 { margin-bottom: 1rem !important; }
.playground-mb-3 { margin-bottom: 1.5rem !important; }
.playground-mb-4 { margin-bottom: 2rem !important; }
.playground-mt-1 { margin-top: 0.5rem !important; }
.playground-mt-2 { margin-top: 1rem !important; }
.playground-mt-3 { margin-top: 1.5rem !important; }
.playground-mt-4 { margin-top: 2rem !important; }