/* scripts.html page styles */

.scripts-page {
    padding: 140px 20px 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
    width: 100%;
    gap: 22px;
}

.scripts-hero {
    width: 100%;
    max-width: 860px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #090909;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
}

.scripts-hero-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.scripts-hero .section-title {
    margin-bottom: 0;
    font-size: 3.1rem;
    line-height: 1.05;
    text-align: center;
    font-family: var(--ui-font), sans-serif;
    font-weight: 500;
    color: #fff;
}

.scripts-subtitle {
    color: #d6d6d6;
    font-size: 1rem;
    max-width: 480px;
    text-align: center;
    line-height: 1;
    font-weight: 400;
}

.scripts-sync-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 28px;
    color: #8f949d;
    font-size: 0.78rem;
    line-height: 1;
}

.scripts-sync-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #101010;
    color: #e5e7eb;
    font-weight: 600;
}

.scripts-sync-pill.is-live {
    border-color: rgba(34, 197, 94, 0.32);
    color: #bbf7d0;
}

.scripts-sync-pill.is-checking {
    border-color: rgba(96, 165, 250, 0.32);
    color: #bfdbfe;
}

.scripts-sync-pill.is-error {
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecaca;
}

.scripts-sync-pill.is-demo {
    border-color: rgba(234, 179, 8, 0.34);
    color: #fde68a;
}

.scripts-sync-meta {
    color: #9ca3af;
}

.scripts-demo-toggle {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 10, 10, 0.92);
    color: #f3f4f6;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

.scripts-demo-toggle.is-active {
    border-color: rgba(59, 130, 246, 0.28);
    color: #dbeafe;
    background: rgba(18, 32, 56, 0.94);
}

.scripts-demo-toggle-floating {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 950;
}

.scripts-container {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scripts-empty-state {
    padding: 28px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 1);
    background: #090909;
    color: #8a8f98;
    text-align: center;
}

.scripts-error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scripts-retry-btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #161616;
    color: #f4f4f5;
    font: inherit;
    cursor: pointer;
}

.scripts-retry-btn:hover {
    border-color: rgba(255, 255, 255, 0.36);
    background: #1f1f1f;
}

.tone-gray {
    --script-tone-bg: rgb(8, 8, 8);
    --script-tone-border: rgb(24, 24, 24);
    --script-tone-text: #ffffff;
}

.tone-green {
    --script-tone-bg: #22c55e;
    --script-tone-border: rgba(34, 197, 94, 0.16);
    --script-tone-text: #ffffff;
}

.tone-yellow {
    --script-tone-bg: rgba(255, 183, 0, 0.9);
    --script-tone-border: rgba(255, 183, 0, 0.18);
    --script-tone-text: #ffffff;
}

.tone-red {
    --script-tone-bg: rgb(255, 61, 61);
    --script-tone-border: rgba(248, 113, 113, 0.18);
    --script-tone-text: #fee2e2;
}

.tone-purple {
    --script-tone-bg: rgba(176, 102, 255, 0.9);
    --script-tone-border: rgba(192, 132, 252, 0.18);
    --script-tone-text: #f3e8ff;
}

.tone-blue {
    --script-tone-bg: rgba(21, 103, 255, 0.9);
    --script-tone-border: rgba(96, 165, 250, 0.16);
    --script-tone-text: #ffffff;
}

.script-row {
    --script-accent: #5a5a5a;
    --script-accent-soft: rgba(90, 90, 90, 0.72);
    display: flex;
    flex-direction: column;
    min-height: 80px;
    border-radius: 9px;
    background: #070707;
    border: 1px solid rgba(255, 255, 255, 0.07);
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
    transition: border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease !important;
}

.script-row:hover {
    transform: none !important;
    background: #070707;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.status-gray { --script-accent: #4a4a4a; --script-accent-soft: rgba(74, 74, 74, 0.76); }
.status-yellow { --script-accent: #eab308; --script-accent-soft: rgba(234, 179, 8, 0.74); }
.status-red { --script-accent: #ff5757; --script-accent-soft: rgba(255, 87, 87, 0.74); }
.status-green { --script-accent: #22c55e; --script-accent-soft: rgba(34, 197, 94, 0.74); }
.status-purple { --script-accent: #b066ff; --script-accent-soft: rgba(176, 102, 255, 0.74); }
.status-blue { --script-accent: #3b82f6; --script-accent-soft: rgba(59, 130, 246, 0.74); }

.script-row-main {
    display: grid;
    grid-template-columns: minmax(0, 270px) minmax(280px, 1fr) 178px;
    align-items: center;
    height: 80px;
    min-height: 80px;
    padding: 0 18px 0 24px;
    gap: 20px;
    cursor: pointer;
    outline: none;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.script-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    border-radius: 9px 0 0 9px;
    background: linear-gradient(180deg, var(--script-accent) 0%, var(--script-accent-soft) 100%);
}
.script-row-main:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.script-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.script-header {
    display: grid;
    align-items: start;
    gap: 9px;
    margin-bottom: 0;
    justify-items: start;
}

.script-header h3 {
    font-size: 1.1rem;
    line-height: 1.1;
    font-weight: 400;
    margin: 0;
    color: #fff;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    font-size: 0.66rem;
    line-height: 1;
    text-transform: uppercase;
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e2e2;
    padding: 0 10px;
    border-radius: 7px;
    font-weight: 500;
}
/*
.version-tag::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ccc;
}
*/
.script-detail-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-tag {
    min-height: 24px;
    font-size: 1rem;
    line-height: 1;
    padding: 0 10px;
    border-radius: 7px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0e0e0e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #888;
}

.meta-tag i {
    font-size: 1rem;
}

.tag-gray { color: #c0c3c8; border-color: rgba(148, 163, 184, 0.22); }
.tag-green { color: #9fe3b6; border-color: rgba(74, 222, 128, 0.32); }
.tag-yellow { color: #f1d889; border-color: rgba(245, 194, 65, 0.32); }
.tag-red { color: #f0b4b4; border-color: rgba(248, 113, 113, 0.32); }
.tag-purple { color: #ddc1ff; border-color: rgba(176, 102, 255, 0.32); }
.tag-blue { color: #b8d5ff; border-color: rgba(96, 165, 250, 0.28); }

.script-code-box {
    width: 100%;
    min-width: 200px;
    min-height: 46px;
    gap: 10px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0a0a0a;
    color: #ddd;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    user-select: none;
    text-align: left;
}

.script-code-box-preview {
    width: 100%;
    justify-self: stretch;
}

.script-code-box-full {
    width: 100%;
    max-width: none;
}

.script-code-box .code-text {
    display: block;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.script-code-box i {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a1a7b0;
    font-size: 1rem;
}

.script-code-box-full .code-text {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    text-overflow: clip;
}

.script-code-box.clickable {
    cursor: pointer;
    border-color: rgba(255, 255, 255, 0.1);
}

.script-code-box.clickable:hover {
    transform: none !important;
    border-color: rgba(255, 255, 255, 0.2);
    background: #0a0a0a;
    color: #ddd;
}

.script-code-box.clickable:active {
    transform: none !important;
}

.script-code-box.disabled {
    cursor: default;
    color: #8b9098;
}

.script-status-wrap {
    min-width: 0;
    width: 178px;
    display: grid;
    grid-template-columns: minmax(136px, 1fr) 34px;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    justify-self: end;
}

.script-status {
    min-width: 0;
    width: 100%;
    text-align: right;
}

.status-badge-right {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 1rem;
    line-height: 1;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: none;
}

.script-status-wrap .status-badge-right {
    width: 100%;
    min-width: 136px;
}

.script-detail-pills .status-badge-right {
    width: auto;
    min-width: 0;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 0.9rem;
}

.badge-gray { background: #2d2d2d; color: #c1c1c1; border-color: rgba(255, 255, 255, 0.05); }
.badge-yellow { background: #f5c241; color: #151515; border-color: rgba(245, 194, 65, 0.25); }
.badge-red { background: #ef4444; color: #fff; border-color: rgba(239, 68, 68, 0.2); }
.badge-green { background: #22c55e; color: #fff; border-color: rgba(34, 197, 94, 0.2); }
.badge-purple { background: #a855f7; color: #fff; border-color: rgba(168, 85, 247, 0.22); }
.badge-blue { background: #3b82f6; color: #fff; border-color: rgba(59, 130, 246, 0.2); }

.script-row-dropdown {
    height: 0;
    opacity: 0;
    overflow: hidden;
    will-change: height;
    transition:
        height 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) !important,
        opacity 0.22s ease !important;
}

.script-row:not(.is-expanded) .script-row-dropdown {
    height: 0 !important;
    opacity: 0;
}

.script-row.is-expanded .script-row-dropdown {
    opacity: 1;
}

.script-row-dropdown-inner {
    padding: 0 20px 0 30px;
    overflow: hidden;
}

.script-dropdown-body {
    display: grid;
    gap: 6px;
    padding-top: 0;
    padding-bottom: 0;
    border-top: 1px solid transparent;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.22s ease !important,
        transform 0.28s ease !important,
        padding-top 0.28s ease !important,
        padding-bottom 0.28s ease !important,
        border-color 0.28s ease !important;
}

.script-row.is-expanded .script-dropdown-body {
    padding-top: 10px;
    padding-bottom: 10px;
    border-top-color: rgba(255, 255, 255, 0.08);
    opacity: 1;
    transform: translateY(0);
}

.script-dropdown-section {
    display: grid;
    gap: 5px;
}

.script-dropdown-title {
    font-size: 0.7rem;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
}

.script-executor-groups {
    display: grid;
    gap: 5px;
}

.script-executor-group {
    display: grid;
    gap: 4px;
}

.script-executor-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.script-executor-group-title {
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 400;
    color: var(--script-tone-text, #eceff4);
}

.script-mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 7px;
    border: 1px solid var(--script-tone-border, rgba(255, 255, 255, 0.12));
    background: var(--script-tone-bg, rgba(255, 255, 255, 0.05));
    color: var(--script-tone-text, #e5e7eb);
    font-size: 0.9rem;
    line-height: 1;
    font-weight: 500;
}

.script-executor-chips,
.script-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.script-executor-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 7px;
    border: 1px solid var(--script-tone-border, rgba(255, 255, 255, 0.12));
    background: var(--script-tone-bg, rgba(255, 255, 255, 0.04));
    color: var(--script-tone-text, #eceff4);
    font-size: 0.9rem;
    line-height: 1;
    font-weight: 500;
}

.script-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--script-tone-border, rgba(255, 255, 255, 0.12));
    background: var(--script-tone-bg, rgba(255, 255, 255, 0.04));
    color: var(--script-tone-text, #eceef2);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1;
    font-weight: 500;
}

.script-action-link i {
    font-size: 1rem;
}

.script-detail-count-pill {
    color: #d3d7dd;
}

.script-row-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f5f5f5;
    cursor: pointer;
    flex: 0 0 auto;
}

.script-row-toggle i {
    font-size: 0.78rem;
    transition: transform 0.18s ease;
}

.script-row.is-expanded .script-row-toggle i {
    transform: rotate(180deg);
}

.script-row-toggle:hover,
.script-row-toggle:focus-visible {
    border-color: rgba(255, 255, 255, 0.32);
    outline: none;
}

@media (max-width: 980px) {
    .script-row-main {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        height: auto;
        min-height: 94px;
        gap: 12px;
        padding: 14px 16px 14px 20px;
        overflow: visible;
    }

    .script-header {
        gap: 8px;
    }

    .script-code-box {
        width: 100%;
        max-width: none;
    }

    .script-status-wrap {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
        grid-template-columns: minmax(136px, max-content) 34px;
    }
}

@media (max-width: 768px) {
    .scripts-hero {
        padding: 14px;
    }

    .script-row-main,
    .script-row-dropdown-inner {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 560px) {
    .scripts-demo-toggle-floating {
        bottom: 14px;
        min-width: calc(100vw - 32px);
    }

    .script-status-wrap {
        width: 100%;
        align-items: center;
    }

    .script-action-link {
        width: 100%;
        justify-content: center;
    }
}
