/**
 * PSU Wattage Calculator - Obsidian & Titanium Theme
 * Industrial Pro Dark Palette, High Contrast, Precision Layout
 */

:root {
  /* Obsidian & Titanium Industrial Dark Palette */
  --bg-primary: #0f1115;
  --bg-secondary: #14171c;
  --bg-card: #181b20;
  --bg-card-hover: #1e2229;
  --bg-input: #121418;
  --bg-input-focus: #1a1e24;
  --bg-badge: #242830;
  
  --border-color: #242830;
  --border-subtle: #1c2026;
  --border-focus: #06b6d4;
  --border-active: rgba(6, 182, 212, 0.4);

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-bright: #ffffff;
  
  /* Precision Accents */
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.15);
  --accent-mint: #10b981;
  --accent-mint-glow: rgba(16, 185, 129, 0.15);
  --accent-orange: #f59e0b;
  --accent-orange-glow: rgba(245, 158, 11, 0.15);
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-highlight: 0 0 25px rgba(6, 182, 212, 0.12);
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 0%, rgba(6, 182, 212, 0.05) 0px, transparent 40%),
    radial-gradient(at 90% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 40%),
    linear-gradient(180deg, #0f1115 0%, #12151a 100%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Arabic Font Override */
[lang="ar"] body, [dir="rtl"] body {
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #242830;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* Container */
.container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem;
}

/* Header */
.app-header {
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.6rem 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #181b20, #242830);
  border: 1px solid #333945;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.brand-titles h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.brand-titles p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-version {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  background: #242830;
  border: 1px solid #333945;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Language Toggle Button */
.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.825rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--text-bright);
}

/* Buttons */
.btn-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: var(--bg-card-hover);
  border-color: #475569;
  color: var(--text-bright);
}

.btn-primary {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border: 1px solid #22d3ee;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #06b6d4, #0e7490);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-red);
  color: #ffffff;
}

/* Preset Builds Bar */
.preset-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.preset-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.preset-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-preset {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-preset:hover {
  background: #1e2229;
  border-color: var(--accent-cyan);
  color: var(--text-bright);
  transform: translateY(-1px);
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Builder Sections & Cards */
.builder-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: #333945;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.025rem;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: #121418;
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
}

/* Form Controls */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

select, input[type="text"], input[type="number"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

select option {
  background: #181b20;
  color: #f1f5f9;
  padding: 0.5rem;
}

/* Switch & Toggles */
.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #242830;
  transition: .2s;
  border-radius: 22px;
  border: 1px solid #333945;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #0891b2;
  border-color: #22d3ee;
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

/* RAM Form Row with optimized proportions */
.ram-form-row {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.9rem;
}

@media (max-width: 640px) {
  .ram-form-row {
    grid-template-columns: 1fr;
  }
}

/* Number Counter Steppers (Enhanced Click Area & Hitbox) */
.stepper-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.stepper-group:last-child {
  border-bottom: none;
}

.stepper-label-info {
  display: flex;
  flex-direction: column;
  padding-right: 0.5rem;
}

[dir="rtl"] .stepper-label-info {
  padding-right: 0;
  padding-left: 0.5rem;
}

.stepper-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.stepper-subtitle {
  font-size: 0.725rem;
  color: var(--text-dim);
}

.stepper-control {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-step {
  background: #181b21;
  border: none;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-step:hover {
  background: #242a34;
  color: var(--accent-cyan);
}

.btn-step:active {
  transform: scale(0.92);
  background: var(--accent-cyan);
  color: #0f1115;
}

.step-value {
  width: 38px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-bright);
  font-feature-settings: "tnum";
}

/* Checkbox Items & Grid Layout */
.peripherals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

@media (max-width: 640px) {
  .peripherals-grid {
    grid-template-columns: 1fr;
  }
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: #121418;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  min-height: 46px;
}

.checkbox-card:hover {
  background: #16191f;
  border-color: #333945;
}

.checkbox-card input[type="checkbox"],
.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0;
  cursor: pointer;
  user-select: none;
}

.checkbox-label {
  font-size: 0.825rem;
  color: var(--text-main);
  line-height: 1.3;
}

/* Custom Overrides Box */
.custom-override-box {
  background: rgba(18, 20, 24, 0.7);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin-top: 0.6rem;
  display: none;
}

.custom-override-box.active {
  display: block;
}

/* Range Slider */
.range-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
}

.range-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #242830;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.6);
  border: 2px solid #181b20;
}

.range-value {
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 45px;
  text-align: right;
}

/* Summary Sidebar */
.summary-sidebar {
  position: sticky;
  top: 4.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--accent-cyan);
  box-shadow: var(--shadow-card);
}

/* Main Power Highlight Box */
.power-highlight-box {
  text-align: center;
  padding: 1.1rem 0.5rem;
  background: #121418;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.power-val-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.power-val-number {
  font-size: 2.85rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
  font-feature-settings: "tnum";
}

.power-val-unit {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-left: 0.25rem;
}

/* Recommendation Box */
.recommendation-banner {
  background: linear-gradient(145deg, #161a22, #1b2028);
  border: 1px solid #2e3542;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.rec-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.rec-psu-watts {
  font-size: 2.4rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  line-height: 1.1;
}

/* 80 PLUS Badges */
.efficiency-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  font-weight: 700;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-gold {
  background: #2a2211;
  border: 1px solid #d97706;
  color: #fbbf24;
}

.badge-platinum {
  background: #202630;
  border: 1px solid #94a3b8;
  color: #f1f5f9;
}

.badge-titanium {
  background: #112826;
  border: 1px solid #14b8a6;
  color: #5eead4;
}

.badge-silver {
  background: #23272e;
  border: 1px solid #64748b;
  color: #cbd5e1;
}

.badge-bronze {
  background: #2b1d16;
  border: 1px solid #92400e;
  color: #f97316;
}

.badge-standard {
  background: #181b20;
  border: 1px solid #475569;
  color: #94a3b8;
}

/* Key Metrics List */
.metric-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.metric-item:last-child {
  border-bottom: none;
}

.metric-name {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.metric-val {
  font-weight: 700;
  color: var(--text-bright);
}

/* Prominent Transient Spikes */
.metric-val-spikes {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-orange);
  font-feature-settings: "tnum";
}

.metric-val-success {
  color: var(--accent-mint);
}

/* GPU Cables Highlight Box */
.gpu-cables-card {
  background: #121418;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  margin-top: 0.25rem;
  width: 100%;
}

.gpu-cables-badge {
  display: inline-block;
  font-size: 0.825rem;
  font-weight: 700;
  color: #38bdf8;
  word-break: break-word;
}

/* Power Distribution Breakdown Bar */
.breakdown-section {
  margin-top: 0.85rem;
}

.breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
}

.multi-progress-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: #121418;
  margin-bottom: 0.75rem;
}

.progress-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.breakdown-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  font-size: 0.785rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.legend-item b {
  color: var(--text-bright);
  font-weight: 700;
  margin-left: auto;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ATX 3.0 & Cable Compatibility Advisor Card */
.advisor-card {
  background: #14171d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.advisor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.advisor-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.advisor-badge {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.advisor-badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
}

.advisor-badge-mint {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.advisor-badge-orange {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.advisor-text {
  font-size: 0.785rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Recommended PSU Models Section */
.psu-models-section {
  background: #14171d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-top: 1rem;
}

.psu-models-header {
  margin-bottom: 0.65rem;
}

.psu-models-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.psu-models-subtitle {
  font-size: 0.725rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.psu-models-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.psu-model-item {
  background: #101216;
  border: 1px solid #232730;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.psu-model-item:hover {
  border-color: #384152;
  background: #15181e;
  transform: translateX(2px);
}

[dir="rtl"] .psu-model-item:hover {
  transform: translateX(-2px);
}

.psu-model-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.psu-model-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
}

.psu-tier-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  text-transform: uppercase;
}

.tier-budget {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tier-performance {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.psu-model-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.735rem;
  color: var(--text-muted);
  gap: 0.5rem;
}

.psu-model-rating {
  font-weight: 600;
  color: #cbd5e1;
}

.psu-model-modular {
  color: var(--text-dim);
}

/* Sidebar Actions */
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.sidebar-actions button {
  width: 100%;
  justify-content: center;
  padding: 0.7rem;
}

/* Modal Window (Export / Report) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
}

.report-preview-box {
  background: #0f1115;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.825rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.modal-footer {
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #181b20;
  border: 1px solid var(--border-focus);
  color: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* Hero Intro Text */
.hero-intro-wrapper {
  margin-bottom: 1.25rem;
}

.hero-intro {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.65;
  background: rgba(24, 27, 32, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  backdrop-filter: blur(4px);
}

.hero-intro strong {
  color: #f1f5f9;
  font-weight: 600;
}

/* SEO Educational Guide & FAQ Section */
.seo-guide-section {
  margin-top: 2rem;
  margin-bottom: 2.5rem;
}

.seo-guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-card);
}

@media (max-width: 768px) {
  .seo-guide-card {
    padding: 1.25rem;
  }
}

.seo-article-block {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.seo-article-block:last-of-type {
  border-bottom: none;
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}

.seo-article-block h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.35;
}

.seo-article-block p {
  font-size: 0.925rem;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.seo-article-block p:last-child {
  margin-bottom: 0;
}

.seo-features-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.seo-features-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 1.35rem;
  position: relative;
}

.seo-features-list li::before {
  content: "•";
  color: var(--accent-cyan);
  font-size: 1.2rem;
  font-weight: bold;
  position: absolute;
  left: 0.25rem;
  top: -0.1rem;
}

.seo-features-list li strong {
  color: var(--text-bright);
  font-weight: 600;
}

[dir="rtl"] .seo-features-list li {
  padding-left: 0;
  padding-right: 1.35rem;
}

[dir="rtl"] .seo-features-list li::before {
  left: auto;
  right: 0.25rem;
}

/* FAQ Section */
.seo-faq-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.seo-faq-section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
  text-align: center;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.15rem;
}

@media (max-width: 640px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

.faq-card {
  background: #121418;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.faq-card:hover {
  border-color: #384152;
  background: #16191f;
  transform: translateY(-2px);
}

.faq-card h3 {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.55rem;
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.faq-card h3::before {
  content: "Q.";
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.faq-card p {
  font-size: 0.865rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .power-val-unit {
  margin-left: 0;
  margin-right: 0.25rem;
}

[dir="rtl"] .range-value {
  text-align: left;
}

[dir="rtl"] .legend-item b {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .toast-notification {
  right: auto;
  left: 2rem;
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header, .preset-bar, .sidebar-actions, .modal-footer, .btn-action, .lang-btn, .app-footer {
    display: none !important;
  }
  .main-layout {
    display: block !important;
  }
  .card, .summary-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
  }
  .power-val-number, .rec-psu-watts {
    color: #000000 !important;
  }
}
