/**
 * Fix Accordion Styles - Shared between Performance and Security pages
 * Professional card-based recommendations UI
 */

/* Performance Fixes Accordion Styles */
.fix-accordion {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.fix-accordion.severity-critical {
  border-left: 4px solid #ef4444;
}

.fix-accordion.severity-high {
  border-left: 4px solid #f97316;
}

.fix-accordion.severity-medium {
  border-left: 4px solid #f59e0b;
}

.fix-accordion.severity-low {
  border-left: 4px solid #3b82f6;
}

.fix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.fix-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fix-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.fix-icon {
  font-size: 1.5rem;
  min-width: 1.5rem;
}

.fix-title-group {
  flex: 1;
}

.fix-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.25rem 0;
}

.fix-subtitle {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

.fix-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fix-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.fix-badge.priority-critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.fix-badge.priority-high { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.fix-badge.priority-medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.fix-badge.priority-low { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.fix-badge.category { background: rgba(255, 255, 255, 0.1); color: #aaa; }
.fix-badge.location { background: rgba(99, 102, 241, 0.12); color: #818cf8; letter-spacing: 0; text-transform: none; }

.fix-expand-icon {
  font-size: 1.25rem;
  color: #666;
  transition: transform 0.3s ease;
  margin-left: 1rem;
}

.fix-accordion.expanded .fix-expand-icon {
  transform: rotate(180deg);
}

.fix-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.fix-content-inner {
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
}

/* Tab Navigation */
.fix-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
}

.fix-tab {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.fix-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.fix-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.fix-tab-content {
  display: none;
}

.fix-tab-content.active {
  display: block;
  animation: fixFadeIn 0.3s ease;
}

@keyframes fixFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Code Blocks */
.code-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

@media (max-width: 768px) {
  .code-comparison {
    grid-template-columns: 1fr;
  }
}

.code-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.code-block-header {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-block-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-block-title.error { color: #ef4444; }
.code-block-title.success { color: #22c55e; }

.code-block-body {
  padding: 1rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-x: auto;
  color: #e0e0e0;
}

.code-block pre {
  margin: 0;
  white-space: pre;
}

.code-annotation {
  color: #888;
  font-style: italic;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

/* Action Buttons */
.fix-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.fix-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.fix-btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark, var(--accent-primary)));
  color: var(--accent-primary-contrast, #000);
}

.fix-btn-primary:hover {
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
  transform: translateY(-1px);
}

.fix-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.fix-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Resources List */
.resources-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.resource-item {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.resource-item code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--accent-primary);
}

.resource-size {
  color: #f59e0b;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Impact Indicator */
.impact-indicator {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(var(--accent-primary-rgb), 0.05);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
  border-radius: 8px;
  margin-top: 1rem;
}

.impact-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.impact-label {
  font-size: 0.85rem;
  color: #aaa;
}

/* Pro Features */
.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 3px 8px;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.pro-step {
  opacity: 0.6;
  position: relative;
  padding-left: 2rem;
}

.pro-step::before {
  content: '🔒';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.9rem;
}

.pro-overlay {
  position: relative;
}

.pro-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.8) 100%);
  pointer-events: none;
}

.pro-unlock-banner {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 170, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pro-unlock-text {
  flex: 1;
}

.pro-unlock-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffd700;
  margin: 0 0 0.25rem 0;
}

.pro-unlock-desc {
  font-size: 0.8rem;
  color: #aaa;
  margin: 0;
}

.pro-unlock-btn {
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pro-unlock-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.pro-code-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Light theme adjustments */
body.white-theme .fix-accordion {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
}

body.white-theme .fix-header:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.white-theme .fix-title {
  color: #1a1a1a;
}

body.white-theme .fix-subtitle {
  color: #666;
}

body.white-theme .fix-tab {
  color: #666;
}

body.white-theme .fix-tab:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.03);
}

body.white-theme .fix-tab-content p {
  color: #333;
}

body.white-theme .code-block {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

body.white-theme .code-block-body {
  color: #333;
}

body.white-theme .fix-btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  border-color: rgba(0, 0, 0, 0.15);
}

body.white-theme .resource-item {
  background: rgba(0, 0, 0, 0.02);
}

body.white-theme .impact-indicator {
  background: rgba(var(--accent-primary-rgb), 0.08);
}

body.white-theme .impact-label {
  color: #666;
}
