@font-face { 
    font-family: 'Mulish';
    src: url('./assets/font/Mulish-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
}

@font-face { 
    font-family: 'Mulish';
    src: url('./assets/font/Mulish-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}

@font-face { 
    font-family: 'Mulish';
    src: url('./assets/font/Mulish-Medium.woff2') format('woff2');
    font-weight: 500; 
    font-style: normal; 
}

@font-face { 
    font-family: 'Mulish';
    src: url('./assets/font/Mulish-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face { 
    font-family: 'Mulish';
    src: url('./assets/font/Mulish-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
}

/* Italic Font */
@font-face { 
    font-family: 'Mulish';
    src: url('./assets/font/Mulish-LightItalic.woff2') format('woff2');
    font-weight: 200;
    font-style: italic;
}

@font-face {
    font-family: 'Mulish';
    src: url('./assets/font/Mulish-Italic.woff2') format('woff2');
    font-weight: 300; 
    font-style: italic; 
}

:root {
  --bg-body: #F6E6FF;
  --bg-dark: #F1D8FF;
  --text-main: #2F2441;
  --text-form: #07074D;
  --border-default: #edeff3;
  --text-placeholder: #A8B2C1;
  --focus-border: #2F2441;
  --allergen-bg: #f8f9fa;
  --allergen-border: #dee2e6;
  --allergen-hover-bg: #e9ecef;
  --allergen-selected-bg: #F6E6FF;
  --allergen-selected-text: #2F2441;
  --tag-bg: #e7f3ff;
  --tag-text: #0c5460;
  --tag-border: #b3d9ff;
  --tag-hover-text: #721c24;
  --preview-border: #DDE3EC;
  --btn-bg: #F6E6FF;
  --btn-text: #2F2441;
  --btn-hover-bg: #2F2441;
  --btn-hover-text: white;
  --btn-hover-shadow: rgba(106, 100, 241, 0.3);
  --required-text: #dc3545;
}

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

body {
  font-family: Mulish, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-body);
  font-weight: 400;
  font-size: 16px; /* Fixed from 40px */
  color: var(--text-main);
  min-height: 100vh;
  padding: 10px;
}

.formbold-main-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 20px 10px;
  gap: 20px;
}


/* Logout button */
.logout-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 6px;
  color: #536387;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.logout-btn:hover {
  background: #f8f9fa;
  border-color: #cbd5e0;
  color: #07074d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-icon {
  font-size: 16px;
  line-height: 1;
}

/* Product List Styling */
#productListContainer {
  width: 100%;
  max-width: 500px;
  padding: 25px;
  background: white;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#productListContainer h4 {
  margin: 15px 0;
  font-weight: 600;
  color: var(--text-main);
  font-size: 22px;
  text-align: center;
}

#productList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#productList li.product-list-item {
  display: flex; 
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  font-size: 16px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-form);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 5px;
}

#productList li.product-list-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

#productList li.product-list-item:hover {
  background-color: var(--bg-dark);
  transform: translateY(-1px);
}

.delete-btn {
  background: var(--btn-bg);
  border: 1px solid var(--border-default);
  border-radius: 40%;
  cursor: pointer;
  color: var(--btn-text);
  font-size: 14px;
  padding: 8px 12px;
  margin-left: 10px;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

/* Add Button Styling */
.add-button-container {
  text-align: center;
  margin: 10px 0;
}

.add-btn {
  font-size: 28px;
  background-color: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--border-default);
  border-radius: 40%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.add-btn:hover {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: scale(1.05);
}

/* Form Styling */
.formbold-form-wrapper {
  width: 100%;
  max-width: 500px;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.formbold-form-wrapper > form > div {
  margin-bottom: 20px;
}

.formbold-form-wrapper label {
  color: var(--text-form);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  display: block;
  margin-bottom: 8px;
}

.formbold-form-input {
  width: 100%;
  padding: 15px 0 12px 0;
  border: none;
  border-bottom: 2px solid var(--border-default);
  background: transparent;
  font-size: 15px;
  color: var(--text-form);
  outline: none;
  transition: border-color 0.3s ease;
}

.formbold-form-input::placeholder {
  color: var(--text-placeholder);
  font-size: 14px;
}

.formbold-form-input:focus {
  border-bottom-color: var(--focus-border);
}

/* File input styling */
input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border-default);
  border-radius: 8px;
  background: var(--allergen-bg);
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="file"]:hover {
  border-color: var(--focus-border);
  background: var(--allergen-hover-bg);
}

/* Allergen Options */
.allergen-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.allergen-button {
  padding: 12px 16px;
  background-color: var(--allergen-bg);
  border: 2px solid var(--allergen-border);
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.allergen-button:hover {
  background-color: var(--allergen-hover-bg);
  transform: translateY(-1px);
}

.allergen-button.selected {
  background-color: var(--allergen-selected-bg);
  border-color: var(--focus-border);
  color: var(--allergen-selected-text);
  font-weight: 600;
}

/* Selected allergens tags */
.selected-allergens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.allergen-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 8px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  font-size: 14px;
  border: 1px solid var(--tag-border);
  font-weight: 500;
}

.allergen-tag .remove-tag {
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
  color: var(--tag-text);
  font-size: 16px;
  line-height: 1;
  transition: color 0.2s ease;
}

.allergen-tag .remove-tag:hover {
  color: var(--tag-hover-text);
}

/* Image Preview */
.image-preview-container {
  margin-top: 16px;
  max-width: 200px;
  border-radius: 8px;
  display: none;
  position: relative;
}

.image-preview {
  border: 2px solid var(--preview-border);
  width: 100%;
  display: block;
  border-radius: 8px;
}

.image-preview-btn {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 8px;
  font-size: 14px;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--border-default);
  border-radius: 30%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-preview-btn:hover {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

/* Components Section */
.component-group {
  position: relative; 
  margin-bottom: 20px; 
  border: 2px solid var(--border-default); 
  padding: 20px; 
  border-radius: 12px;
  background: var(--allergen-bg);
}

.component {
  position: absolute;
  top: 10px;
  right: 10px;
  transition: all 0.2s ease;
}

/* Button Styling */
.btn-container {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  flex: 1;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: 2px solid var(--border-default);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn:hover {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--btn-hover-shadow);
}

.btn:active {
  transform: translateY(0);
}

.comp-btn {
  font-size: 20px;
  font-weight: 900;
  padding: 12px 20px;
  border-radius: 8px;
  background-color: var(--bg-dark);
  border: 2px solid var(--border-default);
}

.cancel-btn {
  background-color: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
}

.cancel-btn:hover {
  background-color: #e9ecef;
  color: #495057;
}

.required {
  color: var(--required-text);
  font-weight: 600;
}

.hidden {
  display: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(47, 36, 65, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  animation: modalSlideIn 0.3s ease-out;
  border: 2px solid var(--border-default);
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-default);
}

.modal-icon {
  font-size: 24px;
  margin-right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
}

.modal-icon.success {
  background-color: var(--allergen-selected-bg);
  color: var(--allergen-selected-text);
  border: 2px solid var(--focus-border);
}

.modal-icon.error {
  background-color: #fef2f2;
  color: var(--required-text);
  border: 2px solid var(--required-text);
}

.modal-icon.warning {
  background-color: #fefbf2;
  color: #d97706;
  border: 2px solid #f59e0b;
}

.modal-icon.info {
  background-color: var(--tag-bg);
  color: var(--tag-text);
  border: 2px solid var(--tag-border);
}

.modal-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
  font-family: 'Mulish', sans-serif;
}

.modal-body {
  margin-bottom: 25px;
  color: var(--text-form);
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 15px 20px;
  border: 2px solid var(--border-default);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  font-family: 'Mulish', sans-serif;
  transition: all 0.2s ease;
  touch-action: manipulation;
  min-width: 90px;
}

.modal-btn.primary {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--border-default);
}

.modal-btn.primary:hover {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--btn-hover-shadow);
}

.modal-btn.secondary {
  background-color: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
}

.modal-btn.secondary:hover {
  background-color: #e9ecef;
  color: #495057;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-btn:active {
  transform: translateY(0);
}

/* Auto-dismiss loading bar styles */
.modal-message {
    margin-bottom: 20px;
    color: var(--text-form);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
}

.auto-dismiss-container {
    margin-top: 15px;
}

.auto-dismiss-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-default);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auto-dismiss-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        var(--allergen-selected-bg) 0%, 
        var(--focus-border) 50%, 
        var(--allergen-selected-bg) 100%);
    border-radius: 3px;
    transition: width 0.1s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect for the progress bar */
.auto-dismiss-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.auto-dismiss-text {
    font-size: 14px;
    color: var(--text-placeholder);
    text-align: center;
    font-style: italic;
    font-weight: 300;
}

/* Enhanced success modal styling */
.modal-content:has(.auto-dismiss-container) {
    cursor: pointer;
}

.modal-content:has(.auto-dismiss-container):hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}



/* Loading and Error Message Styles */
.loading-message, .error-message, .empty-message {
  padding: 20px;
  text-align: center;
  color: var(--text-placeholder);
  font-style: italic;
  font-family: 'Mulish', sans-serif;
  font-size: 16px;
}

.error-message {
  color: var(--required-text);
  background-color: #fef2f2;
  border: 2px solid var(--required-text);
  border-radius: 8px;
  margin: 15px 0;
}

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

.error-text {
  text-align: center;
}

.error-text strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-main);
  font-weight: 600;
}

.error-text p {
  margin: 0;
  font-size: 14px;
  color: var(--text-form);
}

.retry-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: 2px solid var(--border-default);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Mulish', sans-serif;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: translateY(-1px);
}



/* Mobile Responsive Design */
@media (max-width: 768px) {
  body {
      font-size: 14px;
      padding: 5px;
  }

  .formbold-main-wrapper {
      padding: 15px 5px;
      gap: 15px;
  }

  .formbold-form-wrapper {
      padding: 25px;
  }

  #productListContainer {
      padding: 20px;
  }

  .allergen-options {
      gap: 8px;
  }

  .allergen-button {
    padding: 10px 14px;
    font-size: 13px;
  }

  .btn-container {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .add-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .modal-content {
    padding: 25px;
    max-width: 90%;
  }
  
  .modal-title {
    font-size: 20px;
  }
  
  .modal-body {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .modal-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
 
  .auto-dismiss-bar {
        height: 5px;
        margin-bottom: 6px;
    }
    
    .auto-dismiss-text {
        font-size: 13px;
    }
    
    .modal-message {
        font-size: 14px;
        margin-bottom: 15px;
    }

   .logout-container {
      top: 15px;
      right: 15px;
    }

    .logout-btn {
      padding: 8px 16px;
      font-size: 13px;
      gap: 6px;
    }

    .logout-icon {
      font-size: 14px;
    }
}

@media (max-width: 480px) {
  .formbold-form-wrapper {
      padding: 20px;
  }

  #productListContainer {
      padding: 10px;
  }

  .allergen-button {
      padding: 8px 12px;
      font-size: 12px;
  }

  .btn {
      padding: 10px 14px;
      font-size: 13px;
  }

  #productList li.product-list-item {
      padding: 12px;
      font-size: 14px;
  }

  .modal-content {
      padding: 20px;
  }
  
  .modal-icon {
      font-size: 20px;
      width: 28px;
      height: 28px;
  }
  
  .modal-title {
      font-size: 18px;
  }
  
  .modal-body {
      font-size: 13px;
  }
  
  .modal-btn {
      padding: 10px 14px;
      font-size: 13px;
  }
  .auto-dismiss-bar {
      height: 4px;
      margin-bottom: 5px;
  }
    
  .auto-dismiss-text {
      font-size: 12px;
  }
  
  .modal-message {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .logout-container {
    display: flex;
    align-items: right; 
  }   

  .logout-btn {
    padding: 6px 12px;
    font-size: 12px;
    gap: 4px;
  }   

  .logout-icon {
    font-size: 13px;
  }   
}

/* Additional styling for textarea */
textarea.formbold-form-input {
  padding: 15px 12px;
  border: 2px solid var(--border-default);
  border-radius: 8px;
  background: var(--allergen-bg);
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

textarea.formbold-form-input:focus {
  border-color: var(--focus-border);
  background: white;
}


@media (hover: none) and (pointer: coarse) {
  .allergen-button:hover,
  .btn:hover,
  .add-btn:hover,
  .modal-btn:hover {
    transform: none;
  }
  
  .allergen-button:active,
  .btn:active,
  .add-btn:active,
  .modal-btn:active {
      transform: scale(0.95);
  }
}


@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}