/* Admin Animations View (scoped) */

.admin-animations-view .admin-animations-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-animations-view .admin-animations-tree-panel,
.admin-animations-view .admin-animations-main-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 24px);
    background: var(--surface);
    box-shadow: var(--shadow-3);
}

.admin-animations-view .admin-animations-tree-panel {
    overflow: hidden;
}

.admin-animations-view .admin-animations-tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.admin-animations-view .admin-animations-tree-header h3 {
    margin: 0;
    font-size: 0.95rem;
}

.admin-animations-view .admin-animations-tree-list {
    padding: 10px;
    max-height: min(78vh, 880px);
    overflow: auto;
}

.admin-animations-view .admin-animations-tree-empty {
    padding: 14px;
    color: var(--text-muted);
    text-align: center;
}

.admin-animations-view .admin-animations-tree-group {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.admin-animations-view .admin-animations-tree-group h4 {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface, #fff) 90%, var(--surface-3, #eff2f7) 10%);
}

.admin-animations-view .admin-animations-tree-group-list {
    padding: 8px;
}

.admin-animations-view .admin-animations-tree-group-empty {
    color: var(--text-muted);
    padding: 8px;
}

.admin-animations-view .admin-animations-tree-node {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.admin-animations-view .admin-animations-tree-node-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #1d2733);
    min-height: 34px;
    padding: 6px 10px;
    text-align: left;
    cursor: pointer;
}

.admin-animations-view .admin-animations-tree-node.is-selected .admin-animations-tree-node-main {
    border-color: color-mix(in srgb, var(--accent, #4a7cff) 60%, #ffffff 40%);
    background: color-mix(in srgb, var(--accent, #4a7cff) 12%, var(--surface, #fff) 88%);
}

.admin-animations-view .admin-animations-tree-node-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 20px;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-contrast, #fff);
    background: color-mix(in srgb, var(--accent, #4a7cff) 72%, #1f2f53 28%);
}

.admin-animations-view .admin-animations-tree-node-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
}

.admin-animations-view .admin-animations-tree-node-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-animations-view .admin-animations-tree-node-add {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: color-mix(in srgb, var(--surface, #fff) 90%, var(--accent, #4a7cff) 10%);
    color: var(--text, #1d2733);
    font-weight: 700;
}

.admin-animations-view .admin-animations-main-panel {
    padding: 14px;
}

.admin-animations-view .admin-animations-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-animations-view .admin-animations-panel-switch,
.admin-animations-view .admin-animations-topbar-actions,
.admin-animations-view .admin-animations-tab-buttons,
.admin-animations-view .admin-animations-preview-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-animations-view .admin-animations-breadcrumb {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface, #fff) 85%, var(--surface-3, #edf1f6) 15%);
    font-size: 0.85rem;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-animations-view .admin-animations-breadcrumb-item small,
.admin-animations-view .admin-animations-breadcrumb-sep {
    color: var(--text-muted);
}

.admin-animations-view .admin-animations-editor-panel {
    margin-top: 12px;
}

.admin-animations-view .admin-animations-empty {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 34px 20px;
    text-align: center;
    color: var(--text-muted);
}

.admin-animations-view .admin-animations-editor {
    display: grid;
    gap: 14px;
}

.admin-animations-view .admin-animations-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface, #fff) 92%, var(--accent, #4a7cff) 8%);
}

.admin-animations-view .admin-animations-editor-head h3 {
    margin: 0 0 6px;
}

.admin-animations-view .admin-animations-level-badge {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: color-mix(in srgb, var(--accent, #4a7cff) 16%, var(--surface, #fff) 84%);
    color: var(--text, #1d2733);
}

.admin-animations-view .admin-animations-enabled-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.admin-animations-view .admin-animations-core-form,
.admin-animations-view .admin-animations-tabs,
.admin-animations-view .admin-animations-preview,
.admin-animations-view .admin-animations-history,
.admin-animations-view .admin-animations-subpanel {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.admin-animations-view .admin-animations-grid {
    display: grid;
    gap: 10px;
}

.admin-animations-view .admin-animations-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-animations-view .admin-animations-grid.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-animations-view .admin-animations-grid.four-col {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-animations-view .admin-animations-grid label,
.admin-animations-view .admin-animations-subpanel label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.admin-animations-view .admin-animations-grid label > span,
.admin-animations-view .admin-animations-subpanel label > span {
    color: var(--text, #1d2733);
    font-weight: 600;
}

.admin-animations-view .admin-animations-subpanel {
    margin-top: 12px;
}

.admin-animations-view .form-control,
.admin-animations-view input[type="text"],
.admin-animations-view input[type="number"],
.admin-animations-view select,
.admin-animations-view textarea {
    width: 100%;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-animations-view .form-control:hover,
.admin-animations-view input[type="text"]:hover,
.admin-animations-view input[type="number"]:hover,
.admin-animations-view select:hover,
.admin-animations-view textarea:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.admin-animations-view .form-control:focus,
.admin-animations-view input[type="text"]:focus,
.admin-animations-view input[type="number"]:focus,
.admin-animations-view select:focus,
.admin-animations-view textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
    background: var(--surface);
}

.admin-animations-view .admin-animations-prefs-grid label {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 14px 16px;
    box-shadow: var(--shadow-1);
}

.admin-animations-view .admin-animations-subpanel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-animations-view .admin-animations-subpanel-head h4 {
    margin: 0;
    font-size: 0.88rem;
}

.admin-animations-view .admin-animations-row-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.85fr 1fr 1fr 0.7fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.admin-animations-view .admin-animations-row-grid:last-child {
    margin-bottom: 0;
}

.admin-animations-view .admin-animations-empty-inline {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.admin-animations-view .admin-animations-save-row {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.admin-animations-view .admin-animations-inheritance h4 {
    margin: 0 0 8px;
    font-size: 0.86rem;
}

.admin-animations-view .admin-animations-inheritance-list {
    display: grid;
    gap: 6px;
}

.admin-animations-view .admin-animations-inheritance-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr) minmax(130px, 0.9fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
}

.admin-animations-view .admin-animations-inheritance-row .field-name {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-animations-view .admin-animations-inheritance-row .field-origin {
    text-align: right;
    font-size: 0.74rem;
}

.admin-animations-view .admin-animations-inheritance-row.is-explicit {
    background: color-mix(in srgb, var(--surface, #fff) 95%, var(--accent, #4a7cff) 5%);
}

.admin-animations-view .admin-animations-inheritance-row.is-explicit .field-origin {
    color: color-mix(in srgb, var(--text, #1d2733) 60%, transparent);
}

.admin-animations-view .admin-animations-inheritance-row.is-inherited {
    background: color-mix(in srgb, var(--surface, #fff) 92%, var(--surface-3, #edf1f6) 8%);
    color: color-mix(in srgb, var(--text, #1d2733) 70%, transparent);
}

.admin-animations-view .admin-animations-inheritance-row.is-inherited .field-origin {
    color: var(--text-muted);
}

.admin-animations-view .admin-animations-preview {
    isolation: isolate;
}

.admin-animations-view .admin-anim-preview-sandbox,
.admin-animations-view .admin-anim-pref-preview {
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: repeating-linear-gradient(
        -45deg,
        color-mix(in srgb, var(--surface, #fff) 94%, var(--surface-3, #edf1f6) 6%),
        color-mix(in srgb, var(--surface, #fff) 94%, var(--surface-3, #edf1f6) 6%) 12px,
        color-mix(in srgb, var(--surface, #fff) 98%, transparent 2%) 12px,
        color-mix(in srgb, var(--surface, #fff) 98%, transparent 2%) 24px
    );
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    contain: layout paint style;
    padding: 12px;
}

.admin-animations-view .admin-anim-preview-element,
.admin-animations-view .admin-anim-pref-preview-el {
    width: 92px;
    height: 92px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-contrast, #fff);
    background: linear-gradient(130deg, color-mix(in srgb, var(--accent, #4a7cff) 75%, #ffffff 25%), color-mix(in srgb, var(--accent, #4a7cff) 40%, #0e1f43 60%));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent, #4a7cff) 35%, transparent);
}

.admin-animations-view .admin-animations-history-toggle {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    background: color-mix(in srgb, var(--surface, #fff) 94%, var(--surface-3, #edf1f6) 6%);
    text-align: left;
    cursor: pointer;
    font-weight: 600;
}

.admin-animations-view .admin-animations-history-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.admin-animations-view .admin-animations-history-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.admin-animations-view .admin-animations-history-row span {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.admin-animations-view .admin-animations-prefs-panel {
    margin-top: 2px;
}

.admin-animations-view .admin-animations-prefs-grid {
    display: grid;
    gap: 12px;
}

.admin-animations-view .admin-animations-prefs-grid label {
    display: grid;
    gap: 8px;
    font-size: 0.84rem;
}

.admin-animations-view .admin-animations-prefs-grid input[type="range"] {
    width: 100%;
}

.admin-animations-view .admin-animations-prefs-buttons {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-animations-view .admin-animations-prefs-buttons > span {
    min-width: 124px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-animations-view .admin-animations-prefs-buttons .btn {
    min-width: 88px;
}

.admin-animations-view .admin-anim-pref-preview-wrap {
    margin-top: 14px;
}

@media (max-width: 1280px) {
    .admin-animations-view .admin-animations-layout {
        grid-template-columns: 1fr;
    }

    .admin-animations-view .admin-animations-grid.four-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-animations-view .admin-animations-row-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .admin-animations-view .admin-animations-grid.two-col,
    .admin-animations-view .admin-animations-grid.three-col,
    .admin-animations-view .admin-animations-grid.four-col,
    .admin-animations-view .admin-animations-inheritance-row {
        grid-template-columns: 1fr;
    }

    .admin-animations-view .admin-animations-inheritance-row .field-origin {
        text-align: left;
    }

    .admin-animations-view .admin-animations-prefs-buttons > span {
        width: 100%;
    }
}
