/**
 * LESS Compiler – page styles
 * Mobile-first, unique layout (not shared with other converter tools)
 */

/* ----- LESS Compiler app (unique structure) ----- */
.less-compiler-app {
    margin-bottom: 2rem;
}

.less-app-card {
    background: var(--less-card-bg, #fff);
    border-radius: 16px;
    border: 1px solid var(--less-card-border, #e2e8f0);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Toolbar: mobile stack, then inline */
.less-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--less-toolbar-bg, #f8fafc);
    border-bottom: 1px solid var(--less-card-border, #e2e8f0);
}

.less-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.less-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.less-btn:active {
    transform: scale(0.98);
}

.less-btn-compile {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.3);
}

.less-btn-compile:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    box-shadow: 0 4px 8px rgba(13, 148, 136, 0.35);
}

.less-btn-secondary {
    background: var(--less-btn-bg, #fff);
    color: var(--less-btn-text, #475569);
    border: 1px solid var(--less-card-border, #e2e8f0);
}

.less-btn-secondary:hover {
    background: var(--less-btn-hover, #f1f5f9);
    border-color: #cbd5e1;
}

.less-btn-icon {
    font-size: 0.875rem;
}

@media (max-width: 479px) {
    .less-btn-label {
        display: none;
    }

    .less-btn {
        padding: 12px 14px;
    }

    .less-btn .less-btn-icon {
        margin: 0;
    }
}

.less-toolbar-status {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    min-height: 1.25em;
}

.less-toolbar-status.success {
    color: #0d9488;
}

.less-toolbar-status.error {
    color: #dc2626;
}

/* Panes: mobile stack first */
.less-panes {
    display: flex;
    flex-direction: column;
    gap: 0;
}

@media (min-width: 768px) {
    .less-panes {
        flex-direction: row;
        gap: 0;
    }
}

.less-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 280px;
}

@media (min-width: 768px) {
    .less-pane {
        min-height: 380px;
    }
}

.less-pane-input {
    border-bottom: 1px solid var(--less-card-border, #e2e8f0);
}

@media (min-width: 768px) {
    .less-pane-input {
        border-bottom: none;
        border-right: 1px solid var(--less-card-border, #e2e8f0);
    }
}

.less-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--less-pane-head-bg, #fff);
    border-bottom: 1px solid var(--less-card-border, #e2e8f0);
}

.less-pane-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border-radius: 6px;
}

.less-pane-badge-out {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.less-pane-count {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.less-editor-wrap {
    flex: 1;
    min-height: 360px;
    position: relative;
}

@media (min-width: 768px) {
    .less-editor-wrap {
        min-height: 420px;
    }
}

.less-editor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ACE editor overrides for this page */
.less-editor-wrap .ace_editor {
    border-radius: 0;
}

.less-editor-wrap .ace_scroller {
    border-radius: 0;
}

/* Related tools */
.less-related {
    margin-top: 2rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--less-card-border, #e2e8f0);
}

.less-related-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--less-btn-text, #475569);
    margin: 0 0 12px 0;
}

.less-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.less-related-list a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.875rem;
    color: #0d9488;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(13, 148, 136, 0.35);
    background: rgba(13, 148, 136, 0.06);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.less-related-list a:hover {
    background: rgba(13, 148, 136, 0.12);
    border-color: #0d9488;
    color: #0f766e;
}
