/* ── Live Preview (Discord UI) ── */
.lp-wrapper {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: 75vh;
    min-height: 600px;
}

/* Drawer Pane */
.lp-preview-drawer {
    display: flex;
    flex-direction: row;
    height: 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 450px;
    flex-shrink: 0;
    border-right: 1px solid var(--card-border, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.lp-preview-drawer.is-collapsed {
    width: 35px;
}

.lp-preview-content {
    flex: 1;
    width: 100%;
    max-width: 415px;
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    padding: 15px;
}

.lp-preview-content::-webkit-scrollbar {
    width: 6px;
}

.lp-preview-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.lp-preview-drawer.is-collapsed .lp-preview-content {
    opacity: 0;
    pointer-events: none;
    max-width: 0;
    padding: 0;
}

.lp-preview-toggle {
    width: 35px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 1px solid var(--card-border, rgba(255, 255, 255, 0.05));
    flex-shrink: 0;
    z-index: 10;
}

.lp-preview-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lp-preview-toggle span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted, #a0a0a0);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-preview-toggle span i {
    transform: rotate(90deg);
}

@media (max-width: 900px) {
    .lp-wrapper {
        flex-direction: column;
        height: auto;
    }

    .lp-preview-drawer {
        width: 100%;
        height: 500px;
        flex-direction: column;
    }

    .lp-preview-drawer.is-collapsed {
        height: 45px;
        width: 100%;
    }

    .lp-preview-toggle {
        width: 100%;
        height: 45px;
        border-left: none;
        border-top: 1px solid var(--card-border, rgba(255, 255, 255, 0.05));
    }

    .lp-preview-toggle span {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .lp-preview-toggle span i {
        transform: none;
    }

    .lp-preview-content {
        max-width: 100%;
        width: 100%;
    }
}


.lp-settings-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 80px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.lp-settings-pane::-webkit-scrollbar {
    width: 6px;
}

.lp-settings-pane::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.live-preview-container {
    background-color: #313338;
    border-radius: 8px;
    padding: 16px;
    font-family: "gg sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #dbdee1;
    border: 1px solid #1e1f22;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lp-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.lp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-image: url('/resources/images/icon.jpg');
    background-size: cover;
    margin-right: 12px;
}

.lp-bot-name {
    color: #f2f3f5;
    font-weight: 500;
    font-size: 1rem;
    margin-right: 6px;
}

.lp-bot-tag {
    background-color: #5865F2;
    color: white;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}

.lp-embed {
    background-color: #2b2d31;
    border-left: 4px solid var(--lp-color, #FF69B4);
    border-radius: 4px;
    padding: 12px 16px 16px 16px;
}

.lp-embed-desc {
    font-size: 0.875rem;
    line-height: 1.375rem;
    white-space: pre-wrap;
    margin-bottom: 12px;
}

/* Simulated Image Canvas */
.lp-card {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    background-color: #1a1a24;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.lp-card-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.lp-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.lp-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 6%;
}

.lp-card-avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background-color: #dbdee1;
    background-image: url('https://cdn.discordapp.com/embed/avatars/0.png');
    background-size: cover;
    box-shadow: 0 0 10px var(--lp-color, #FF69B4);
    border: 3px solid var(--lp-color, #FF69B4);
    flex-shrink: 0;
}

.lp-card-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lp-card-title {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.lp-card-name {
    color: var(--lp-name-color, #FFB6C1);
    font-weight: bold;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin: 4px 0;
}

.lp-card-sub {
    color: #ccc;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Layouts */
.lp-card[data-layout="left"] .lp-card-content {
    flex-direction: row;
}

.lp-card[data-layout="left"] .lp-card-text {
    margin-left: 15px;
    text-align: left;
    align-items: flex-start;
}

.lp-card[data-layout="right"] .lp-card-content {
    flex-direction: row-reverse;
}

.lp-card[data-layout="right"] .lp-card-text {
    margin-right: 15px;
    text-align: right;
    align-items: flex-end;
}

.lp-card[data-layout="center"] .lp-card-content {
    flex-direction: column;
    justify-content: center;
}

.lp-card[data-layout="center"] .lp-card-text {
    margin-top: 5px;
    text-align: center;
    align-items: center;
}

/* Redesigned specific settings cards */
.mod-section-card-compact {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
}

.mod-section-card-compact .mod-setting-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Fluid Grid */
.lyco-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

/* Field Group */
.form-group-section {
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 8px;
    margin-bottom: 20px;
}

/* Action Bar / Footer */
.settings-footer {
    padding: 16px 0 0 0;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
}

/* Inputs Standardization */
.mod-text-input,
select.mod-text-input {
    width: 100%;
    box-sizing: border-box;
}

.mod-text-input:focus,
select.mod-text-input:focus,
textarea.mod-text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 105, 180, 0.2);
    outline: none;
}

.lp-settings-pane label.mod-setting-label+input.mod-text-input,
.lp-settings-pane label.mod-setting-label+select.mod-text-input,
.lp-settings-pane label.mod-setting-label+textarea.mod-text-input,
.lp-settings-pane label.mod-setting-label+.lyco-color-picker,
.lp-settings-pane label.mod-setting-label+.lyco-input-with-counter,
.lp-settings-pane .mod-setting-desc+.lyco-input-with-counter,
.lp-settings-pane .mod-setting-desc+input.mod-text-input,
.lp-settings-pane .mod-setting-desc+select.mod-text-input,
.lp-settings-pane .mod-setting-desc+textarea.mod-text-input {
    margin-top: 8px;
}

/* Premium Color Picker */
input[type="color"].lyco-color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 42px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="color"].lyco-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"].lyco-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

input[type="color"].lyco-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="color"].lyco-color-picker:hover {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 105, 180, 0.3);
}

/* Segmented Control */
.lyco-segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lyco-segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #b9bbbe;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lyco-segment-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.lyco-segment-btn.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lyco-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.lyco-tab-content.active {
    display: block;
}

/* Accordion */
.lyco-accordion {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.lyco-accordion-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.lyco-accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.lyco-accordion-icon {
    font-size: 0.8rem;
    color: var(--muted);
    transition: transform 0.3s ease;
}

.lyco-accordion.is-open .lyco-accordion-icon {
    transform: rotate(180deg);
}

.lyco-accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.lyco-accordion.is-open .lyco-accordion-content {
    max-height: 1000px;
    padding: 0 20px 20px 20px;
}

/* Character Counters within Input Wrapper */
.lyco-input-with-counter {
    position: relative;
    width: 100%;
}

.lyco-input-with-counter .lyco-char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    margin: 0;
    float: none;
    background-color: var(--card-bg, #0c0e1a);
    /* Prevents text bleeding under it if input background is transparent */
    padding: 0 4px;
    border-radius: 4px;
}

.lyco-input-with-counter input.mod-text-input,
.lyco-input-with-counter textarea.mod-text-input {
    padding-right: 50px;
    /* Space for the counter */
}

.lyco-char-counter.limit-reached {
    color: var(--danger, #ff4646);
}

/* Full Embed Elements */
.lp-embed-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.lp-embed-author-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.lp-embed-author-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
}

.lp-embed-title {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 8px;
}

.lp-embed-thumbnail-wrapper {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.lp-embed-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lp-embed-footer {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 0.75rem;
    color: #b9bbbe;
}

.lp-embed-footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

/* ── UI Components Restored ── */

/* Tabs */
.lyco-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.05));
}

.lyco-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-muted, #a0a0a0);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lyco-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.lyco-tab.is-active {
    background: var(--primary, #5865F2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.lyco-tab-content {
    display: none;
    animation: lycoFadeIn 0.3s ease;
}

.lyco-tab-content.active {
    display: block;
}

@keyframes lycoFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Counters */
.lyco-input-with-counter {
    position: relative;
    display: flex;
    flex-direction: column;
}

.lyco-char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(2px);
    transition: color 0.2s;
}

.lyco-char-counter.limit-reached {
    color: #ff4646;
}

/* Form Grid */
.lyco-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .lyco-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Accordion */
.lyco-accordion {
    margin-top: 15px;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
}

.lyco-accordion-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color, #e0e0e0);
    user-select: none;
    transition: background 0.2s;
}

.lyco-accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lyco-acc-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--text-muted, #a0a0a0);
}

.lyco-accordion.is-open .lyco-acc-icon {
    transform: rotate(90deg);
}

.lyco-accordion-body {
    display: none;
    padding: 0 15px 15px 15px;
    border-top: 1px solid var(--card-border, rgba(255, 255, 255, 0.05));
    margin-top: 5px;
    padding-top: 15px;
}

.lyco-accordion.is-open .lyco-accordion-body {
    display: block;
    animation: lycoFadeIn 0.3s ease;
}

/* Color Picker Customization */
.lyco-color-picker {
    padding: 2px !important;
    height: 38px !important;
    cursor: pointer;
}

.lyco-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

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

/* Variables List Styles */
.lyco-vars-list {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lyco-vars-title {
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-normal, #e0e0e0);
    font-size: 0.85rem;
}

.lyco-vars-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted, #a0a0a0);
}

.lyco-vars-list li {
    display: flex;
    align-items: center;
}

.lyco-vars-list code {
    display: inline-block;
    width: 110px;
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
    color: var(--text-normal, #e0e0e0);
    font-family: monospace;
}