/**
 * PROFESSIONAL Bottleneck Calculator Styles
 * Competitor-matching UI with brand colors and theme-safe implementation
 */

/* NAMESPACE ALL STYLES TO PREVENT THEME CONFLICTS */
.bottleneck-calculator-container,
.bottleneck-calculator-container *,
.bottleneck-results-container,
.bottleneck-results-container * {
  box-sizing: border-box !important;
}

/* RESET STYLES TO PREVENT THEME INTERFERENCE */
.bottleneck-calculator-container,
.bottleneck-results-container {
  all: initial;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif !important;
  line-height: 1.6 !important;
  color: #1f2937 !important;
}

/* CALCULATOR FORM STYLES */
.bottleneck-calculator-container {
  max-width: 800px !important;
  margin: 0 auto !important;
  padding: 20px !important;
  background: transparent !important;
}

.bottleneck-calculator-form {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 16px !important;
  padding: 32px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.bottleneck-form-group {
  margin-bottom: 28px !important;
  position: relative !important;
}

.bottleneck-form-group label {
  display: block !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  margin-bottom: 10px !important;
  color: #1f2937 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* PROFESSIONAL SHADOW DOM HOST CONTAINERS */
.professional-dropdown-host {
  width: 100% !important;
  min-height: 60px !important;
  position: relative !important;
  display: block !important;
}

/* PROFESSIONAL SELECT STYLING */
.professional-select {
  width: 100% !important;
  padding: 16px 48px 16px 20px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 12px !important;
  background-color: #ffffff !important;
  color: #1f2937 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="10" viewBox="0 0 16 10"><path d="M2 2l6 6 6-6" stroke="%236b7280" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
}

.professional-select:focus {
  outline: none !important;
  border-color: #012e40 !important;
  box-shadow: 0 0 0 3px rgba(1, 46, 64, 0.1) !important;
}

.professional-select:hover {
  border-color: #012e40 !important;
  box-shadow: 0 4px 12px 0 rgba(1, 46, 64, 0.15) !important;
}

/* WORKLOAD DESCRIPTION */
.bottleneck-workload-description {
  margin-top: 12px !important;
  font-size: 14px !important;
  color: #6b7280 !important;
  font-style: italic !important;
  padding: 12px 16px !important;
  background-color: #f9fafb !important;
  border-radius: 8px !important;
  border-left: 4px solid #012e40 !important;
}

/* PROFESSIONAL CALCULATE BUTTON */
.professional-calculate-btn {
  width: 100% !important;
  padding: 18px 24px !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #012e40 0%, #024959 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 14px 0 rgba(1, 46, 64, 0.3) !important;
  margin-top: 12px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.professional-calculate-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #024959 0%, #026773 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px 0 rgba(1, 46, 64, 0.4) !important;
}

.professional-calculate-btn:disabled,
.professional-calculate-btn.disabled {
  background: #9ca3af !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

.professional-calculate-btn:active:not(:disabled) {
  transform: translateY(0) !important;
}

/* RESULTS PAGE STYLES - COMPETITOR MATCHING LAYOUT */
.bottleneck-results-container {
  max-width: 800px !important;
  margin: 0 auto !important;
  padding: 20px !important;
  background: transparent !important;
}

/* 1. TOP-LEVEL BOTTLENECK STATUS BANNER */
.bottleneck-status-banner {
  text-align: center !important;
  margin-bottom: 32px !important;
  padding: 24px !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1) !important;
}

.bottleneck-status-banner.balanced {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  border: 2px solid #10b981 !important;
}

.bottleneck-status-banner.cpu,
.bottleneck-status-banner.gpu,
.bottleneck-status-banner.extreme {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%) !important;
  border: 2px solid #ef4444 !important;
}

.bottleneck-status-banner.vram,
.bottleneck-status-banner.ram {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 2px solid #f59e0b !important;
}

.status-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
}

.status-icon {
  font-size: 24px !important;
  line-height: 1 !important;
}

.status-text {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  margin: 0 !important;
}

/* 2. COMPONENT CARDS GRID */
.component-cards-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 24px !important;
  margin-bottom: 24px !important;
}

.component-card {
  background: #ffffff !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 16px !important;
  padding: 24px !important;
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.05) !important;
  transition: all 0.2s ease !important;
}

.component-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.1) !important;
  border-color: #012e40 !important;
}

.card-header {
  margin-bottom: 16px !important;
}

.card-header h3,
.card-header h2 {
  font-size: 20px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: #1f2937 !important;
  text-align: center !important;
}

.component-image-container {
  width: 160px !important;
  height: 160px !important;
  margin: 0 auto 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #f9fafb !important;
}

.component-image {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 8px !important;
}

.component-image-link {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.component-placeholder {
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #6b7280 !important;
  border-radius: 8px !important;
}

.component-details {
  text-align: center !important;
  margin-bottom: 16px !important;
}

.component-name {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  margin-bottom: 8px !important;
  line-height: 1.4 !important;
}

.component-stat {
  font-size: 14px !important;
  color: #6b7280 !important;
  margin-bottom: 4px !important;
  font-weight: 500 !important;
}

.component-buy-section {
  text-align: center !important;
}

.professional-buy-btn {
  display: inline-block !important;
  padding: 10px 20px !important;
  background: linear-gradient(135deg, #012e40 0%, #024959 100%) !important;
  color: white !important;
  text-decoration: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  border: none !important;
}

.professional-buy-btn:hover {
  background: linear-gradient(135deg, #024959 0%, #026773 100%) !important;
  color: white !important;
  text-decoration: none !important;
  transform: translateY(-1px) !important;
}

/* 3. RESOLUTION AND WORKLOAD BLOCKS */
.resolution-block,
.workload-block {
  background: #ffffff !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 16px !important;
  padding: 24px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.05) !important;
  text-align: center !important;
}

.resolution-content,
.workload-content {
  text-align: center !important;
}

.resolution-value,
.workload-name {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  margin-bottom: 8px !important;
}

.vram-requirement,
.workload-description {
  font-size: 14px !important;
  color: #6b7280 !important;
  font-style: italic !important;
  margin: 0 !important;
}

/* 5. PERFORMANCE ANALYSIS SECTION */
.performance-analysis-section {
  background: #ffffff !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 16px !important;
  padding: 32px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.05) !important;
}

.performance-analysis-section .card-header h2 {
  font-size: 24px !important;
  text-align: left !important;
  margin-bottom: 24px !important;
}

/* CLEAR RESULT STATEMENT (like competitor) */
.result-statement {
  margin-bottom: 24px !important;
}

.result-statement p {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #374151 !important;
  margin: 0 !important;
  text-align: center !important;
}

/* 6. BOTTLENECK BAR VISUAL (horizontal black bar like competitor) */
.bottleneck-visual-container {
  margin-bottom: 24px !important;
}

.bottleneck-progress-bar-container {
  height: 40px !important;
  background-color: #f3f4f6 !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  margin-bottom: 12px !important;
  position: relative !important;
}

.bottleneck-progress-bar {
  height: 100% !important;
  background: linear-gradient(90deg, #1f2937 0%, #374151 100%) !important;
  border-radius: 20px !important;
  transition: width 0.8s ease !important;
}

.bottleneck-labels {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
}

/* 7. ESTIMATED BOTTLENECK % (clear bold number) */
.bottleneck-percentage-highlight {
  text-align: center !important;
  margin-bottom: 24px !important;
}

.percentage-number {
  font-size: 28px !important;
  font-weight: 800 !important;
  margin: 0 !important;
}

.percentage-number.low {
  color: #10b981 !important;
}

.percentage-number.medium {
  color: #f59e0b !important;
}

.percentage-number.high {
  color: #ef4444 !important;
}

/* 8. SYSTEM WARNINGS */
.system-warnings {
  margin-bottom: 24px !important;
}

.warning-box {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 16px 20px !important;
  border-radius: 12px !important;
  margin-bottom: 12px !important;
  font-weight: 500 !important;
}

.vram-warning,
.ram-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 2px solid #f59e0b !important;
  color: #92400e !important;
}

.warning-icon {
  font-size: 20px !important;
  line-height: 1 !important;
}

.warning-text {
  font-size: 15px !important;
  margin: 0 !important;
}

/* EXPLANATION AND RECOMMENDATION */
.bottleneck-explanation {
  margin-bottom: 24px !important;
}

.bottleneck-explanation p {
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: #6b7280 !important;
  margin-bottom: 12px !important;
}

.bottleneck-explanation p:last-child {
  margin-bottom: 0 !important;
}

.bottleneck-explanation strong {
  color: #1f2937 !important;
  font-weight: 600 !important;
}

.recommendation-section {
  text-align: center !important;
  padding: 20px !important;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-radius: 12px !important;
  border-left: 4px solid #012e40 !important;
}

.recommendation-section h3 {
  font-size: 18px !important;
  font-weight: 700 !important;
  margin: 0 0 12px 0 !important;
  color: #1f2937 !important;
}

.recommendation-section p {
  font-size: 16px !important;
  color: #374151 !important;
  margin: 0 !important;
  font-weight: 500 !important;
}

/* 10. CALCULATE AGAIN BUTTON */
.calculate-again-section {
  text-align: center !important;
}

.professional-calculate-again-btn {
  display: inline-block !important;
  padding: 18px 48px !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #012e40 0%, #024959 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 14px 0 rgba(1, 46, 64, 0.3) !important;
}

.professional-calculate-again-btn:hover {
  background: linear-gradient(135deg, #024959 0%, #026773 100%) !important;
  color: #ffffff !important;
  text-decoration: none !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px 0 rgba(1, 46, 64, 0.4) !important;
}

.professional-calculate-again-btn:visited,
.professional-calculate-again-btn:focus,
.professional-calculate-again-btn:active {
  text-decoration: none !important;
  color: #ffffff !important;
}

/* ERROR STATES */
.bottleneck-results-error {
  text-align: center !important;
  padding: 32px !important;
  font-size: 18px !important;
  color: #ef4444 !important;
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%) !important;
  border-radius: 12px !important;
  border: 2px solid #ef4444 !important;
  font-weight: 500 !important;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .component-cards-grid {
    grid-template-columns: 1fr !important;
  }

  .bottleneck-calculator-form {
    padding: 24px !important;
  }

  .professional-calculate-btn {
    padding: 16px 20px !important;
    font-size: 16px !important;
  }

  .professional-dropdown-host {
    min-height: 56px !important;
  }

  .status-text {
    font-size: 20px !important;
  }

  .component-image-container {
    width: 120px !important;
    height: 120px !important;
  }

  .performance-analysis-section {
    padding: 24px !important;
  }

  .professional-calculate-again-btn {
    padding: 16px 32px !important;
    font-size: 16px !important;
  }
}

/* ELEMENTOR AND THEME COMPATIBILITY */
.elementor-widget-shortcode .bottleneck-calculator-container *,
.elementor-widget-shortcode .bottleneck-results-container * {
  box-sizing: border-box !important;
}

.bottleneck-calculator-container .bottleneck-form-group,
.bottleneck-results-container .component-card {
  overflow: visible !important;
  height: auto !important;
}

.bottleneck-calculator-container label,
.bottleneck-results-container h3 {
  height: auto !important;
  overflow: visible !important;
  line-height: 1.4 !important;
}

/* PREVENT WORDPRESS THEME INTERFERENCE */
.bottleneck-calculator-container input,
.bottleneck-calculator-container select,
.bottleneck-calculator-container button {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

/* HIDE ORIGINAL ELEMENTS THAT MIGHT CONFLICT */
input[type="hidden"] {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* ENSURE PROPER STACKING */
.bottleneck-calculator-container,
.bottleneck-results-container {
  position: relative !important;
  z-index: 1 !important;
}
