/* Premium Stylesheet for RRB ALP Result Checker */

:root {
  --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  --success-color: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --failure-color: #ef4444;
  --failure-bg: #fef2f2;
  --failure-border: #fca5a5;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --input-focus: #3b82f6;
  --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.01);
  --glass-bg: rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: transparent;
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
  overflow: hidden;
}

.widget-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-card {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header */
.card-header {
  text-align: center;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid #dbeafe;
}

.card-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.2;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Card Bodies states */
.card-body {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.card-body.active-state {
  display: block;
}

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

/* Input Fields */
.input-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

input, select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background-color: #f9fafb;
  color: var(--text-dark);
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

input::placeholder {
  color: #9ca3af;
}

input:focus, select:focus {
  border-color: var(--input-focus);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Custom Select Wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-light);
  pointer-events: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
}

.input-help {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Buttons */
.submit-btn {
  width: 100%;
  background: var(--primary-gradient);
  color: white;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -1px rgba(37, 99, 235, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 6px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -2px rgba(37, 99, 235, 0.15);
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

.submit-btn:active {
  transform: translateY(1px);
}

.arrow-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.submit-btn:hover .arrow-icon {
  transform: translateX(4px);
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 40px 0;
}

.spinner-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.spinner {
  width: 100%;
  height: 100%;
  border: 4px solid #f3f4f6;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border: 2px solid transparent;
  border-top-color: rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  animation: spin 2s linear infinite reverse;
}

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

.loading-state h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #1e3a8a;
}

.loading-state p {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Result States */
.result-state {
  text-align: center;
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: popIcon 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIcon {
  from { transform: scale(0) rotate(-45deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.result-icon.success {
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  color: var(--success-color);
}

.result-icon.failure {
  background: var(--failure-bg);
  border: 2px solid var(--failure-border);
  color: var(--failure-color);
}

.result-icon svg {
  width: 36px;
  height: 36px;
}

.status-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.success-text {
  color: #047857;
}

.failure-text {
  color: #b91c1c;
}

.status-message {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 24px;
  padding: 0 10px;
}

.candidate-details {
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.875rem;
  border-bottom: 1px dashed var(--border-color);
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.detail-row:first-child {
  padding-top: 4px;
}

.detail-row span {
  color: var(--text-light);
}

.detail-row strong {
  color: var(--text-dark);
  font-weight: 600;
}

.reset-btn {
  width: 100%;
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

/* Confetti Canvas */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* Footer style */
.widget-footer {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Pulse animation for qualified icon */
.result-icon.success svg {
  animation: checkPulse 2s infinite ease-in-out;
}

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