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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.keyboard-container {
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 11px 30px 40px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  animation: slideUp 0.6s ease;
  position: relative;
  overflow: hidden;
}

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

.keyboard-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667EEA, #764BA2, #F093FB, #667EEA);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% {
    background-position: 200% 0;
  }
  
  50% {
    background-position: -200% 0;
  }
}

.header {
  text-align: center;
  margin-bottom: 12px;
}

.header h2 {
  color: #2D3748;
  font-size: 1.8em;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.header .icon {
  background: linear-gradient(135deg, #667EEA, #764BA2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.2em;
}

.header p {
  color: #718096;
  font-size: 0.95em;
  font-weight: 500;
}

.input-section {
  margin-bottom: 30px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 15px;
}

#voucher-input {
  width: 100%;
  padding: 5px 24px 9px;
  font-size: 1.4em;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-weight: 600;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
  color: #2D3748;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  border-top: 0px solid black;
}

#voucher-input:focus {
  border-color: #667EEA;
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

#voucher-input::placeholder {
  color: #A0AEC0;
  font-weight: 400;
  letter-spacing: 2px;
}

.input-counter {
  position: absolute;
  right: 12px;
  bottom: -25px;
  font-size: 0.8em;
  color: #718096;
  font-weight: 500;
}

.keyboard {
  margin-bottom: 25px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 3px;
}

.keyboard-key {
  min-width: 45px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  font-weight: 600;
  color: #4A5568;
  background: linear-gradient(145deg, #FFFFFF, #F7FAFC);
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
  width: 55px;
}

.keyboard-key::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.keyboard-key:hover {
  background: linear-gradient(145deg, #F7FAFC, #EDF2F7);
  border-color: #CBD5E0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.keyboard-key:hover::before {
  left: 100%;
}

.keyboard-key:active {
  background: linear-gradient(145deg, #EDF2F7, #F7FAFC);
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key-wide {
  min-width: 95px;
  font-size: 0.95em;
  background: linear-gradient(145deg, #FED7D7, #FEB2B2);
  color: #C53030;
  border-color: #FED7D7;
  /*+placement: 1px -1px;*/
  position: relative;
  left: 1px;
  top: -1px;
}

.key-wide:hover {
  background: linear-gradient(145deg, #FEB2B2, #FC8181);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1.05em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  justify-content: center;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

#btn-submit {
  background: linear-gradient(135deg, #48BB78, #38A169);
  color: white;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

#btn-submit:hover {
  background: linear-gradient(135deg, #38A169, #2F855A);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
}

#btn-submit:active {
  transform: translateY(0);
}

#btn-close {
  background: linear-gradient(145deg, #EDF2F7, #E2E8F0);
  color: #4A5568;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#btn-close:hover {
  background: linear-gradient(145deg, #E2E8F0, #CBD5E0);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #48BB78, #38A169);
  box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
  animation: pulse 2s infinite;
}

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

/* Loading animation untuk tombol submit */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

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

/* Responsive Design */
@media (max-width: 640px) {
  .keyboard-container {
    padding: 25px 20px;
    margin: 10px;
  }
  
  .header h2 {
    font-size: 1.5em;
  }
  
  #voucher-input {
    font-size: 1.2em;
    padding: 16px 20px;
    letter-spacing: 2px;
  }
  
  .keyboard-key {
    min-width: 38px;
    height: 42px;
    font-size: 1em;
  }
  
  .key-wide {
    min-width: 80px;
  }
  
  .btn {
    padding: 12px 24px;
    font-size: 1em;
    min-width: 100px;
  }
  
  .controls {
    flex-direction: column;
    gap: 10px;
  }
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#voucher-input {
  flex: 1;
}

.btn-clear {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(145deg, #FED7D7, #FEB2B2);
  color: #C53030;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  z-index: 2;
  display: none;
  /*+placement: ;*/
  position: relative;
  left: 0;
  top: 0;
}

.btn-clear:hover {
  background: linear-gradient(145deg, #FEB2B2, #FC8181);
  color: white;
  transform: translateY(-50%) scale(1.05);
}

.btn-backspace {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(145deg, #FED7D7, #FEB2B2);
  color: #C53030;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  z-index: 2;
}

.btn-backspace:hover {
  background: linear-gradient(145deg, #FEB2B2, #FC8181);
  color: white;
  transform: translateY(-50%) scale(1.05);
}

.btn-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(145deg, #FC8181, #F56565);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: linear-gradient(145deg, #F56565, #E53E3E);
  transform: scale(1.1);
}

.keyboard-container {
  position: relative;
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.keyboard-row {
  margin-bottom: 4px;
}

.keyboard-row:last-child {
  margin-bottom: 0;
}
