/* @import url("https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Bebas+Neue&family=Montserrat:wght@400;500;600;700;800;900&family=Oswald:wght@200;400;500;600;700&family=Quicksand:wght@300;400;500;600;700&family=Satisfy&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,300;0,400;0,500;0,600;1,100;1,300&display=swap"); */
/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  text-decoration: none;
  border: none;
  outline: none;
  font-family: "Inter", sans-serif;
}

body {
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(135deg, #f0faf5 0%, #ffffff 50%, #e6f7f2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
body.overlay {
  position: relative;
}
body.overlay::before {
  position: absolute;
  content: "";
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}
img {
  max-width: 100%;
  vertical-align: middle;
}

/* Container */
.container {
  width: 100%;
  max-width: 28rem;
  position: relative;
}

/* Main Card */
.main-card {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 1);
}

/* Background Pattern */
.bg-pattern {
  position: absolute;
  top: 0;
  right: 0;
  width: 8rem;
  height: 8rem;
  background: linear-gradient(135deg, #e6f7f2 0%, #c3e8d9 100%);
  border-radius: 50%;
  transform: translate(4rem, -4rem);
  opacity: 0.5;
  z-index: 0;
  transition: all .3s ease;
}

.bg-pattern:hover {
  width: 8.5rem;
  height: 8.5rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.logo-container {
  width: 6rem;
  height: 6rem;
  margin: 0 auto 1.5rem;
  position: relative;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: #059669;
  margin-bottom: 1rem;
}

.description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4b5563;
}

.highlight {
  font-weight: 600;
  color: #059669;
}

/* Search Form */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1rem;
  background-color: #f9fafb;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  background-color: white;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to right, #059669, #0d9488);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2);
}

.search-button:hover {
  background: linear-gradient(to right, #047857, #0f766e);
  box-shadow: 0 6px 8px rgba(5, 150, 105, 0.25);
}

.search-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.4);
}

.search-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

/* Modal */
.modal {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 28rem;
  max-height: 90vh;
  overflow-y: auto;
  display: none;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.icon {
  flex-shrink: 0;
}

.success-icon {
  color: #059669;
}

.error-icon {
  color: #dc2626;
}

.warning-icon {
  color: #d97706;
}

.close-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0.25rem;
  border-radius: 0.375rem;
}

.close-button:hover {
  color: #4b5563;
  background-color: #f3f4f6;
}

/* Details Container */
.details-container {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
}

.detail-icon {
  color: #059669;
  margin-top: 0.125rem;
}

.detail-content {
  flex: 1;
  min-width: 0;
}

.detail-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #059669;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 0.875rem;
  color: #111827;
  word-break: break-word;
}

.detail-value.null {
  color: #dc2626;
  font-weight: 600;
}

/* Button Group */
.button-group {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Buttons */
.primary-button {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background-color: #059669;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-button:hover {
  background-color: #047857;
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-button {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background-color: #4b5563;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-button:hover {
  background-color: #374151;
}

.danger-button {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background-color: white;
  color: #dc2626;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #dc2626;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.danger-button:hover {
  background-color: #fef2f2;
}

.outline-button {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background-color: white;
  color: #059669;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #059669;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.outline-button:hover {
  background-color: #f0fdf4;
}

/* Success Modal */
.modal-description {
  padding: 1.5rem 1.5rem 0;
  color: #4b5563;
}

.password-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.radio-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-label {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-label:hover {
  background-color: #f9fafb;
}

.radio-input {
  width: 1rem;
  height: 1rem;
  margin-right: 0.75rem;
  accent-color: #059669;
}

.radio-icon {
  color: #6b7280;
  margin: 0 0.75rem;
}

.radio-text {
  font-size: 0.875rem;
  color: #111827;
}

.radio-value {
  font-weight: 600;
}

/* No Record Modal */
.no-record-content {
  padding: 1.5rem;
  text-align: center;
}

.no-record-message {
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.ref-not-found {
  font-weight: 600;
  color: #dc2626;
}

.no-record-hint {
  font-size: 0.875rem;
  color: #6b7280;
}

.add-record-section {
  margin-top: 1rem;
  text-align: center;
}

.add-record-text {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
  width: 100%;
}

/* Toast */
.toast {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease-out;
  max-width: 100%;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(100%);
  opacity: 0;
}

.toast-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.toast-close:hover {
  color: #4b5563;
  background-color: #f3f4f6;
}

/* Toast Types */
.toast-success {
  border-left: 4px solid #059669;
}

.toast-success .toast-icon {
  color: #059669;
}

.toast-error {
  border-left: 4px solid #dc2626;
}

.toast-error .toast-icon {
  color: #dc2626;
}

.toast-warning {
  border-left: 4px solid #d97706;
}

.toast-warning .toast-icon {
  color: #d97706;
}

.toast-info {
  border-left: 4px solid #2563eb;
}

.toast-info .toast-icon {
  color: #2563eb;
}

/* Confirmation Modal */
.confirmation-modal {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 24rem;
  display: none;
  animation: modalSlideIn 0.3s ease-out;
}

.confirmation-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.5rem 1rem;
}

.confirmation-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  color: #d97706;
}

.confirmation-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
}

.confirmation-content {
  padding: 0 1.5rem 1.5rem;
}

.confirmation-message {
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.confirmation-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-confirm {
  padding: 0.5rem 1rem;
  background-color: #059669;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-confirm:hover {
  background-color: #047857;
}

.btn-cancel {
  padding: 0.5rem 1rem;
  background-color: #6b7280;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background-color: #4b5563;
}

/* Responsive Design */
@media (max-width: 640px) {
  .main-card {
    padding: 1.5rem;
  }

  .logo-container {
    width: 5rem;
    height: 5rem;
  }

  .title {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .toast-container {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }

  .modal {
    max-width: none;
    margin: 0.5rem;
  }

  .confirmation-modal {
    max-width: none;
    margin: 0.5rem;
  }
}

@media (max-width: 457px) {
  .main-card {
    /* width: 90%; */
    box-shadow: none !important;
  }

  .confirmation-actions {
    flex-direction: column;
  }

  .btn-confirm,
  .btn-cancel {
    width: 100%;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 340px) {
  form input {
    width: 100%;
  }

  .toast {
    padding: 0.75rem;
  }

  .toast-title {
    font-size: 0.8125rem;
  }

  .toast-message {
    font-size: 0.8125rem;
  }
}

/* Dark mode support for system preference */
@media (prefers-color-scheme: dark) {
  .toast {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }

  .toast-title {
    color: #f9fafb;
  }

  .toast-message {
    color: #d1d5db;
  }

  .toast-close {
    color: #9ca3af;
  }

  .toast-close:hover {
    color: #d1d5db;
    background-color: #374151;
  }
}
