.form-container {
  width: 100%;
  height: calc(100% - 40px);
  padding: 2rem 2rem;
  background-color: var(--secondBackground);
}

.form-container .form-wrapper {
  /* max-width: 700px; */
  height: 100%;
  margin: auto;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 4px var(--secondBackgroundShadow);
}

.form-header {
  padding: 1.1rem 2rem;
  background-color: var(--tertiary);
  border-bottom: 1px solid var(--border);
  color: var(--onTertiary);
  position: sticky;
  top: 0;
  z-index: 10;
  -webkit-user-select: none;
  user-select: none;
}

.form-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-header span {
  font-size: 0.875rem;
}

.form-header span b {
  color: var(--error);
}

/* Form body  */
.form-body {
  padding: 1.5rem 2rem;
  min-height: 75%;
}

.form-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--onSecondBackground);
}

.form-body .label {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--onSecondBackground);
}

.form-body .label.required::after {
  content: " *";
  color: var(--error);
}

.form-body .error {
  color: var(--error);
  font-size: 0.7rem;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  background-color: var(--secondBackground);
  color: var(--onSecondBackground);
}
.input.password {
  padding: 0.4rem 2.2rem 0.4rem 0.6rem;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--secondBackgroundShadow);
}

.textarea {
  min-height: 80px;
}

.form-body .input-mb {
  margin-bottom: 1rem;
}

/* Form Footer  */
.form-footer {
  border-top: 1px solid var(--border);
  margin: 0 1rem;
  display: flex;
  justify-content: end;
  position: sticky;
  bottom: 0;
  background-color: var(--secondBackground);
  padding: 1.5rem 0;
}

.form-footer button {
  padding: 0.4rem 1.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  margin: 0 1rem 0 0;
  text-transform: uppercase;
  -webkit-user-select: none;
  user-select: none;
}

.form-footer .clear {
  background-color: var(--onPrimary);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.form-footer .clear:hover {
  background-color: var(--onPrimaryHover);
  border: 1px solid var(--primaryHover);
  color: var(--primaryHover);
}

.form-footer .save {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: var(--onPrimary);
}

.form-footer .save:hover {
  background-color: var(--primaryHover);
  border: 1px solid var(--primaryHover);
  color: var(--onPrimaryHover);
}

.form-divider {
  border-bottom: 1px solid var(--border);
  width: 100%;
  margin-bottom: 1.5rem;
}

/* show password */

.form-show-password {
  position: absolute;
  right: 12px;
  fill: var(--primary);
  width: 20px;
  height: 20px;
  cursor: pointer;
  top: calc(50% - 10px);
}

/* file uploader */

.file-uploader-container {
  max-width: 342px;
}

.file-uploader {
  border-radius: 8px;
  /* padding: 40px 20px; */
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-uploader .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.file-uploader .content .icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--onSecondBackground);
}

.file-uploader .content p {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--onSecondBackground);
}

.file-uploader .content p span {
  color: var(--accent);
}

/* Inline preview styles */
.preview-content-inline {
  width: 100%;
  height: 100%;
  position: relative;
}

.preview-remove-btn-inline {
  position: absolute;
  top: -20px;
  right: -20px;
  background-color: var(--onTertiary);
  color: var(--secondBackground);
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: all 0.2s ease;
  z-index: 10;
}

.preview-remove-btn-inline:hover {
  background: var(--onTertiaryHover);
  transform: scale(1.1);
}

.preview-image-container {
  width: 100%;
  max-width: 180px;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  background-color: #f9fafb;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image {
  width: auto;
  height: calc(100% - 40px);
  max-width: 100%;
}

.preview-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  height: 40px;
}

.preview-filename {
  font-weight: 500;
  color: var(--onSecondBackground);
  font-size: 14px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-filesize {
  font-size: 12px;
  color: var(--onSecondBackground);
  opacity: 0.7;
}

/* Remove the old preview container */
.preview-container {
  display: none;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  font-size: 16px;
  cursor: pointer;
}

.radiobtn {
  height: 18px;
  width: 18px;
  margin-right: 6px;
}
.form-date {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 1rem;
}
.form-date svg {
  stroke: var(--onTertiary);
  height: 20px;
  width: 20px;
}

/* small form create  */
.partial-form-container {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  animation: slideInFromRight 0.4s ease-out forwards;
  z-index: 100;
  transition: width 0.1s ease;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

.partial-form-container .form-wrapper {
  border-radius: 6px 0px 0px 6px;
  background-color: var(--secondBackground);
  border: 1px solid var(--border);
  overflow: auto;
  margin-left: 16px;
  height: 100%;
}

.partial-form-container .form-header {
  display: flex;
  justify-content: space-between;
}

.partial-form-container .form-header svg {
  cursor: pointer;
}

.resize-handle {
  position: absolute;
  top: 0;
  width: 16px;
  height: 100%;
  cursor: ew-resize;
  z-index: 10;
  display: flex;
}

.resize-handle::after {
  content: "";
  background-color: var(--secondary);
  width: 1px;
  height: 90%;
  margin: auto;
}

.resize-handle::before {
  content: "";
  background-color: var(--primary);
  width: 8px;
  height: 30px;
  position: absolute;
  border-radius: 22px;
  top: calc(50% - 15px);
  left: calc(50% - 4px);
}



/* ******************************** After Saved Successfully *************************************  */

.success-overlay {
  padding: 40px 30px;
  animation: slideIn 0.5s ease-out;
  height: 100%;
  align-items: center;
  justify-content: center;
  display: flex;
}

.success-container {
  text-align: center;
  max-width: 400px;
}

.checkmark-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), var(--success));
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: bounce 0.6s ease-out 0.2s both;
}

.checkmark-container::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  z-index: -1;
  animation: pulse 2s infinite;
}

.checkmark {
  animation: fadeIn 0.3s ease-out 0.5s both;
}

.checkmark svg {
  width: 50px;
  fill: var(--secondBackground);
  height: 50px;
  animation: fadeIn 0.3s ease-out 0.5s both;
}

.success-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  animation: fadeUp 0.4s ease-out 0.7s both;
}

.success-message {
  font-size: 16px;
  color: var(--onTertiary);
  margin-bottom: 30px;
  line-height: 1.5;
  animation: fadeUp 0.4s ease-out 0.9s both;
}

.saved-button-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  animation: fadeUp 0.4s ease-out 1.1s both;
}

.saved-button-container .btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.saved-button-container .btn:hover {
  transform: translateY(-1px);
}

.saved-button-container .btn:active {
  transform: translateY(0);
}

.saved-button-container .saved-btn-secondary {
  background-color: var(--onPrimary);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.saved-button-container .saved-btn-secondary:hover {
  background-color: var(--onPrimaryHover);
  border: 1px solid var(--primaryHover);
  color: var(--primaryHover);
}

.saved-button-container .saved-btn-primary {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: var(--onPrimary);
}

.saved-button-container .saved-btn-primary:hover {
  background-color: var(--primaryHover);
  border: 1px solid var(--primaryHover);
  color: var(--onPrimaryHover);
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bounce {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}
