/* ==========================================
   DARK TECH DESIGN SYSTEM & CUSTOM STYLES
   Project: PESTEL Analysis App
   Theme: Midnight Gold (ABC training Logo Match)
   Author: Lic. Victor Elias Sellis Zeballos
   Client: Consultora ABC training
   ========================================== */

/* Variables */
:root {
  --primary: #f9b233; /* Logo gold-yellow */
  --primary-glow: rgba(249, 178, 51, 0.35);
  --primary-light: rgba(249, 178, 51, 0.08);
  --primary-dark: #0f1219;
  --accent: #e67e22; /* Logo orange-accent */
  --accent-glow: rgba(230, 126, 34, 0.25);
  --bg-app: #06080c; /* Futuristic deep dark black */
  --card-bg: rgba(13, 17, 24, 0.78); /* Translucent obsidian glass */
  --text-main: #f3f4f6; /* Off-white */
  --text-muted: #9ca3af; /* Muted gray */
  --border-color: rgba(249, 178, 51, 0.16);
  --border-focus: #f9b233;
  --shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.7);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Background Glowing Circles (Technological Vibe) */
.decor-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  z-index: 0;
  opacity: 0.25;
  pointer-events: none;
}
.circle-1 {
  width: 500px;
  height: 500px;
  background-color: var(--primary);
  top: -150px;
  right: -50px;
}
.circle-2 {
  width: 600px;
  height: 600px;
  background-color: var(--accent);
  bottom: -200px;
  left: -150px;
}
.circle-3 {
  width: 400px;
  height: 400px;
  background-color: #3b82f6; /* Tech blue accent */
  top: 35%;
  left: 25%;
  opacity: 0.15;
}

/* Layout container */
.app-container {
  width: 100%;
  max-width: 950px;
  padding: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header Branding */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(249, 178, 51, 0.4));
}
.header-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.header-authors {
  display: flex;
  gap: 12px;
}
.author-tag {
  background: rgba(249, 178, 51, 0.08);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

/* Progress Indicator */
.progress-container {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.progress-bar-wrapper {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  box-shadow: 0 0 10px var(--primary-glow);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.steps-indicator {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.step-label {
  position: relative;
  transition: var(--transition);
  cursor: default;
}
.step-label.active {
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
  transform: scale(1.05);
}
.step-label.completed {
  color: var(--accent);
}

/* Main Card Window (Glassmorphism dark) */
.card-container {
  background-color: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: min-height 0.4s ease;
}

/* Screen transition helpers */
.screen-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.screen-section.hidden {
  display: none !important;
  opacity: 0;
}

/* Typography elements */
.main-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.5px;
}
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}
.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: -12px;
}
.author-credits {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 400;
}
.author-credits strong {
  color: var(--primary);
  text-shadow: 0 0 6px rgba(249, 178, 51, 0.2);
}

/* Welcome page specific */
.welcome-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.welcome-logo {
  height: 110px;
  width: auto;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 15px rgba(249, 178, 51, 0.35));
  animation: floatLogo 4s ease-in-out infinite;
}
@keyframes floatLogo {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.badge-consultora {
  background-color: var(--primary-light);
  border: 1px solid var(--border-color);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper.no-icon input {
  padding-left: 18px; /* No icon padding reset */
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 1rem;
  color: #ffffff;
  background-color: rgba(18, 22, 32, 0.7);
  transition: var(--transition);
}
input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(249, 178, 51, 0.15);
  background-color: rgba(24, 30, 44, 0.9);
}

select option {
  background-color: #0d1118;
  color: #ffffff;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }

.helper-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -2px;
}
.badge-optional {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Buttons */
.actions-wrapper {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  justify-content: flex-end;
}
.actions-wrapper.text-center {
  justify-content: center;
}
.actions-wrapper.flex-between {
  justify-content: space-between;
}

.btn {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #06080c;
  box-shadow: 0 8px 20px rgba(249, 178, 51, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(249, 178, 51, 0.35);
  filter: brightness(1.1);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.btn-secondary:hover {
  background-color: rgba(259, 178, 51, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-large {
  padding: 16px 40px;
  font-size: 1.1rem;
  border-radius: var(--radius-md);
}
.btn-arrow {
  transition: transform 0.2s ease;
}
.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* PESTEL Wizard specific styles */
.factor-header-wrapper {
  display: flex;
  gap: 20px;
  align-items: center;
}
.factor-badge {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background-color: var(--primary);
  color: #06080c;
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(249, 178, 51, 0.3);
}

/* Analysis Card */
.analysis-card {
  background: rgba(18, 22, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-tag {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--primary);
  color: #06080c;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}
.analysis-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 10px;
}
.timeline-block {
  display: flex;
  gap: 16px;
  position: relative;
}
.timeline-block:first-child::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: -24px;
  width: 2px;
  background-color: rgba(255, 255, 255, 0.08);
}
.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.timeline-dot.present {
  background-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.timeline-dot.future {
  background-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1);
}
.timeline-content h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.timeline-content p {
  font-size: 0.95rem;
  color: var(--text-main);
  text-align: justify;
}

/* Simulated AI typing effect */
.loading-text {
  color: var(--text-muted);
  font-style: italic;
}

/* Evaluation section */
.evaluation-container {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 24px;
}
.eval-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}
.eval-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.rating-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.rating-group {
  display: grid;
  grid-template-columns: 140px 1fr 120px;
  align-items: center;
  gap: 16px;
}
.rating-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}
.rating-options {
  display: flex;
  gap: 12px;
}
.rating-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(18, 22, 32, 0.8);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rating-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}
.rating-options .rating-btn.selected {
  color: #06080c !important;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.rating-options[data-rating-type] .rating-btn.selected[data-val="1"] {
  background-color: #ff4d4d;
  border-color: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}
.rating-options[data-rating-type] .rating-btn.selected[data-val="2"] {
  background-color: #ff9f43;
  border-color: #ff9f43;
  box-shadow: 0 0 10px rgba(255, 159, 67, 0.4);
}
.rating-options[data-rating-type] .rating-btn.selected[data-val="3"] {
  background-color: #eedd82;
  border-color: #eedd82;
  box-shadow: 0 0 10px rgba(238, 221, 130, 0.4);
}
.rating-options[data-rating-type] .rating-btn.selected[data-val="4"] {
  background-color: #2ed573;
  border-color: #2ed573;
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.4);
}
.rating-options[data-rating-type] .rating-btn.selected[data-val="5"] {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.rating-desc-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

.justification-group {
  margin-top: 10px;
}

/* RESULTS SCREEN STYLING (Futuristic Dashboard) */
.table-scroll-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.pestel-summary-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: #0b0f16;
  font-size: 0.95rem;
}

.table-main-header {
  background-color: var(--primary);
  color: #06080c;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 16px 20px;
  letter-spacing: 0.5px;
}

.pestel-summary-table th {
  padding: 14px 16px;
  background-color: #10141e;
  color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 700;
}

.hdr-desc {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.rating-col {
  text-align: center;
  width: 80px;
  vertical-align: middle;
}
.val-header {
  text-align: center;
  width: 95px;
}

.pestel-summary-table td {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.factor-cell-letter {
  width: 44px;
  text-align: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #06080c;
  background-color: var(--primary);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
}
.factor-cell-name {
  font-weight: 600;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.01);
  width: 200px;
}
.factor-cell-type {
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 70px;
  text-transform: uppercase;
  font-weight: 600;
}

.cell-rating-value {
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Coloring of active matrix points */
.cell-rating-value.active-val-1 { color: #ff4d4d; background-color: rgba(255, 77, 77, 0.08); }
.cell-rating-value.active-val-2 { color: #ff9f43; background-color: rgba(255, 159, 67, 0.08); }
.cell-rating-value.active-val-3 { color: #eedd82; background-color: rgba(238, 221, 130, 0.08); }
.cell-rating-value.active-val-4 { color: #2ed573; background-color: rgba(46, 213, 115, 0.08); }
.cell-rating-value.active-val-5 { color: var(--primary); background-color: rgba(249, 178, 51, 0.08); }

.cell-avg-val {
  text-align: center;
  font-weight: 800;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.02);
}
.cell-pct-val {
  text-align: center;
  font-weight: 800;
  color: var(--primary);
  background-color: rgba(249, 178, 51, 0.03);
}

/* Table Footer / Averages */
.average-row {
  background-color: #0b0f16;
}
.avg-label-cell {
  font-weight: 800;
  color: #ffffff;
  text-align: right;
  border-right: 2px solid rgba(255, 255, 255, 0.08);
  font-size: 1rem;
}
.avg-sub-row {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.avg-bars-cell {
  position: relative;
  padding: 12px !important;
}
.avg-visual-indicator {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  box-shadow: 0 0 8px var(--primary-glow);
  width: 0%;
  transition: width 0.6s ease;
}
.avg-val-cell {
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
}
.avg-pct-cell {
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}

/* Strategic Interpretation Card */
.interpretation-card {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow);
}
.interpretation-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}
.interpretation-content {
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: justify;
}
.interpretation-content p strong {
  color: var(--primary);
}

/* Footer branding */
.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

/* Animations */
.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}
.animate-slide-up {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide classes */
.hidden {
  display: none !important;
}

/* Responsive adjust */
@media (max-width: 768px) {
  .app-container {
    padding: 12px;
  }
  .card-container {
    padding: 24px;
  }
  .grid-form {
    gap: 12px;
  }
  .col-6 {
    grid-column: span 12;
  }
  .rating-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .rating-desc-text {
    text-align: left;
    margin-top: -4px;
    font-size: 0.8rem;
  }
  .actions-wrapper {
    flex-direction: column-reverse;
  }
  .btn {
    width: 100%;
  }
}
