/* @settings

name: Buttons
id: buttons-styles
settings:
    - 
        id: button-background
        title: Background
        type: variable-themed-color
        format: hex
        opacity: false
        default-light: '#f5f6f8'
        default-dark: '#1b1b1b'
    - 
        id: button-text
        title: Text
        type: variable-themed-color
        format: hex
        opacity: false
        default-light: '#1b1b1b'
        default-dark: '#f5f6f8'
    - 
        id: button-border
        title: Border
        type: variable-themed-color
        format: hex
        opacity: false
        default-light: '#7a9486'
        default-dark: '#84a83a'
    - 
        id: button-box-shadow
        title: Box Shadow
        type: variable-themed-color
        format: rgb
        opacity: true
        default-light: '#1b1b1b'
        default-dark: '#f5f6f8'
    -
        id: button-border-radius
        title: Border Radius
        type: variable-number
        format: px
        default: 5
    -
        id: button-size
        title: Font Size
        type: variable-number
        format: em
        default: 1

*/

.block-language-button {
  padding: 5px;
}

button.button-default {
  background: var(--interactive-normal, #f5f6f8);
  border-radius: 5px;
  border: 1px solid var(--interactive-accent, #ccc);
  color: var(--text-accent, #333);
  padding: 8px 8px;
  text-decoration: none;
  font-size: var(--button-size, 1em);
  margin: 0;
  box-shadow: none;
  transform: none;
  height: auto;
}

button.button-default:hover {
  background: var(--interactive-hover, #e8e9ea);
  border: 1px solid var(--interactive-accent-hover, #999);
  color: var(--text-accent-hover, #222);
  box-shadow: none;
  transform: none;
}

.theme-dark button.button-default {
  background: var(--interactive-normal);
  border: 1px solid var(--interactive-accent);
  color: var(--text-accent);
}

.theme-dark button.button-default:hover {
  background: var(--interactive-hover, #222);
  border: 1px solid var(--interactive-accent-hover, #84a83a);
  color: var(--text-accent-hover, #f5f6f8);
  box-shadow: none;
  transform: none;
}

button.button-inline {
  width: unset;
  height: unset;
  padding: 8px 8px;
}

button.button-default.blue {
  background: #76b3fa !important;
  color: black !important;
  border-color: #76b3fa !important;
}

button.button-default.red {
  background-color: red !important;
  color: black !important;
  border-color: red !important;
}

button.button-default.green {
  background: green !important;
  color: black !important;
  border-color: green !important;
}

button.button-default.yellow {
  background: yellow !important;
  color: black !important;
  border-color: yellow !important;
}

button.button-default.purple {
  background: #725585 !important;
  color: white !important;
  border-color: #725585 !important;
}

button.button-default.orange{
    background: #ff944c !important;
    color: black !important;
    border-color: #ff944c !important;
}

button.button-default.blue:hover {
  background: #8bc4ff !important;
  color: black !important;
  border-color: #8bc4ff !important;
}

button.button-default.red:hover {
  background: #ff4444 !important;
  color: black !important;
  border-color: #ff4444 !important;
}

button.button-default.green:hover {
  background: #44ff44 !important;
  color: black !important;
  border-color: #44ff44 !important;
}

button.button-default.yellow:hover {
  background: #ffff44 !important;
  color: black !important;
  border-color: #ffff44 !important;
}

button.button-default.purple:hover {
  background: #8a6ba8 !important;
  color: white !important;
  border-color: #8a6ba8 !important;
}

button.button-default.orange:hover {
    background: #ffb366 !important;
    color: black !important;
    border-color: #ffb366 !important;
}

/* Modern Button Maker Styles */
.button-maker {
  max-width: 45rem;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
}

.button-maker-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-normal);
  margin-bottom: 1rem;
  padding: 1.5rem 1.5rem 0 1.5rem;
  box-sizing: border-box;
}

.button-maker-container {
  padding: 0 1.5rem 1.5rem 1.5rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.button-maker-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-section {
  background: var(--background-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--background-modifier-border);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-normal);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--interactive-accent);
  width: 100%;
  box-sizing: border-box;
}

.form-field {
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.field-label {
  display: block;
  font-weight: 600;
  color: var(--text-normal);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.field-description {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
}

.button-maker .field-input,
.button-maker .field-textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--background-modifier-border);
  border-radius: 6px;
  background: var(--background-primary);
  color: var(--text-normal);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}



.button-maker .field-input:focus,
.button-maker .field-textarea:focus {
  outline: none;
  border-color: var(--interactive-accent);
  box-shadow: 0 0 0 2px rgba(var(--interactive-accent-rgb), 0.2);
}



.field-textarea {
  resize: vertical;
  min-height: 80px;
}

.toggle-settings {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--background-primary);
  border-radius: 6px;
  border: 1px solid var(--background-modifier-border);
  transition: all 0.2s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.toggle-field:hover {
  border-color: var(--interactive-accent);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.toggle-input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--interactive-accent);
  flex-shrink: 0;
}

.toggle-text {
  font-weight: 600;
  color: var(--text-normal);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.toggle-description {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
}

.action-container {
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.actions-header {
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.actions-header h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-normal);
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.actions-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 100%;
  box-sizing: border-box;
}

.actions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.action-card {
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.action-card:hover {
  border-color: var(--interactive-accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.action-number {
  font-weight: 600;
  color: var(--text-normal);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.btn-remove {
  background: var(--background-modifier-error);
  color: var(--text-on-accent);
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-remove:hover {
  background: var(--background-modifier-error-hover);
}





.action-input-container {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.action-input {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--background-modifier-border);
  border-radius: 6px;
  background: var(--background-primary);
  color: var(--text-normal);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--interactive-accent);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background: var(--interactive-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: transparent;
  color: var(--text-normal);
  border: 2px solid var(--interactive-accent);
}

.btn-secondary:hover {
  background: var(--interactive-accent);
  color: var(--text-on-accent);
}

.btn-add-action {
  background: var(--interactive-success);
  color: var(--text-on-accent);
  margin-top: 0.5rem;
}

.btn-add-action:hover {
  background: var(--interactive-success-hover);
  transform: translateY(-1px);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--background-modifier-border);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.preview-section {
  background: var(--background-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--background-modifier-border);
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  background: var(--background-primary);
  border-radius: 6px;
  border: 1px solid var(--background-modifier-border);
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.remove-settings,
.replace-settings,
.inherit-settings {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--background-primary);
  border-radius: 6px;
  border: 1px solid var(--background-modifier-border);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-color-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 768px) {
  .button-maker {
    max-width: 95vw;
    width: 95vw;
    max-height: 90vh;
  }
  
  .custom-color-container {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* Dark theme adjustments */
.theme-dark .button-maker {
  background: var(--background-primary);
}

.theme-dark .form-section {
  background: var(--background-secondary-alt);
}

.theme-dark .action-card {
  background: var(--background-primary);
}

.theme-dark .toggle-field {
  background: var(--background-primary);
}

.theme-dark .preview-container {
  background: var(--background-primary);
}

/* Animation for smooth transitions */
.form-field,
.toggle-field,
.action-card {
  animation: fadeIn 0.3s ease-in-out;
}

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