:root {
  /* Colors */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;
  
  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;
  
  --error-50: #fef2f2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;
  
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-primary-dark: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-error: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Spacing */
  --header-height: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gradient-primary);
  min-height: 100vh;
  color: var(--gray-700);
  line-height: 1.6;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-600);
  color: white;
  padding: 0.75rem 1.5rem;
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary-dark);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.tagline {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}

.header-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--primary-100);
  color: var(--primary-700);
}

.nav-link.active {
  background: var(--primary-600);
  color: white;
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Common Section Styles */
section {
  margin-bottom: 3rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2rem 0 3rem;
  color: white;
  width: 100%;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
}

.hero-description {
  font-size: clamp(0.9375rem, 2vw, 1.125rem);
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.95;
  line-height: 1.7;
}

.hero-description strong {
  color: var(--primary-200);
}

/* Validator Section */
.validator-section {
  width: 100%;
  margin: 0 auto 3rem;
}

.validator-card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-2xl);
}

.validator-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.validator-title span:first-child {
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Input Group */
.input-group {
  margin-bottom: 1.5rem;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.label-icon {
  font-size: 1.125rem;
}

.required {
  color: var(--error-500);
}

.input-wrapper {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

.input-field {
  flex: 1;
  padding: 1rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 1.125rem;
  transition: all var(--transition-fast);
  outline: none;
  font-family: 'Monaco', 'Consolas', monospace;
  letter-spacing: 0.025em;
  background: var(--gray-50);
}

.input-field:focus {
  border-color: var(--primary-500);
  background: white;
  box-shadow: 0 0 0 4px var(--primary-100);
  transform: translateY(-1px);
}

.input-field::placeholder {
  color: var(--gray-400);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: normal;
}

.input-action {
  padding: 0 1rem;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-action:hover {
  background: var(--primary-100);
  border-color: var(--primary-300);
}

.input-hint {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon {
  font-size: 1.125rem;
  font-weight: 700;
}

.btn-primary {
  flex: 2;
  background: var(--gradient-primary-dark);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  flex: 1;
  background: transparent;
  color: var(--gray-600);
  border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-100);
  color: var(--gray-800);
  border-color: var(--gray-400);
}

.btn-text {
  background: none;
  border: none;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}


/* Results Section */
.result-section {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  animation: slideIn 0.4s ease-out;
  border: 1px solid var(--gray-200);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.result-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.badge {
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.valid {
  background: var(--success-50);
  color: var(--success-700);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.badge.invalid {
  background: var(--error-50);
  color: var(--error-700);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.result-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-card {
  background: white;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.result-card.primary {
  background: var(--gradient-primary-dark);
  color: white;
  border: none;
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.result-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  opacity: 0.8;
}

.result-card.primary .label {
  color: var(--primary-100);
}

.result-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.result-card .value {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: 'Monaco', 'Consolas', monospace;
  letter-spacing: 0.025em;
}

.result-card.primary .value {
  color: white;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: var(--radius);
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.operator-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.operator-icon {
  font-size: 1.75rem;
}

.operator-value {
  flex: 1;
  min-width: 0;
}

.operator-label {
  background: var(--gradient-primary-dark);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Operator Visual */
.operator-visual-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.section-subtitle {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 1rem;
}

.operator-brand-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: white;
  transition: all var(--transition-slow);
}

.brand-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.brand-label {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* History Section */
.history-section {
  margin-top: 2rem;
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

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

.history-header h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.history-item:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  transform: translateX(4px);
}

.history-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-item-number {
  font-family: 'Monaco', 'Consolas', monospace;
  font-weight: 600;
  color: var(--gray-800);
}

.history-item-operator {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 600;
}

.history-item-time {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Operators Section */
.operators-section {
  width: 100%;
  margin: 0 auto 3rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.section-icon {
  font-size: 1.5rem;
}

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

.operator-card {
  background: white;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}

.operator-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--op-color);
}

.operator-card-icon {
  font-size: 2.5rem;
}

.operator-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.operator-card-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-800);
}

.operator-card-code {
  background: var(--op-color);
  color: white;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.operator-card-desc {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* FAQ Section */
.faq-section {
  width: 100%;
  margin: 0 auto 3rem;
}

.faq-grid {
  display: grid;
  gap: 1rem;
}

.faq-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.faq-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.faq-question {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}

.faq-question span:first-child {
  flex-shrink: 0;
}

.faq-answer {
  color: var(--gray-600);
  line-height: 1.7;
  padding-left: 2rem;
}

/* Footer */
.app-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-section p {
  font-size: 0.9375rem;
  line-height: 1.7;
}

.footer-links,
.footer-operators {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: var(--primary-400);
}

.footer-operators li {
  font-size: 0.9375rem;
  color: var(--gray-400);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-800);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.footer-note {
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--gray-900);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 0.9375rem;
  animation: slideDown 0.3s ease-out;
  min-width: 280px;
}

.toast.success {
  background: var(--success-600);
}

.toast.error {
  background: var(--error-600);
}

.toast.info {
  background: var(--primary-600);
}

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

.toast.hiding {
  animation: slideUp 0.3s ease-out forwards;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 0 1rem;
  }
  
  .logo-text h1 {
    font-size: 1.25rem;
  }
  
  .tagline {
    display: none;
  }
  
  .header-nav {
    display: none;
  }
  
  .app-main {
    padding: 1rem;
  }
  
  .hero-section {
    padding: 2rem 0;
  }
  
  .validator-card {
    padding: 1.5rem 1rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-primary,
  .btn-secondary {
    flex: 1;
    width: 100%;
  }
  
  .operators-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .validator-title
  .brand-icon {
    font-size: 2rem;
  }
  
  .brand-name {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .operators-grid {
    grid-template-columns: 1fr;
  }
  
  .operator-brand-card {
    padding: 0.75rem 1rem;
  }
  
  .brand-icon {
    font-size: 1.75rem;
  }
  
  .result-card .value {
    font-size: 1rem;
  }
  
  .input-field {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }
}

/* Loading State */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--primary-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .app-header,
  .app-footer,
  .action-buttons,
  .history-section {
    display: none;
  }
  
  body {
    background: white;
  }
  
  .validator-card {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
}
