/* Premium UI styling */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-bg: rgba(255, 255, 255, 0.15);
  --card-blur: 10px;
  --text-color: #ffffff;
  --success-color: #4caf50;
  --error-color: #f44336;
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--primary-gradient);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.container {
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  width: 100%;
  max-width: 500px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0 0 2rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
  font-weight: 400;
}

form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: none;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-color);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

input[type="text"]:focus {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

button {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.35);
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

button:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

/* Loading spinner */
.loading {
  margin-top: 1rem;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--text-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result Window Styles */
.result {
  margin-top: 2rem;
  padding: 0;
  border-radius: 1.5rem;
  animation: slideUpFade 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: center;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: all 0.4s ease;
}

.result.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.result.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.result-header {
  padding: 2rem 2rem 1rem;
}

.result-body {
  padding: 0 2rem 2rem;
  color: rgba(255, 255, 255, 0.85);
}

.status-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success .status-icon {
  color: #4ade80;
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.error .status-icon {
  color: #f87171;
  text-shadow: 0 0 20px rgba(248, 113, 113, 0.5);
}

.qualification-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.qualification-number {
  font-size: 0.85rem;
  font-family: 'Monaco', 'Consolas', monospace;
  opacity: 0.7;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.9);
}

.qualification-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.success .badge {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.error .badge {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}


.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: rotate(90deg);
}

.error-detail {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  font-family: 'Monaco', 'Consolas', monospace;
}

.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  70% {
    transform: scale(1.1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}


/* Responsive design */
@media (max-width: 600px) {
  .container {
    padding: 2rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  form {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}