/* ==================== NEW EMBED BUILDER DESIGN ==================== */

/* Custom Scrollbar for Builder */
.editor-content::-webkit-scrollbar,
.section-content::-webkit-scrollbar,
.dark-textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.editor-content::-webkit-scrollbar-track,
.section-content::-webkit-scrollbar-track,
.dark-textarea::-webkit-scrollbar-track {
    background: #1a1a1e;
    border-radius: 10px;
}

.editor-content::-webkit-scrollbar-thumb,
.section-content::-webkit-scrollbar-thumb,
.dark-textarea::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 10px;
}

.editor-content::-webkit-scrollbar-thumb:hover,
.section-content::-webkit-scrollbar-thumb:hover,
.dark-textarea::-webkit-scrollbar-thumb:hover {
    background: #ff6788;
}

/* Builder Container */
.new-embed-builder {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* New Embed Button */
.btn-new-embed {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 103, 136, 0.15);
    border: 2px dashed rgba(255, 103, 136, 0.4);
    border-radius: 6px;
    color: #ff6788;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn-new-embed:hover {
    background: rgba(255, 103, 136, 0.25);
    border-color: #ff6788;
    transform: translateY(-1px);
}

.btn-new-embed i {
    font-size: 1rem;
}

/* Embed Wrapper */
.embed-wrapper {
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1e;
}

/* Embed Main Header */
.embed-main-header {
    background: #242429;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #3a3a3f;
}

.embed-collapse-btn {
    background: transparent;
    border: none;
    color: #b8b8b8;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.embed-collapse-btn:hover {
    background: rgba(255, 103, 136, 0.15);
    color: #ff6788;
}

.embed-collapse-btn i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.embed-wrapper.collapsed .embed-collapse-btn i {
    transform: rotate(-90deg);
}

.embed-header-info {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.embed-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.embed-subtitle {
    font-size: 0.85rem;
    color: #808080;
}

.embed-header-actions {
    display: flex;
    gap: 0.35rem;
}

.embed-content-wrapper {
    padding: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 5000px;
    opacity: 1;
}

.embed-wrapper.collapsed .embed-content-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Collapsible Section */
.collapsible-section {
    border-left: 4px solid #ff6788;
    margin-bottom: 0.25rem;
    will-change: auto;
}

.collapsible-section .section-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease;
    opacity: 1;
    will-change: max-height;
}

.collapsible-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.collapsible-section.collapsed .section-chevron {
    transform: rotate(-90deg);
}

/* Section Header */
.section-header {
    background: #242429;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.section-header:hover {
    background: #2a2a2f;
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-chevron {
    color: #b8b8b8;
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.02em;
}

.section-subtitle {
    font-size: 0.85rem;
    color: #808080;
    font-weight: 400;
}

.section-count {
    font-size: 0.85rem;
    color: #808080;
    margin-left: 0.5rem;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

/* Icon Buttons */
.icon-btn {
    background: transparent;
    border: none;
    color: #b8b8b8;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.icon-btn:hover {
    background: rgba(255, 103, 136, 0.15);
    color: #ff6788;
}

/* Section Content */
.section-content {
    background: #1a1a1e;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Form Elements */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.field-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    padding-top: 8px;
    padding-bottom: 8px;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    color: #808080;
    font-weight: 400;
}

/* Dark Inputs */
.dark-input,
.dark-textarea,
.dark-select {
    background: #242429;
    border: 1px solid #242429;
    border-radius: 4px;
    padding: 0.65rem 0.85rem;
    color: #fff;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.dark-input:focus,
.dark-textarea:focus,
.dark-select:focus {
    border-color: #ff6788;
    box-shadow: 0 0 0 1px #ff6788;
}

.dark-input::placeholder,
.dark-textarea::placeholder {
    color: #606060;
}

.dark-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
    margin-bottom: 8px;
}

.dark-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5bac1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.125rem;
    padding-right: 2.5rem;
    cursor: pointer;
    font-weight: 500;
}

.dark-select:hover {
    background-color: #2a2a2f;
    border-color: #3a3a3f;
}

.dark-select option {
    background: #1e1f22;
    color: #fff;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.dark-select option:hover,
.dark-select option:checked {
    background: #2b2d31;
    color: #ff6788;
}

.dark-select option:disabled {
    color: #606060;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .dark-input {
    flex: 1;
    padding-right: 3rem;
}

.input-icon-btn {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: #b8b8b8;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.input-icon-btn:hover {
    background: rgba(255, 103, 136, 0.15);
    color: #ff6788;
}

/* Text Editor Toolbar */
.text-editor {
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #242429;
    border-radius: 4px 4px 0 0;
    border: 1px solid #242429;
    border-bottom: none;
    overflow-x: auto;              /* allow horizontal scroll on small screens */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
    scroll-behavior: smooth;
    white-space: nowrap;           /* prevent wrap so it overflows horizontally */
}

.editor_toolbar_alt {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #1a1a1e;
    border-radius: 4px 4px 0 0;
    border: 1px solid #1a1a1e;
    border-bottom: none;
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: #b8b8b8;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    flex: 0 0 auto;               /* prevent shrinking so items overflow and can scroll */
}

.toolbar-btn:hover {
    background: rgba(255, 103, 136, 0.15);
    color: #ff6788;
}

.text-editor .dark-textarea {
    border-radius: 0 0 4px 4px;
}

/* Color Input Group */
.color-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-text {
    flex: 1;
}

.color-picker-inline {
    width: 48px;
    height: 38px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.color-picker-inline-alt {
    width: 100%;
    height: 38px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.color-picker-inline::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-inline::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Action Buttons */
.section-actions-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-new {
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-new.btn-primary {
    background: #ff6788;
    color: #000;
}

.btn-new.btn-primary:hover {
    background: #ff5577;
    transform: translateY(-1px);
}

.btn-new.btn-danger {
    background: rgba(255, 103, 136, 0.2);
    color: #ff6788;
    border: 1px solid rgba(255, 103, 136, 0.3);
}

.btn-new.btn-danger:hover {
    background: rgba(255, 103, 136, 0.3);
    border-color: rgba(255, 103, 136, 0.5);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 11000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    background: #242429;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #1a1a1e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: #b8b8b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ff6788;
}

.ffmodal-close {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.ffmodal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 1.25rem;
}

.modal-subtitle {
    color: #b8b8b8;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.modal-footer {
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Mention Modal Specific */
.mention-login-box {
    text-align: center;
    padding: 2rem 1rem;
}

.mention-login-box h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.mention-login-box p {
    color: #b8b8b8;
    margin-bottom: 1.5rem;
}

.mention-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.mention-divider::before,
.mention-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #3a3a3f;
}

.mention-divider::before {
    left: 0;
}

.mention-divider::after {
    right: 0;
}

.mention-divider span {
    color: #808080;
    font-size: 0.875rem;
    background: #242429;
    padding: 0 1rem;
}

.basic-mentions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.mention-chip {
    background: rgba(255, 103, 136, 0.15);
    border: 1px solid rgba(255, 103, 136, 0.3);
    color: #ff6788;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mention-chip:hover {
    background: rgba(255, 103, 136, 0.25);
    border-color: #ff6788;
}

.mention-option {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: stretch;
}

.mention-option select,
.mention-option input {
    flex: 1;
    min-width: 0;
    background: #1a1a1e;
    border: 1px solid #3a3a3f;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.mention-option select:hover,
.mention-option input:hover {
    border-color: #ff6788;
    background: #242429;
}

.mention-option select:focus,
.mention-option input:focus {
    border-color: #ff6788;
    background: #242429;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 103, 136, 0.1);
}

.mention-option .btn-new {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Action Response Tabs */
.action-response-tabs {
    display: flex;
    gap: 0.5rem;
    background: #1a1a1e;
    padding: 0.35rem;
    border-radius: 6px;
}

.action-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: #121214;
    border: 1px solid transparent;
    color: #b8b8b8;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-tab:hover {
    background: #242429;
    color: #dbdee1;
}

.action-tab.active {
    background: #ff6788;
    border-color: #ff6788;
    color: #000000;
    box-shadow: 0 2px 8px rgba(255, 103, 136, 0.3);
}

/* Layers List */
.layout-layers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    border: 1px solid #24242900;
    background: rgba(36, 36, 41, 100);
    border-radius: 6px;
    padding: 0.8rem 0.8rem;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.layer-item:hover {
    background: #202126;
    border-color: #3a3a3f;
}

.layer-item.active {
    border-color: #ff6788;
    box-shadow: 0 0 0 1px rgba(255, 103, 136, 0.35), 0 4px 14px rgba(255, 103, 136, 0.15);
}

.layer-item-left {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0; /* allow title to truncate */
}

.layer-drag-handle {
    color: #6f6f78;
}

.layer-type-icon {
    color: #dbdee1;
}

.layer-index {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 6px;
    background: rgba(255, 103, 136, 0.18);
    border: 1px solid rgba(255, 103, 136, 0.3);
    color: #ff8aa6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.layer-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 26ch;
}

.layer-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.layer-item.empty {
    justify-content: center;
    color: #808080;
    font-weight: 500;
}

/* Markdown formatting in preview */
/* Headers */
.message-content .md-h1,
.embed-description .md-h1,
.embed-field-value .md-h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem 0;
    line-height: 1.3;
}

.message-content .md-h2,
.embed-description .md-h2,
.embed-field-value .md-h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem 0;
    line-height: 1.3;
}

.message-content .md-h3,
.embed-description .md-h3,
.embed-field-value .md-h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem 0;
    line-height: 1.3;
}

/* Lists */
.message-content .md-list,
.embed-description .md-list,
.embed-field-value .md-list {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content .md-list-item,
.embed-description .md-list-item,
.embed-field-value .md-list-item {
    margin: 0.25rem 0;
    list-style-type: disc;
}

/* Bold */
.message-content strong,
.embed-description strong,
.embed-field-value strong,
.embed-field-name strong,
.embed-footer strong {
    font-weight: 700;
}

.message-content em,
.embed-description em,
.embed-field-value em,
.embed-field-name em {
    font-style: italic;
}

.message-content u,
.embed-description u,
.embed-field-value u,
.embed-field-name u {
    text-decoration: underline;
}

.message-content s,
.embed-description s,
.embed-field-value s,
.embed-field-name s {
    text-decoration: line-through;
}

.message-content code,
.embed-description code,
.embed-field-value code,
.embed-field-name code {
    background: #1e1f22;
    color: #dbdee1;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
}

.message-content pre,
.embed-description pre,
.embed-field-value pre {
    background: #2b2d31;
    color: #dbdee1;
    padding: 0.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.message-content pre code,
.embed-description pre code,
.embed-field-value pre code {
    background: transparent;
    padding: 0;
}

.message-content .spoiler,
.embed-description .spoiler,
.embed-field-value .spoiler {
    background: #1e1f22;
    color: #1e1f22;
    padding: 0 0.2rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.message-content .spoiler:hover,
.embed-description .spoiler:hover,
.embed-field-value .spoiler:hover {
    background: #2b2d31;
    color: #dbdee1;
}

.message-content .mention,
.embed-description .mention,
.embed-field-value .mention,
.embed-field-name .mention,
.embed-footer .mention {
    background: rgba(88, 101, 242, 0.15);
    padding: 0 0.2rem;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s ease;
}

.message-content .mention:hover,
.embed-description .mention:hover,
.embed-field-value .mention:hover,
.embed-field-name .mention:hover {
    background: rgba(88, 101, 242, 0.3);
}

.message-content a,
.embed-description a,
.embed-field-value a,
.embed-author-name a {
    color: #00aff4;
    text-decoration: none;
}

.message-content a:hover,
.embed-description a:hover,
.embed-field-value a:hover,
.embed-author-name a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Image URL Validation */
.dark-input.invalid {
    border-color: #ff6788 !important;
    box-shadow: 0 0 0 1px #ff6788 !important;
}

.dark-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #242429;
    border: 1px solid #242429;
    border-radius: 4px;
    outline: none;
}
.dark-range:focus {
    box-shadow: 0 0 0 1px #ff6788;
    border-color: #ff6788;
}
.dark-range::-webkit-slider-runnable-track {
    height: 6px;
    background: #242429;
    border-radius: 4px;
}
.dark-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff6788;
    border: 2px solid #ffffff;
    cursor: pointer;
    margin-top: -6px;
}
.dark-range::-moz-range-track {
    height: 6px;
    background: #242429;
    border-radius: 4px;
}
.dark-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff6788;
    border: 2px solid #ffffff;
    cursor: pointer;
}

.image-dropzone{
    position: relative;
    background:#1e1f22;
    border:2px dashed rgba(255,255,255,.35);
    border-radius:8px;
    overflow:hidden;
    cursor:pointer;
    transition: border-color .15s ease, background .15s ease;
}
.image-dropzone.square{width:160px;height:160px}
.image-dropzone.wide{width:100%;height:180px}
.image-dropzone:hover{background:#22242a;border-color:#ff6788}
.image-dropzone.dragover{background:#24262d;border-color:#ff6788}
.image-drop-inner{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#dbdee1;gap:.5rem;pointer-events:none}
.image-drop-inner i{font-size:36px;color:#ffffff}
.image-drop-inner span{font-size:.85rem;color:#b5bac1}
.image-dropzone .image-preview{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:none}
.image-dropzone.has-image .image-preview{display:block}
.image-dropzone.has-image .image-drop-inner{opacity:0}
.image-picker-input{display:none}
.image-mode-content{animation:fadeIn .2s ease}

.image-url-error,
.url-error {
    display: none;
    color: #ff6788;
    font-size: 0.75rem;
    margin-top: 0.35rem;
    padding-left: 0.25rem;
    font-weight: 500;
}

.image-url-error.active,
.url-error.active {
    display: block;
    animation: errorSlideIn 0.2s ease;
}

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

/* Modern Toggle Switch */
.modern-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.modern-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3f;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #949ba4;
    transition: 0.3s;
    border-radius: 50%;
}

.modern-toggle input:checked + .toggle-slider {
    background-color: #ff6788;
}

.modern-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

.modern-toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(255, 103, 136, 0.25);
}

/* Simplified Embed Editor */
.simplified-embed-editor input:focus,
.simplified-embed-editor textarea:focus {
    border-color: #ff6788 !important;
    box-shadow: 0 0 0 1px #ff6788 !important;
    outline: none;
}

/* Send Message Section */
.send-message-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #3a3a3f;
}

.message-identity-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Templates Button */
.btn-templates {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 103, 136, 0.15) 0%, rgba(255, 103, 136, 0.05) 100%);
    border: 2px solid rgba(255, 103, 136, 0.3);
    border-radius: 8px;
    color: #ff6788;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.btn-templates:hover {
    background: linear-gradient(135deg, rgba(255, 103, 136, 0.25) 0%, rgba(255, 103, 136, 0.15) 100%);
    border-color: #ff6788;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 103, 136, 0.3);
}

.btn-templates i {
    font-size: 1.1rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* Modal Large */
.modal-large {
    max-width: 900px;
    width: 95%;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.template-card {
    background: #1a1a1e;
    border: 2px solid #3a3a3f;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.template-card:hover {
    border-color: #ff6788;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 103, 136, 0.2);
}

.template-preview {
    padding: 1rem;
    min-height: 200px;
    background: #2b2d31;
    border-radius: 4px 4px 0 0;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.preview-bot-avatar {
    width: 40px;
    height: 40px;
    background: #5865f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.preview-bot-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preview-bot-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.preview-bot-badge {
    background: #5865f2;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.preview-timestamp {
    font-size: 0.75rem;
    color: #949ba4;
}

.template-preview .mini-embed {
    padding: 0.75rem;
    background: #2b2d31;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.template-preview .mini-embed-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mini-author-icon,
.mini-footer-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.template-preview .mini-embed-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.4rem;
}

.template-preview .mini-embed-description {
    font-size: 0.8rem;
    color: #dbdee1;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.mini-embed-fields {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
}

.mini-embed-field {
    min-width: 0;
}

.mini-embed-field.full-width {
    grid-column: 1 / -1;
}

.mini-field-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.mini-field-value {
    font-size: 0.75rem;
    color: #dbdee1;
    line-height: 1.3;
    word-wrap: break-word;
}

.template-preview .mini-embed-footer {
    font-size: 0.7rem;
    color: #949ba4;
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid #3a3a3f;
    padding-top: 0.5rem;
}

.template-info {
    padding: 1rem;
    border-top: 1px solid #3a3a3f;
}

.template-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.template-description {
    font-size: 0.8rem;
    color: #808080;
}

/* Embed Selector List */
.embed-selector-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.embed-selector-item {
    padding: 1rem 1.25rem;
    background: #1a1a1e;
    border: 2px solid #3a3a3f;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.embed-selector-item:hover {
    border-color: #ff6788;
    background: rgba(255, 103, 136, 0.05);
}

.embed-selector-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.embed-selector-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.embed-selector-subtitle {
    font-size: 0.8rem;
    color: #808080;
}

.embed-selector-icon {
    color: #ff6788;
    font-size: 1.25rem;
}

/* Emoji Picker Styles */
.emoji-picker-search {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3a3a3f;
}

.emoji-picker-search input {
    width: 100%;
    background: #0e0e10;
    border: 1px solid #3a3a3f;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}

.emoji-section {
    margin-bottom: 1.5rem;
}

.emoji-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #949ba4;
    margin-bottom: 0.6rem;
    padding: 0.4rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 0.3rem;
}

.emoji-item {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.emoji-item:hover {
    background: #2e3035;
    transform: scale(1.15);
}

.emoji-item.server-emoji {
    background: transparent;
}

.emoji-item.server-emoji:hover {
    background: #2e3035;
}

.emoji-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.emoji-categories {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.emoji-categories::-webkit-scrollbar {
    width: 8px;
}

.emoji-categories::-webkit-scrollbar-track {
    background: #1a1a1e;
    border-radius: 4px;
}

.emoji-categories::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 4px;
}

.emoji-categories::-webkit-scrollbar-thumb:hover {
    background: #4a4a4f;
}

.emoji-name {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.emoji-item:hover .emoji-name {
    opacity: 1;
}

#serverEmojisSection.hidden {
    display: none;
}

/* Server Selector Styles */
.server-select-button {
    width: 100%;
    background: #242429;
    border: 1px solid #242429;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    color: #dbdee1;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.server-select-button:hover {
    border-color: #ff6788;
    background: #2a2a2f;
}

.server-select-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.server-select-content img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.server-select-content i {
    font-size: 1.25rem;
    color: #949ba4;
}

.server-search {
    margin-bottom: 1.5rem;
}

.server-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.server-card {
    background: #1a1a1e;
    border: 2px solid #3a3a3f;
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.server-card:hover {
    border-color: #ff6788;
    background: #242429;
    transform: translateY(-2px);
}

.server-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.server-card.disabled:hover {
    transform: none;
    border-color: #3a3a3f;
    background: #1a1a1e;
}

.server-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #2a2a2f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.server-info {
    flex: 1;
    min-width: 0;
}

.server-name {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-members {
    font-size: 0.8rem;
    color: #949ba4;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.server-status.bot-in {
    background: rgba(67, 181, 129, 0.1);
    color: #43b581;
    border: 1px solid rgba(67, 181, 129, 0.3);
}

.server-status.bot-out {
    background: rgba(250, 166, 26, 0.1);
    color: #faa61a;
    border: 1px solid rgba(250, 166, 26, 0.3);
}

.server-status i {
    font-size: 0.75rem;
}

.server-invite-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    background: #ff6788;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
}

.server-invite-btn:hover {
    background: #ff4d6d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 103, 136, 0.3);
}

.server-list::-webkit-scrollbar {
    width: 8px;
}

.server-list::-webkit-scrollbar-track {
    background: #1a1a1e;
    border-radius: 4px;
}

.server-list::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 4px;
}

.server-list::-webkit-scrollbar-thumb:hover {
    background: #4a4a4f;
}

/* ==================== CHANNEL LIST STYLES ==================== */
.channel-list-container {
    background: #1a1a1e;
    border: 2px solid #3a3a3f;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
}

.channel-list-empty,
.channel-list-loading,
.channel-list-error {
    text-align: center;
    padding: 2rem;
    color: #949ba4;
    font-size: 0.9rem;
}

.channel-list-loading i {
    margin-right: 0.5rem;
}

.channel-list-error {
    color: #ed4245;
}

.channel-category-group {
    margin-bottom: 0.75rem;
}

.channel-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    color: #949ba4;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.channel-category-header i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.channel-category-header:hover {
    color: #b9bbbe;
}

.channel-category-channels {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-left: 0.5rem;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.channel-item:hover {
    background: #2a2a2e;
}

.channel-item.selected {
    background: #ff678820;
    border-left: 3px solid #ff6788;
}

.channel-item.sticky-selected {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ff678840 !important;
    border-left: 3px solid #ff6788;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.channel-item.sticky-selected::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #ff6788, transparent);
}

.channel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #949ba4;
    font-size: 0.85rem;
}

.channel-item.selected .channel-icon {
    color: #ff6788;
}

.channel-name {
    color: #dcddde;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
}

.channel-item:hover .channel-name {
    color: #fff;
}

.channel-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.channel-item.disabled:hover {
    background: transparent;
}

.channel-list-container::-webkit-scrollbar {
    width: 8px;
}

.channel-list-container::-webkit-scrollbar-track {
    background: #1a1a1e;
    border-radius: 4px;
}

.channel-list-container::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 4px;
}

.channel-list-container::-webkit-scrollbar-thumb:hover {
    background: #4a4a4f;
}

/* ==================== BUTTONS SECTION WRAPPER ==================== */
.buttons-section-wrapper {
    background: #1a1a1e;
    border: 2px solid #3a3a3f;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header-main {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #3a3a3f;
}

.section-header-main h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header-main h3 i {
    color: #ff6788;
}

.section-description {
    color: #949ba4;
    font-size: 0.85rem;
    margin: 0;
}

@media (max-width: 768px) {
    .message-identity-row {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .modal-large {
        width: 98%;
        max-width: 98vw;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
    
    .emoji-item {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        padding: 0.65rem 0.85rem;
    }
    
    .section-content {
        padding: 0.85rem;
    }
    
    .section-title {
        font-size: 0.85rem;
    }
    
    .section-actions-row {
        flex-direction: column;
    }
    
    .btn-new {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
        max-width: 95vw;
    }
    
    .modal-header {
        padding: 0.85rem;
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 0.85rem;
        overflow-y: auto;
    }
    
    .save-current-row {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .save-current-row input {
        width: 100% !important;
    }
    
    .save-current-row button {
        width: 100% !important;
        justify-content: center;
    }
    
    /* Auto backup section compact for mobile */
    #autoBackupSection .section-actions-row {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.35rem !important;
    }
    
    #autoBackupSection .btn-new {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.75rem !important;
        flex: 1 1 auto;
        min-width: fit-content;
    }
    
    #autoBackupSection .btn-new i {
        font-size: 0.7rem;
    }
    
    .auto-backup-preview {
        max-height: 120px !important;
        padding: 0.5rem !important;
    }
    
    #autoBackupSection .mode-toggle {
        gap: 0.25rem;
    }
    
    #autoBackupSection .mode-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    #autoBackupSection > div > div:first-child {
        padding: 0.5rem 0.6rem !important;
    }

    .mention-option {
        flex-direction: column;
    }

    .mention-option .btn-new {
        width: 100%;
    }
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3f;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #949ba4;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #ff6788;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(255, 103, 136, 0.25);
}

/* ==================== PILL TOGGLE BUTTONS ==================== */
.pill-toggle-group {
    display: flex;
    background: #1a1a1e;
    border-radius: 6px;
    padding: 4px;
    gap: 4px;
}

.pill-toggle-btn {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #949ba4;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pill-toggle-btn:hover {
    background: #242429;
    color: #dbdee1;
}

.pill-toggle-btn.active {
    background: #ff6788;
    color: #fff;
}
