/* CI Validation Demo - Main Stylesheet */

/* Base styles */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  font-size: 16px; /* Base font size for better scaling */
}

/* Service card styles */
.service-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
  position: relative;
  margin-bottom: 1rem;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  z-index: -1;
}

.service-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4);
}

.service-card:hover::before {
  background: rgba(0, 0, 0, 0.25);
}

/* Service card border variations */
.service-card.border-l-4 {
  border-left-width: 4px;
  border-left-style: solid;
}

.border-green-500 {
  border-left-color: #10b981;
}

.border-blue-500 {
  border-left-color: #3b82f6;
}

.border-orange-500 {
  border-left-color: #f59e0b;
}

.border-red-500 {
  border-left-color: #ef4444;
}

.border-gray-500 {
  border-left-color: #6b7280;
}

/* Status badges */
.bg-green-500 {
  background-color: #10b981;
}

.bg-blue-500 {
  background-color: #3b82f6;
}

.bg-orange-500 {
  background-color: #f59e0b;
}

.bg-red-500 {
  background-color: #ef4444;
}

.bg-gray-500 {
  background-color: #6b7280;
}

/* Service summary grid improvements */
.service-summary {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.service-summary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  z-index: -1;
}

/* Contact options styling */
.contact-option {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.5rem;
  margin: 0.25rem 0;
}

/* Points display */
.points-display {
  text-align: center;
  background: linear-gradient(45deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
  border-radius: 8px;
  padding: 0.5rem;
}

/* Action required alert */
.action-alert {
  background: rgba(251, 146, 60, 0.2);
  border: 1px solid rgba(251, 146, 60, 0.4);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.5rem 0;
}

/* Responsive service cards */
@media (max-width: 768px) {
  .service-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .service-summary {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .points-display {
    text-align: left;
    padding: 0.75rem;
  }

  .grid.grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 575px) {
  .grid.grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .service-card h6 {
    font-size: 1rem;
  }
}

/* Badge styling improvements */
.info-badge {
  min-width: 100px;
}

/* Ensure proper text scaling */
* {
  box-sizing: border-box;
}

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

/* Text contrast improvements */
.glass h1,
.glass h2,
.glass h3,
.glass h4,
.glass h5,
.glass h6,
.glass p,
.glass span,
.glass div,
.glass-card h1,
.glass-card h2,
.glass-card h3,
.glass-card h4,
.glass-card h5,
.glass-card h6,
.glass-card p,
.glass-card span,
.glass-card div {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  color: #ffffff !important;
}

/* Stronger text shadow for persona card */
.persona-card h1,
.persona-card h2,
.persona-card h3,
.persona-card h4,
.persona-card h5,
.persona-card h6,
.persona-card p,
.persona-card span,
.persona-card div {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  color: #ffffff !important;
  font-weight: 600;
}

/* Stat item text */
.stat-item * {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  color: #ffffff !important;
  font-weight: 600;
}

/* Glass morphism effects */
.glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.5);
  /* Add dark overlay for better text contrast */
  position: relative;
}

.glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  z-index: -1;
}

.glass-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
  /* Add dark overlay for better text contrast */
  position: relative;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  z-index: -1;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4);
}

.glass-card:hover::before {
  background: rgba(0, 0, 0, 0.2);
}

/* Badge styles */
.info-badge {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  margin: 2px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Persona card */
.persona-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1rem 0;
  backdrop-filter: blur(15px);
  /* Add dark overlay for better text contrast */
  position: relative;
}

.persona-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  z-index: -1;
}

/* Stat items */
.stat-item {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.3s ease;
  /* Add dark overlay for better text contrast */
  position: relative;
}

.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  z-index: -1;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.stat-item:hover::before {
  background: rgba(0, 0, 0, 0.25);
}

/* Gender indicators */
.gender-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.gender-male {
  background: linear-gradient(45deg, #3b82f6, #1d4ed8);
}

.gender-female {
  background: linear-gradient(45deg, #ec4899, #be185d);
}

.gender-unknown {
  background: linear-gradient(45deg, #6b7280, #374151);
}

/* Generation badges */
.generation-badge {
  background: linear-gradient(45deg, #10b981, #047857);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* NPM button (keeping for legacy support) */
.npm-button {
  background: linear-gradient(45deg, #cb3837, #a0262c);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.npm-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(203, 56, 55, 0.4);
  background: linear-gradient(45deg, #a0262c, #cb3837);
}

/* Code blocks */
.code-block {
  background: #1a202c;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Terminal-style code blocks */
.terminal-block {
  background: rgba(26, 32, 44, 0.9);
  border-radius: 8px;
  font-family: "Courier New", "Monaco", "Menlo", monospace;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-prompt {
  color: #a0aec0;
  margin-right: 0.5rem;
}

.terminal-command {
  color: #68d391;
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

/* Pulse animations */
.pulse-success {
  animation: pulseSuccess 0.6s ease-in-out;
}

.pulse-error {
  animation: pulseError 0.6s ease-in-out;
}

@keyframes pulseSuccess {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    background-color: #10b981;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulseError {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    background-color: #ef4444;
  }
  100% {
    transform: scale(1);
  }
}

/* Utility classes for consistent button styling */
.btn-primary {
  background: linear-gradient(45deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  background: linear-gradient(45deg, #1d4ed8, #3b82f6);
}

.btn-success {
  background: linear-gradient(45deg, #10b981, #047857);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  background: linear-gradient(45deg, #047857, #10b981);
}

.btn-danger {
  background: linear-gradient(45deg, #ef4444, #dc2626);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
  background: linear-gradient(45deg, #dc2626, #ef4444);
}

/* Input focus styles */
.input-focus {
  color: #1a202c !important;
  background-color: #ffffff !important;
  font-weight: 600;
}

.input-focus:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
  border-color: #3b82f6;
  color: #1a202c !important;
  background-color: #ffffff !important;
}

.input-focus::placeholder {
  color: #6b7280 !important;
  font-weight: 400;
}

/* Responsive utilities for icons */
@media (min-width: 769px) {
  .fas.md\:block,
  .fa.md\:block,
  i.md\:block {
    display: inline-block !important;
  }
}

/* Responsive design improvements */
@media (max-width: 768px) {
  /* Hide specific icons on mobile */
  .fas.hidden,
  .fa.hidden,
  i.hidden {
    display: none !important;
  }

  /* Ensure Tailwind hidden class works with Font Awesome */
  .fas.md\:block,
  .fa.md\:block,
  i.md\:block {
    display: none !important;
  }

  /* Body and container */
  body {
    padding: 0.5rem;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  /* Headers */
  header h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  header p {
    font-size: 1rem;
  }

  /* Glass containers */
  .glass,
  .glass-card {
    padding: 1rem;
    margin: 0.5rem 0;
  }

  .persona-card {
    padding: 1rem;
    margin: 0.5rem 0;
  }

  .stat-item {
    padding: 0.5rem;
    font-size: 0.875rem;
  }

  /* Form elements */
  #ciForm {
    gap: 1rem;
  }

  #ci {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .flex.space-x-4 {
    flex-direction: column;
    gap: 0.75rem;
  }

  .flex.space-x-4 > * {
    margin: 0;
  }

  /* Grid layouts */
  .grid.md\\:grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .grid.md\\:grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .grid.lg\\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* Terminal blocks */
  .terminal-block {
    font-size: 0.75rem;
    padding: 0.75rem;
  }

  /* Code blocks */
  .code-block {
    font-size: 0.75rem;
    padding: 0.75rem;
  }

  /* Buttons */
  button,
  .btn-primary,
  .btn-success,
  .btn-danger {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  /* Breadcrumbs */
  nav[aria-label="Breadcrumb"] {
    font-size: 0.75rem;
  }

  /* Section headings */
  section h2 {
    font-size: 1.25rem;
  }

  .glass-card h3 {
    font-size: 1rem;
  }

  /* Footer */
  footer {
    margin-top: 2rem;
    padding: 1rem 0;
  }

  footer p {
    font-size: 0.75rem;
  }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575px) {
  body {
    padding: 0.25rem;
  }

  header h1 {
    font-size: 1.75rem;
  }

  header p:first-of-type {
    font-size: 0.875rem;
  }

  header p:last-of-type {
    font-size: 0.75rem;
  }

  .glass,
  .glass-card {
    padding: 0.75rem;
  }

  .persona-card {
    padding: 0.75rem;
  }

  #ci {
    font-size: 1rem;
    padding: 0.625rem;
  }

  .grid.lg\\:grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .stat-item {
    padding: 0.5rem;
    font-size: 0.8125rem;
  }

  /* Make terminal blocks scroll horizontally on very small screens */
  .terminal-block {
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow-x: auto;
  }
}

/* Large tablets and small desktops */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 90%;
  }

  .grid.md\\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .grid.md\\:grid-cols-3 > :nth-child(3n) {
    grid-column: span 2;
    max-width: 50%;
    margin: 0 auto;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }

  .glass,
  .glass-card {
    padding: 2rem;
  }

  .persona-card {
    padding: 2rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .code-block {
    background: #0d1117;
    border: 1px solid #30363d;
  }

  .terminal-block {
    background: rgba(13, 17, 23, 0.95);
    border-color: #30363d;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .glass {
    border: 2px solid rgba(255, 255, 255, 0.5);
  }

  .glass-card {
    border: 2px solid rgba(255, 255, 255, 0.4);
  }

  .info-badge {
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .loading {
    animation: none;
  }
}

/* Enhanced text legibility */
.text-enhanced {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: 600;
  color: #ffffff;
}

/* Header text improvements */
header h1 {
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
  font-weight: 800;
}

header p {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  font-weight: 500;
}

/* Footer text improvements */
footer p {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-weight: 500;
}

/* Form label improvements */
label {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-weight: 600;
}

/* Breadcrumb improvements */
nav[aria-label="Breadcrumb"] * {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Section headings */
section h2 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: 700;
}

/* FAQ specific improvements */
.glass-card h3 {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  font-weight: 700;
}

/* Button text improvements */
button {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Link improvements */
a {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets for mobile */
  button,
  .btn-primary,
  .btn-success,
  .btn-danger,
  a[role="button"] {
    min-height: 44px;
    padding: 0.875rem 1.25rem;
  }

  /* Remove hover effects on touch devices */
  .glass-card:hover,
  .stat-item:hover,
  button:hover,
  .btn-primary:hover,
  .btn-success:hover,
  .btn-danger:hover {
    transform: none;
    box-shadow: initial;
  }

  /* Better focus indicators for keyboard navigation on touch devices */
  .input-focus:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.6);
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .glass,
  .glass-card,
  .persona-card {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
  }

  .glass::before,
  .glass-card::before,
  .persona-card::before,
  .stat-item::before {
    display: none;
  }

  header,
  footer,
  nav,
  .terminal-block,
  button,
  #validateBtn,
  #clearBtn,
  #copyBtn {
    display: none;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  header {
    margin-bottom: 1rem;
  }

  header h1 {
    font-size: 1.75rem;
  }

  .glass {
    padding: 1rem;
  }

  .grid.md\\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}
