/* ===========================================
   Tech Stack Badge Section
   Used for displaying technology logos/badges
   =========================================== */

.tech-stack-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 60px 0;
  overflow: visible;
}

.tech-stack-section h2 {
  text-align: center;
  margin-bottom: 15px;
  color: #1a365d;
}

.tech-stack-section .section-intro {
  text-align: center;
  color: #4a5568;
  max-width: 600px;
  margin: 0 auto 40px;
}

/* Tech Badges Container */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  overflow: visible;
  padding-top: 60px; /* Space for tooltips above */
}

/* Individual Badge */
.tech-badge {
  background: white;
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tech-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.tech-badge img {
  height: 32px;
  width: auto;
}

.tech-badge span {
  font-weight: 500;
  color: #2d3748;
  font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .tech-stack-section {
    padding: 40px 20px;
  }

  .tech-badges {
    gap: 12px;
  }

  .tech-badge {
    padding: 12px 18px;
  }

  .tech-badge img {
    height: 24px;
  }

  .tech-badge span {
    font-size: 13px;
  }
}

/* ===========================================
   Problem/Solution Cards (for landing pages)
   =========================================== */

.problem-section {
  padding: 80px 0;
  background: #fff;
}

.problem-section h2 {
  text-align: center;
  margin-bottom: 50px;
  color: #1a365d;
}

.problem-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.problem-card {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  padding: 30px;
  border-radius: 12px;
  border-left: 4px solid #f56565;
}

.problem-card h3 {
  color: #c53030;
  margin-bottom: 10px;
  font-size: 18px;
}

.problem-card p {
  color: #4a5568;
  line-height: 1.6;
}

/* Solution Cards */
.solution-section {
  padding: 80px 0;
  background: #f8f9fa;
}

.solution-section h2 {
  text-align: center;
  margin-bottom: 50px;
  color: #1a365d;
}

.solution-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.solution-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.solution-card .icon {
  font-size: 40px;
  margin-bottom: 20px;
}

.solution-card h3 {
  color: #1a365d;
  margin-bottom: 10px;
}

.solution-card p {
  color: #4a5568;
  line-height: 1.6;
}

/* ===========================================
   Case Studies Section
   =========================================== */

.case-studies-section {
  padding: 80px 0;
  background: #fff;
}

.case-studies-section h2 {
  text-align: center;
  margin-bottom: 50px;
  color: #1a365d;
}

.case-study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.case-study-card {
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
}

.case-study-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.case-study-content {
  padding: 25px;
}

.case-study-card h3 {
  color: #1a365d;
  margin-bottom: 10px;
}

.case-study-card .stats {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.case-study-card .stat {
  background: #e2e8f0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: #4a5568;
}

.case-study-card p {
  color: #4a5568;
  line-height: 1.6;
}

/* ===========================================
   CTA Section
   =========================================== */

.cta-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
  text-align: center;
  color: white;
}

.cta-section h2 {
  color: white;
  margin-bottom: 20px;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto 30px;
}

.cta-button-primary {
  display: inline-block;
  background: #f26d6d;
  color: white;
  padding: 15px 40px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-button-primary:hover {
  background: #e55555;
  transform: translateY(-2px);
}

/* ===========================================
   Mobile Page Hero Enhancement
   =========================================== */

.page-mobile-optimization .page-hero {
  background: linear-gradient(135deg, #1a365d 0%, #2d4a7c 100%);
}

.page-mobile-optimization .page-hero-content h1 {
  font-size: 2.5rem;
}

.page-mobile-optimization .page-hero-content p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page-mobile-optimization .page-hero-content h1 {
    font-size: 1.8rem;
  }

  .page-mobile-optimization .page-hero-content p {
    font-size: 1rem;
  }

  .problem-section,
  .solution-section,
  .case-studies-section,
  .cta-section {
    padding: 50px 20px;
  }
}

/* ===========================================
   Speed Test Tool Section
   =========================================== */

.speed-test-section {
  background: linear-gradient(135deg, #1a2332 0%, #2d3748 100%);
  padding: 80px 0;
  text-align: center;
  color: #fff;
}

.speed-test-section h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 15px;
}

.speed-test-section h2 i {
  color: #4fd1c5;
  margin-right: 10px;
}

.speed-test-section > .container > p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.speed-test-tool {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 30px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.speed-test-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.input-wrapper {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 0 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.input-wrapper i {
  color: #718096;
  margin-right: 10px;
}

.input-wrapper input {
  flex: 1;
  border: none;
  padding: 15px 0;
  font-size: 16px;
  background: transparent;
  outline: none;
  color: #1a2332;
}

.input-wrapper input::placeholder {
  color: #a0aec0;
}

.test-button {
  background: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
  color: #fff;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(79, 209, 197, 0.3);
  min-width: 180px;
}

.test-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 209, 197, 0.4);
}

.test-button .button-loading {
  display: none;
}

.test-button.loading .button-text {
  display: none;
}

.test-button.loading .button-loading {
  display: inline;
}

.speed-test-features {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.speed-test-features .feature {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.speed-test-features .feature i {
  color: #4fd1c5;
  margin-right: 6px;
}

.test-note {
  margin-top: 25px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.test-note i {
  margin-right: 5px;
}

/* Speed Test Results */
.speed-test-results {
  display: none;
  margin-top: 30px;
  text-align: left;
}

.speed-test-results.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

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

.results-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.results-header .main-score {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.main-score.score-good { background: linear-gradient(135deg, #0cce6b 0%, #0a9d52 100%); }
.main-score.score-moderate { background: linear-gradient(135deg, #ffa400 0%, #cc8300 100%); }
.main-score.score-poor { background: linear-gradient(135deg, #ff4e42 0%, #cc3d35 100%); }

.results-header .results-info h3 {
  color: #fff;
  margin: 0 0 5px;
  font-size: 18px;
}

.results-header .results-info p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-size: 14px;
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.score-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
}

.score-card .score-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 5px;
}

.score-card .score-value.good { color: #0cce6b; }
.score-card .score-value.moderate { color: #ffa400; }
.score-card .score-value.poor { color: #ff4e42; }

.score-card .score-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 25px;
}

.metric-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-item .label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.metric-item .value {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

/* Smart Feedback Section */
.smart-feedback {
  margin-top: 25px;
  padding: 20px;
  border-radius: 12px;
  text-align: left;
}

.smart-feedback.feedback-excellent {
  background: linear-gradient(135deg, rgba(12, 206, 107, 0.15) 0%, rgba(10, 157, 82, 0.15) 100%);
  border: 1px solid rgba(12, 206, 107, 0.3);
}

.smart-feedback.feedback-good {
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.15) 0%, rgba(56, 178, 172, 0.15) 100%);
  border: 1px solid rgba(79, 209, 197, 0.3);
}

.smart-feedback.feedback-needs-work {
  background: linear-gradient(135deg, rgba(255, 164, 0, 0.15) 0%, rgba(204, 131, 0, 0.15) 100%);
  border: 1px solid rgba(255, 164, 0, 0.3);
}

.smart-feedback.feedback-critical {
  background: linear-gradient(135deg, rgba(255, 78, 66, 0.15) 0%, rgba(204, 61, 53, 0.15) 100%);
  border: 1px solid rgba(255, 78, 66, 0.3);
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.feedback-icon {
  font-size: 28px;
}

.feedback-excellent .feedback-icon { color: #0cce6b; }
.feedback-good .feedback-icon { color: #4fd1c5; }
.feedback-needs-work .feedback-icon { color: #ffa400; }
.feedback-critical .feedback-icon { color: #ff4e42; }

.feedback-header h4 {
  color: #fff;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.feedback-summary {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Contextual Tips */
.feedback-tips {
  list-style: none;
  padding: 0;
  margin: 0 0 15px;
}

.feedback-tips li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-tips li:last-child {
  border-bottom: none;
}

.feedback-tips li i {
  margin-top: 2px;
  flex-shrink: 0;
}

.feedback-tips li i.fa-check-circle { color: #0cce6b; }
.feedback-tips li i.fa-exclamation-circle { color: #ffa400; }
.feedback-tips li i.fa-times-circle { color: #ff4e42; }

/* Contact CTA in feedback */
.feedback-cta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  flex-wrap: wrap;
}

.feedback-cta-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  flex: 1;
  min-width: 200px;
}

.feedback-cta-button {
  background: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.feedback-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 209, 197, 0.4);
}

.feedback-critical .feedback-cta-button {
  background: linear-gradient(135deg, #f26d6d 0%, #e55555 100%);
}

.feedback-critical .feedback-cta-button:hover {
  box-shadow: 0 4px 12px rgba(242, 109, 109, 0.4);
}

/* Error state */
.speed-test-error {
  background: rgba(255, 78, 66, 0.2);
  border: 1px solid rgba(255, 78, 66, 0.4);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  display: none;
}

.speed-test-error.visible {
  display: block;
}

.speed-test-error p {
  color: #ff4e42;
  margin: 0;
}

/* Speed Test Responsive */
@media (max-width: 768px) {
  .scores-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .lead-form {
    flex-direction: column;
  }

  .lead-form input,
  .lead-form button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .speed-test-section {
    padding: 50px 20px;
  }

  .speed-test-form {
    flex-direction: column;
  }

  .input-wrapper {
    min-width: 100%;
  }

  .test-button {
    width: 100%;
  }

  .speed-test-features {
    gap: 15px;
  }

  .results-header {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================================
   Tech Badge Tooltips
   =========================================== */

.tech-badge {
  position: relative;
  cursor: pointer;
}

.tech-badge[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: linear-gradient(135deg, #005293, #4a90d9);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 82, 147, 0.3);
  pointer-events: none;
}

.tech-badge[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  border: 6px solid transparent;
  border-top-color: #005293;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 101;
}

.tech-badge[data-tooltip]:hover::after,
.tech-badge[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

.tech-badge[data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(-10px);
}

.tech-badge[data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(0);
}

/* Hide tooltips on small mobile only */
@media (max-width: 480px) {
  .tech-badge[data-tooltip]::after,
  .tech-badge[data-tooltip]::before {
    display: none;
  }
}
