div#form-builder {
    width: 376px !important;
}


@media (max-width: 768px) {
.event-form .form-group {
    margin-bottom: 15px;
}
}

.event-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #5e5e5e;
}


.answer-content {
    background-color: white;
    padding: 13px;
    border-radius: 5px; 
}

button.toggle-answer.button {
    background-color: #edb005;
    padding: 4px;
    border-radius: 10px;
    font-size: 10px;
    color: white;
}

button.submit-form.button {
    background-color: #3eb700;
    padding: 8px;
    border-radius: 16px;
    font-size: 15px;
    color: white;
    margin-bottom: 20px;
    /* margin-top: 8px; */
    text-align: right;
}


button.remove-field.button {
    background-color: #ad0000;
    padding: 5px;
    border-radius: 16px;
    font-size: 11px;
    color: white;
}

.yeeee {
    font-size: 12px;
    padding-bottom: 5px;
    margin-top:100px;
}

button#save-form {
    background-color: #3eb700;
    padding: 8px;
    border-radius: 16px;
    font-size: 18px;
    color: white;
    margin-bottom: 20px;
    margin-top: 8px;
    text-align: right;
}

button#add-field {
    background-color: #3eb700;
    padding: 6px;
    border-radius: 16px;
    font-size: 12px;
    color: white;
    margin-bottom: 20px;
    margin-top: 8px;
}

button.add-option.button {
    background-color: #3eb700;
    padding: 4px;
    border-radius: 16px;
    font-size: 10px;
    color: white;
    margin-bottom: 7px;
}

button.remove-option.button {
    background-color: #ad0000;
    padding: 4px;
    border-radius: 16px;
    font-size: 10px;
    color: white;
}

.event-form .form-control {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.event-form .required {
    color: red;
}

.event-form .custom-option-input {
    margin-top: 5px;
    width: 100%;
    padding: 8px;
}

.form-field {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.form-field .field-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-field .field-header .dashicons {
    cursor: move;
    margin-right: 10px;
}

.form-field .field-type {
    flex-grow: 1;
    font-weight: bold;
}

.form-field .field-content label {
    display: block;
    margin-bottom: 5px;
}

.form-field .field-content input[type="text"],
.form-field .field-content input[type="checkbox"] {
    margin-bottom: 10px;
}

.option-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.option-row input[type="text"] {
    flex-grow: 1;
    margin-right: 10px;
}

.answer-block {
    margin-bottom: 20px;
}

.answer-block h2 {
    display: flex;
    align-items: center;
    font-size: 16px;
}

.answer-block h2 .answer-date {
    font-size: 11px;
    color: #000000;
    margin-left: 5px;
    font-weight: 100;
}

.answer-block .toggle-answer {
    margin-left: 10px;
    cursor: pointer;
}

.answer-block dl {
    margin: 0;
}

.answer-block dt {
    font-weight: bold;
    margin-top: 10px;
}

.answer-block dd {
    margin: 5px 0 10px 20px;
}

.answer-content {
    display: block;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ccc;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.save-form-wrapper, .submit-form-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Стилі для кнопки-перемикача */
.toggle-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 18px;
}

.toggle-container:before {
    content: "Стан форми:";
    margin-right: 10px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

.toggle-container input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.toggle-label {
    width: 90px;
    height: 30px;
    display: inline-block;
    position: relative;
    border-radius: 14px;
    background: rgb(138,138,138);
    background: linear-gradient(to bottom, rgba(138,138,138,1) 0%, rgba(140,140,140,1) 14%, rgba(159,159,159,1) 72%, rgba(164,164,164,1) 100%);
    box-shadow: inset 0 2px 5px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-label:before {
    content: "не активна";
    position: absolute;
    left: 33px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 10px;
    transition: all 0.3s ease;
}

.toggle-label i {
    position: absolute;
    top: -4px;
    right: 60px;
    width: 36px;
    height: 36px;
    display: block;
    border-radius: 36px;
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(252,252,252,1) 11%, rgba(228,228,228,1) 50%, rgba(221,221,221,1) 53%, rgba(205,205,205,1) 97%, rgba(191,191,191,1) 100%);
    box-shadow: inset 0 -3px 3px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 1px 0 rgba(255, 255, 255, 0.4), 0 2px 0 0 rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.toggle-label i:before {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 18px;
    background: linear-gradient(to bottom, rgba(239,239,239,1) 0%, rgba(225,225,225,1) 6%, rgba(225,225,225,1) 24%, rgba(229,229,229,1) 94%, rgba(242,242,242,1) 100%);
    box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.1);
}

.toggle-label:hover i {
    box-shadow: inset 0 -3px 3px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 1px 0 rgba(255, 255, 255, 0.4), 0 2px 0 0 rgba(0, 0, 0, 0.3);
}

.toggle-label:active i:before {
    box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.3);
}

input[type="checkbox"]:checked ~ .toggle-label {
    background: linear-gradient(to bottom, #3eb700 0%, #3eb700 100%);
}

input[type="checkbox"]:checked ~ .toggle-label:before {
    content: "активна";
    left: 13px;
}

input[type="checkbox"]:checked ~ .toggle-label i {
    right: -6px;
}

/* Оновлені стилі для кнопок */
button.button {
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border-radius: 14px;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);
}

button.button:hover {
    box-shadow: inset 0 2px 5px 0 rgba(0, 0, 0, 0.2), inset 0 -1px 0 0 rgba(0, 0, 0, 0.2);
}

button.button:active {
    box-shadow: inset 0 2px 5px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 0 rgba(0, 0, 0, 0.3);
}

/* Специфічні стилі для різних кнопок */
button#save-form {
    background: linear-gradient(to bottom, #3eb700 0%, #3eb700 100%);
}

button#add-field {
    background: linear-gradient(to bottom, #3eb700 0%, #3eb700 100%);
}

button.add-option.button {
    background: linear-gradient(to bottom, #3eb700 0%, #3eb700 100%);
}

button.remove-field.button {
    background: linear-gradient(to bottom, #ad0000 0%, #ad0000 100%);
}

button.remove-option.button {
    background: linear-gradient(to bottom, #ad0000 0%, #ad0000 100%);
}

button.toggle-answer.button {
    background: linear-gradient(to bottom, #edb005 0%, #edb005 100%);
}

button.submit-form.button {
    background: linear-gradient(to bottom, #3eb700 0%, #3eb700 100%);
}

button.toggle-answer.button.toggle-answer-small {
    font-size: 8px;
    padding: 2px 8px;
    height: 20px;
}

button.toggle-all-answers.button {
    background: linear-gradient(to bottom, #edb005 0%, #edb005 100%);
    color: #fff;
}

/* Оновлені стилі для контейнера кнопок */
.save-form-wrapper, .submit-form-wrapper {
    margin-top: 60px;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.form-success-message {
    background-color: #f0f8ff;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    animation: fadeIn 0.5s ease-in-out;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #5e5e5e;
    margin-top: 25px;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.checkbox-option,
.radio-option {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.checkbox-option input[type="checkbox"],
.radio-option input[type="radio"] {
    margin: 0;
    margin-right: 8px;
}

.checkbox-option label,
.radio-option label {
    margin: 0;
    font-weight: normal;
    line-height: 1;
}

.custom-option {
    margin-top: 10px;
}

.custom-option input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.required {
    color: red;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.preview-form-btn {
  background: #eee !important;
  color: #444 !important;
  border: 1px solid #ccc !important;
  font-size: 12px !important;
  padding: 3px 10px !important;
  min-width: 80px;
  margin-right: 10px;
  box-shadow: none !important;
  transition: background 0.2s;
}
.preview-form-btn:hover {
  background: #e0e0e0 !important;
  color: #222 !important;
}
#preview-form-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.35);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#preview-form-modal > div {
  background: #fff;
  max-width: 600px;
  width: 90vw;
  margin: 40px auto;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  position: relative;
  padding: 32px 24px 24px 24px;
}
#close-preview-form {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}
#close-preview-form:hover {
  color: #222;
}
#preview-form-content {
  min-height: 40px;
}
.event-form-preview input,
.event-form-preview textarea {
  background: #f8f8f8;
  color: #888;
  border: 1px solid #eee;
  pointer-events: none;
}

.preview-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}
.preview-loader:after {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 4px solid #bbb;
  border-top: 4px solid #46b450;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.form-actions-group {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
  margin-bottom: 8px;
}
.form-actions-group .button {
  border: none !important;
  outline: none;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 26px !important;
  font-size: 15px !important;
  font-weight: 500;
  height: 44px;
  line-height: 44px;
  background: #f5f5f5;
  color: #444;
  transition: background 0.18s, color 0.18s;
  border-radius: 0 !important;
}
.form-actions-group .button:first-child {
  border-radius: 20px 0 0 20px !important;
  border-right: 1px solid #e0e0e0 !important;
  background: #dbdbdb !important;
  color: #444 !important;
}
.form-actions-group .button:first-child:hover, .form-actions-group .button:first-child:focus {
  background: #ededed !important;
  color: #222 !important;
}
.form-actions-group .button:last-child {
  border-radius: 0 20px 20px 0 !important;
  background: #46b450 !important;
  color: #fff !important;
  border-left: none !important;
}
.form-actions-group .button:last-child:hover, .form-actions-group .button:last-child:focus {
  background: #389e3c !important;
  color: #fff !important;
}
@media (max-width: 480px) {
  .form-actions-group .button {
    font-size: 13px !important;
    padding: 0 12px !important;
    height: 38px;
    line-height: 38px;
  }
}

.save-form-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.save-form-wrapper .toggle-container {
  flex: 0 0 auto;
  min-width: 120px;
}
.save-form-wrapper .form-actions-group {
  flex: 1 1 auto;
  justify-content: flex-end;
}
@media (max-width: 600px) {
  .save-form-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .save-form-wrapper .form-actions-group {
    justify-content: stretch;
  }
}

.dashed-divider {
    border: none;
    border-top: 1px dashed #999;
    width: 100%;
    margin-top: 60px;
    margin-bottom: 20px; /* можеш змінити або прибрати */
}
