/* ============================================
   CFO54.ru - Component Styles
   Кнопки, карточки, формы и другие компоненты
   ============================================ */

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-family: var(--font-body);
  line-height: 1.5;
}

.btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  text-decoration: none;
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  text-decoration: none;
}

.btn-large {
  padding: 16px 32px;
  font-size: var(--text-lg);
}

.btn-small {
  padding: 8px 16px;
  font-size: var(--text-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--background);
  border-radius: 12px;
  padding: var(--space-xl);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 100%;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.card-content {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
}

.card-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.card-link {
  color: var(--primary-color);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Card with icon */
.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  color: var(--primary-color);
}

/* ============================================
   Links
   ============================================ */

.link-primary {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.link-primary:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.link-secondary {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.link-secondary:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Partner link styling */
.partner-block a {
  font-weight: var(--font-semibold);
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.partner-block a:hover {
  color: var(--secondary-dark);
  text-decoration: underline;
}

/* ============================================
   Forms & Inputs
   ============================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  font-weight: var(--font-medium);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--text-base);
  font-family: var(--font-body);
  border: 2px solid var(--border);
  border-radius: 8px;
  background-color: var(--background);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================
   Grid System
   ============================================ */

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   Article Components
   ============================================ */

.article-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg);
}

.article-header {
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.article-header h1 {
  margin-bottom: var(--space-md);
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
}

.article-meta {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: center;
}

.meta-separator {
  color: var(--text-muted);
}

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Article Body Sections */
article section {
  margin-bottom: var(--space-3xl);
}

article section.intro {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3xl);
}

article section h2 {
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
  font-size: var(--text-3xl);
  color: var(--text-primary);
}

article section h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  font-size: var(--text-2xl);
  color: var(--text-primary);
}

article section p {
  margin-bottom: var(--space-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

article section ul,
article section ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

article section li {
  margin-bottom: var(--space-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

article section blockquote {
  margin: var(--space-2xl) 0;
  padding: var(--space-lg) var(--space-xl);
  border-left: 4px solid var(--primary-color);
  background: var(--surface);
  border-radius: 8px;
  font-style: italic;
  color: var(--text-secondary);
}

article section blockquote p {
  margin-bottom: 0;
}

/* Practical Tips Section */
.practical-tips {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
  padding: var(--space-2xl);
  border-radius: 12px;
  margin: var(--space-3xl) 0;
}

.practical-tips h2 {
  text-align: center;
  color: var(--secondary-color);
  margin-bottom: var(--space-2xl);
}

.tips-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.tip-item {
  background: var(--background);
  padding: var(--space-lg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.tip-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tip-item h3 {
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.tip-item p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

/* Conclusion Section */
.conclusion {
  background: var(--surface);
  padding: var(--space-2xl);
  border-radius: 12px;
  border: 2px solid var(--border);
  margin: var(--space-3xl) 0;
}

.conclusion h2 {
  color: var(--primary-color);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.conclusion p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  text-align: center;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
}

.article-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
}

.article-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.article-content p {
  margin-bottom: var(--space-lg);
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-lg);
}

/* ============================================
   Partner Block
   ============================================ */

.partner-block {
  background: var(--surface);
  border-left: 4px solid var(--secondary-color);
  padding: var(--space-lg);
  border-radius: 8px;
  margin: var(--space-2xl) 0;
}

.partner-block h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.partner-block p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* ============================================
   Related Articles
   ============================================ */

.related-articles {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 2px solid var(--border);
}

.related-articles h3 {
  margin-bottom: var(--space-lg);
}

.related-articles ul {
  list-style: none;
  padding: 0;
}

.related-articles li {
  margin-bottom: var(--space-md);
}

.related-articles a {
  display: block;
  padding: var(--space-md);
  background: var(--surface);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-articles a:hover {
  background: var(--surface-dark);
  transform: translateX(4px);
}

/* ============================================
   Interactive Elements
   ============================================ */

.interactive-element {
  background: var(--surface);
  border-radius: 12px;
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
}

.interactive-element h3 {
  margin-bottom: var(--space-lg);
}

/* Quiz styles */
.quiz-progress {
  margin-bottom: var(--space-lg);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.quiz-question {
  margin-bottom: var(--space-xl);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.quiz-option {
  padding: var(--space-md);
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: var(--text-base);
}

.quiz-option:hover {
  border-color: var(--primary-color);
  background: var(--surface);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.quiz-feedback {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border-radius: 8px;
  font-weight: var(--font-medium);
}

.quiz-feedback.correct {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.quiz-feedback.incorrect {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Calculator styles */
.calc-input-group {
  margin-bottom: var(--space-lg);
}

.calc-button {
  width: 100%;
  margin-top: var(--space-md);
}

.calc-result {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--background);
  border-radius: 8px;
  border: 2px solid var(--primary-color);
}

.calc-result h4 {
  margin-bottom: var(--space-md);
  color: var(--primary-color);
}

.calc-result p {
  margin-bottom: var(--space-sm);
}

.calc-result strong {
  color: var(--primary-color);
  font-size: var(--text-lg);
}

/* ============================================
   Error Messages
   ============================================ */

.error-message {
  padding: var(--space-md);
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--error);
  border-radius: 4px;
  color: var(--error);
  margin: var(--space-md) 0;
}

.success-message {
  padding: var(--space-md);
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
  border-radius: 4px;
  color: var(--success);
  margin: var(--space-md) 0;
}

.info-message {
  padding: var(--space-md);
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--info);
  border-radius: 4px;
  color: var(--info);
  margin: var(--space-md) 0;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  padding: var(--space-4xl) 0 var(--space-3xl);
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero-text {
  text-align: center;
}

.hero h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-illustration {
  max-width: 600px;
  margin: 0 auto;
}

.hero-svg {
  width: 100%;
  height: auto;
}

/* Hero SVG Animations */
.chart-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s ease-out forwards;
}

.data-point {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.data-point:nth-child(6) { animation-delay: 0.4s; }
.data-point:nth-child(7) { animation-delay: 0.6s; }
.data-point:nth-child(8) { animation-delay: 0.8s; }
.data-point:nth-child(9) { animation-delay: 1s; }
.data-point:nth-child(10) { animation-delay: 1.2s; }

.bar-chart {
  transform: scaleY(0);
  transform-origin: bottom;
  animation: growBar 0.8s ease-out forwards;
}

.bar-chart:nth-child(12) { animation-delay: 0.2s; }
.bar-chart:nth-child(13) { animation-delay: 0.4s; }
.bar-chart:nth-child(14) { animation-delay: 0.6s; }
.bar-chart:nth-child(15) { animation-delay: 0.8s; }

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes growBar {
  to {
    transform: scaleY(1);
  }
}

/* ============================================
   Why Section
   ============================================ */

.why-section {
  padding: var(--space-4xl) 0;
  background: var(--background);
}

.section-title {
  text-align: center;
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  text-align: center;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
  line-height: var(--leading-relaxed);
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.why-card {
  background: var(--surface);
  border-radius: 12px;
  padding: var(--space-xl);
  text-align: center;
  transition: all 0.3s ease;
}

.why-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.why-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
}

.why-icon svg {
  width: 100%;
  height: 100%;
}

.why-card h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.why-card p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* Scroll-triggered reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Infographic Section
   ============================================ */

.infographic-section {
  padding: var(--space-4xl) 0;
  background: var(--surface);
}

.infographic-container {
  max-width: 800px;
  margin: 0 auto var(--space-3xl);
}

.cycle-infographic {
  width: 100%;
  height: auto;
}

/* Center circle pulse animation */
.center-circle {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Stage animations - sequential appearance */
.stage {
  opacity: 0;
  animation: fadeInScale 0.6s ease-out forwards;
}

.stage-1 { animation-delay: 0.3s; }
.stage-2 { animation-delay: 0.6s; }
.stage-3 { animation-delay: 0.9s; }
.stage-4 { animation-delay: 1.2s; }

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Arrow animations */
.arrow {
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

.arrow-1 { animation-delay: 0.5s; }
.arrow-2 { animation-delay: 0.8s; }
.arrow-3 { animation-delay: 1.1s; }
.arrow-4 { animation-delay: 1.4s; }
.arrow-5 { animation-delay: 1.7s; }

.arrow path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawArrow 0.5s ease-out forwards;
}

.arrow-1 path { animation-delay: 0.5s; }
.arrow-2 path { animation-delay: 0.8s; }
.arrow-3 path { animation-delay: 1.1s; }
.arrow-4 path { animation-delay: 1.4s; }
.arrow-5 path { animation-delay: 1.7s; }

@keyframes drawArrow {
  to {
    stroke-dashoffset: 0;
  }
}

/* Cycle description */
.cycle-description {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 700px;
  margin: 0 auto;
}

.cycle-step {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding: var(--space-lg);
  background: var(--background);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.cycle-step:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.cycle-step h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.cycle-step p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* ============================================
   Silos Section
   ============================================ */

.silos-section {
  padding: var(--space-4xl) 0;
  background: var(--background);
}

.silos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.silo-card {
  position: relative;
  display: block;
  background: var(--surface);
  border-radius: 16px;
  padding: var(--space-2xl);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  overflow: hidden;
}

.silo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.silo-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.silo-card:hover::before {
  transform: scaleX(1);
}

.silo-icon {
  font-size: 48px;
  margin-bottom: var(--space-lg);
  display: inline-block;
  transition: transform 0.3s ease;
}

.silo-card:hover .silo-icon {
  transform: scale(1.2) rotate(5deg);
}

.silo-card h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  transition: color 0.3s ease;
}

.silo-card:hover h3 {
  color: var(--primary-color);
}

.silo-card p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
}

.silo-link-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  transition: all 0.3s ease;
}

.silo-card:hover .silo-link-arrow {
  transform: translateX(8px);
  background: var(--primary-dark);
}

/* ============================================
   Calculator Section
   ============================================ */

.calculator-section {
  padding: var(--space-4xl) 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.calculator-widget {
  max-width: 900px;
  margin: 0 auto;
  background: var(--background);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.calculator-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.calculator-info {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: var(--space-2xl);
}

.calculator-info h3 {
  color: white;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

.calculator-info p {
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
  opacity: 0.95;
}

.calculator-info p:last-child {
  margin-bottom: 0;
}

.calculator-form {
  padding: var(--space-2xl);
}

.calc-input-group {
  margin-bottom: var(--space-xl);
}

.calc-input-group label {
  display: block;
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.calc-input-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: var(--text-base);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.calc-input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calc-input-group small {
  display: block;
  margin-top: var(--space-xs);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.calc-button {
  width: 100%;
  padding: 16px;
  font-size: var(--text-lg);
  margin-top: var(--space-lg);
}

.calc-result {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-radius: 12px;
  border: 2px solid var(--secondary-color);
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calc-result h4 {
  color: var(--secondary-dark);
  font-size: var(--text-xl);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: white;
  border-radius: 8px;
  margin-bottom: var(--space-md);
}

.result-label {
  color: var(--text-secondary);
  font-size: var(--text-base);
}

.result-value {
  color: var(--secondary-color);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
}

.result-unit {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-left: var(--space-xs);
}

.result-explanation {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: white;
  border-radius: 8px;
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
  text-align: center;
}

.result-explanation strong {
  color: var(--secondary-color);
  font-size: var(--text-lg);
}

/* ============================================
   Articles Section
   ============================================ */

.articles-section {
  padding: var(--space-4xl) 0;
  background: var(--background);
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

.article-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.article-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: var(--surface-dark);
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-content {
  padding: var(--space-xl);
}

.article-category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-color);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  margin-bottom: var(--space-md);
}

.article-card h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: var(--leading-tight);
  transition: color 0.3s ease;
}

.article-card:hover h3 {
  color: var(--primary-color);
}

.article-preview {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
}

.article-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: all 0.2s ease;
}

.article-link:hover {
  color: var(--primary-dark);
  transform: translateX(4px);
}

/* ============================================
   Interactive Quiz Component Styles
   ============================================ */

.interactive-quiz {
  background: var(--background);
  border-radius: 12px;
  padding: var(--space-xl);
}

.quiz-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--border);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.quiz-questions {
  min-height: 300px;
}

.quiz-question h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  line-height: var(--leading-normal);
}

.quiz-option {
  width: 100%;
  padding: var(--space-lg);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: var(--text-base);
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: var(--background);
  transform: translateX(4px);
}

.quiz-option:disabled {
  cursor: not-allowed;
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  font-weight: var(--font-medium);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.quiz-feedback {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border-radius: 8px;
  animation: slideIn 0.3s ease-out;
}

.feedback-correct {
  color: var(--success);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.feedback-incorrect {
  color: var(--error);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.explanation {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-top: var(--space-sm);
}

.quiz-results {
  text-align: center;
  padding: var(--space-2xl);
}

.quiz-results h3 {
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
}

.quiz-results .score {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--primary-color);
  margin-bottom: var(--space-md);
}

.score-percentage {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.performance-message {
  display: block;
  margin-top: var(--space-md);
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  color: var(--secondary-color);
}

.quiz-restart {
  margin-top: var(--space-xl);
}

/* ============================================
   Calculator Widget Component Styles
   ============================================ */

.calculator-widget {
  background: var(--background);
  border-radius: 12px;
  padding: var(--space-2xl);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.calculator-widget h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.calc-inputs {
  margin-bottom: var(--space-xl);
}

.calc-input-group {
  margin-bottom: var(--space-lg);
}

.calc-input-group label {
  display: block;
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-size: var(--text-base);
}

.calc-input-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: var(--text-base);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.calc-input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calc-input-group input.error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

.input-hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
}

.calc-button {
  width: 100%;
  padding: 16px;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

.calc-result {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-radius: 12px;
  border: 2px solid var(--primary-color);
  animation: slideIn 0.4s ease-out;
}

.calc-result h4 {
  color: var(--primary-color);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-lg);
  text-align: center;
}

#calc-result-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--background);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-label {
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
}

.result-value {
  color: var(--primary-color);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
}

.result-note {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--background);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  text-align: center;
  border-left: 4px solid var(--secondary-color);
}

/* ============================================
   Infographic Animator Component Styles
   ============================================ */

.infographic-container {
  position: relative;
  margin: var(--space-2xl) 0;
}

.animated-infographic {
  width: 100%;
  height: auto;
  max-width: 800px;
  margin: 0 auto;
  display: block;
}

.infographic-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.control-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  background: var(--background);
  color: var(--primary-color);
  font-size: var(--text-xl);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.control-btn:active {
  transform: scale(0.95);
}

/* SVG Animation Classes */
.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

.stage-circle {
  transition: all 0.6s ease-out;
}

.stage-circle.active {
  fill: var(--primary-color);
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.5));
}

.arrow-path {
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  marker-end: url(#arrowhead);
}

/* ============================================
   Utility Classes for Interactive Elements
   ============================================ */

.interactive-element {
  margin: var(--space-3xl) 0;
}

.interactive-element > h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.interactive-element > p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-xl);
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid var(--border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Disabled State */
.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

/* Focus Indicators for Interactive Elements */
.btn:focus-visible,
.quiz-option:focus-visible,
.control-btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
  border-radius: 8px;
}

.silo-card:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 16px;
}

.silo-card:focus:not(:focus-visible) {
  outline: none;
}

.article-card:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.article-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

.article-link:focus:not(:focus-visible) {
  outline: none;
}

/* Keyboard Navigation Indicators */
.quiz-option:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  background: var(--background);
}

.quiz-option[aria-checked="true"] {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }
  
  .card,
  .silo-card,
  .article-card {
    border: 2px solid var(--text-primary);
  }
  
  .quiz-option {
    border-width: 3px;
  }
}

/* Color Contrast Improvements */
.text-muted {
  color: #6c757d; /* WCAG AA compliant */
}

.article-meta {
  color: #6c757d; /* WCAG AA compliant */
}

/* Touch Target Size (Minimum 44x44px) */
.btn,
.quiz-option,
.control-btn,
.hamburger {
  min-height: 44px;
  min-width: 44px;
}

.article-link,
.silo-link-arrow {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Screen Reader Improvements */
.quiz-progress [role="progressbar"] {
  position: relative;
}

.quiz-progress [role="progressbar"]::before {
  content: attr(aria-valuenow) '%';
  position: absolute;
  left: -9999px;
}

/* Focus Management for Modals/Overlays */
.modal-overlay:focus {
  outline: none;
}

.modal-content:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .card,
  .silo-card,
  .article-card,
  .quiz-option,
  .control-btn {
    transition: none;
  }
  
  .hero-svg *,
  .cycle-infographic *,
  .animated-infographic * {
    animation: none !important;
  }
  
  .chart-line,
  .data-point,
  .bar-chart,
  .stage,
  .arrow {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Error State Accessibility */
input[aria-invalid="true"],
.calc-input-group input.error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

input[aria-invalid="true"]:focus {
  outline-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Loading State Accessibility */
[aria-busy="true"] {
  position: relative;
  pointer-events: none;
}

[aria-busy="true"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid var(--border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Disabled State Accessibility */
button:disabled,
input:disabled,
[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Live Region Styling */
[aria-live="polite"],
[aria-live="assertive"] {
  position: relative;
}

/* Skip Links */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 4px 0;
  font-weight: var(--font-semibold);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: -4px;
}
