/* Admin shared styles. Sits on top of /shared/ps.css. */

.adm-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.adm-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.adm-actions-bar h2 {
    font-family: 'Barlow', sans-serif;
    font-size: 1.5rem;
    color: var(--ps-dark);
    margin-right: auto;
}

.adm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--ps-dark);
    color: white;
    border: 0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.adm-btn:hover:not(:disabled) {
    background: var(--ps-dark-deep);
    text-decoration: none;
    color: white;
}
.adm-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.adm-btn svg {
    width: 14px; height: 14px;
    fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.adm-btn-secondary {
    background: white;
    color: var(--ps-text);
    border: 1px solid var(--ps-border);
}
.adm-btn-secondary:hover:not(:disabled) {
    background: white;
    color: var(--ps-dark);
    border-color: var(--ps-dark);
}

.adm-btn-danger {
    background: white;
    color: var(--ps-accent);
    border: 1px solid var(--ps-border);
}
.adm-btn-danger:hover:not(:disabled) {
    background: var(--ps-accent);
    color: white;
    border-color: var(--ps-accent);
}

.adm-btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.adm-card {
    background: white;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(29, 58, 68, 0.06);
    border-left: 4px solid var(--ps-green-light);
    margin-bottom: 16px;
}

.adm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.adm-list-row {
    background: white;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(29, 58, 68, 0.06);
    border-left: 3px solid var(--ps-green-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-left-color 0.15s, box-shadow 0.15s;
}
.adm-list-row:hover {
    border-left-color: var(--ps-accent);
    box-shadow: 0 4px 12px rgba(29, 58, 68, 0.1);
}

.adm-list-thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ps-green-pale);
    border: 1px solid var(--ps-border);
    flex-shrink: 0;
}

.adm-list-info { flex: 1; min-width: 0; }
.adm-list-info h4 {
    font-family: 'Barlow', sans-serif;
    font-size: 1.05rem;
    color: var(--ps-dark);
    margin-bottom: 2px;
}
.adm-list-info p {
    font-size: 0.85rem;
    color: var(--ps-text-light);
}

.adm-list-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.adm-form { margin-bottom: 24px; }
.adm-form-section {
    background: white;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(29, 58, 68, 0.06);
    margin-bottom: 16px;
}
.adm-form-section h3 {
    font-family: 'Barlow', sans-serif;
    font-size: 1.05rem;
    color: var(--ps-dark);
    margin-bottom: 14px;
}
.adm-form-section h3 .adm-form-section-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--ps-text-light);
    margin-left: 8px;
}

.adm-field { margin-bottom: 16px; }
.adm-field-row { display: flex; gap: 16px; }
.adm-field-row .adm-field { flex: 1; }
.adm-field:last-child { margin-bottom: 0; }

.adm-label {
    display: block;
    font-family: 'Barlow', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--ps-text-light);
    margin-bottom: 6px;
}

.adm-input, .adm-select, .adm-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--ps-text);
    background: white;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s;
}
.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
    border-color: var(--ps-dark);
}
.adm-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

.adm-help {
    font-size: 0.8rem;
    color: var(--ps-text-light);
    margin-top: 6px;
}
.adm-help-error { color: var(--ps-accent); }

/* Photo upload widget */
.adm-photo-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.adm-photo-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--ps-green-pale);
    border: 1px solid var(--ps-border);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.adm-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.adm-photo-empty {
    font-family: 'Barlow', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ps-muted);
}
.adm-photo-controls { flex: 1; }
.adm-photo-controls input[type="file"] {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--ps-text-light);
    margin-bottom: 8px;
}

/* Step editor inside track edit */
.adm-step {
    background: var(--ps-offwhite);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--ps-border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    transition: opacity 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.adm-step[draggable="true"] { cursor: grab; }
.adm-step[draggable="true"]:active { cursor: grabbing; }

.adm-step.is-dragging {
    opacity: 0.4;
    border-color: var(--ps-accent);
}

/* Drop indicator: a thin accent bar above or below the step the cursor
   is over, depending on which half of the card is hovered. */
.adm-step.is-drop-above::before,
.adm-step.is-drop-below::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ps-accent);
    border-radius: 2px;
    pointer-events: none;
}
.adm-step.is-drop-above::before { top: -7px; }
.adm-step.is-drop-below::after { bottom: -7px; }

.adm-step-grip {
    color: var(--ps-muted);
    margin-top: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 24px;
    cursor: grab;
}
.adm-step-grip svg {
    width: 16px;
    height: 16px;
}
.adm-step:hover .adm-step-grip { color: var(--ps-text-light); }
.adm-step-num {
    width: 26px;
    height: 26px;
    background: var(--ps-dark);
    color: var(--ps-green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    flex-shrink: 0;
    margin-top: 4px;
}
.adm-step-body { flex: 1; min-width: 0; }
.adm-step-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.adm-step-icon-btn {
    width: 28px;
    height: 28px;
    background: white;
    border: 1px solid var(--ps-border);
    border-radius: 6px;
    color: var(--ps-text-light);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.adm-step-icon-btn:hover {
    border-color: var(--ps-dark);
    color: var(--ps-dark);
}
.adm-step-icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.adm-step-icon-btn svg {
    width: 14px; height: 14px;
    fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.adm-step-type-tag {
    display: inline-block;
    font-family: 'Barlow', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.adm-step-type-slide { background: rgba(180, 224, 216, 0.4); color: var(--ps-dark); }
.adm-step-type-video { background: rgba(214, 62, 40, 0.12); color: var(--ps-accent); }
.adm-step-type-qa { background: rgba(29, 58, 68, 0.08); color: var(--ps-text-light); }

/* Save panel — sticky bottom strip with "download" + path instructions */
.adm-save-panel {
    position: sticky;
    bottom: 0;
    margin-top: 32px;
    background: var(--ps-dark);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 -4px 16px rgba(29, 58, 68, 0.2);
}
.adm-save-panel-info { flex: 1; min-width: 0; }
.adm-save-panel-info strong {
    font-family: 'Barlow', sans-serif;
    font-size: 0.95rem;
    color: white;
    display: block;
    margin-bottom: 2px;
}
.adm-save-panel-info p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
}
.adm-save-panel-info code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 1px 7px;
    border-radius: 4px;
    color: var(--ps-green-light);
}
.adm-save-panel .adm-btn {
    background: var(--ps-accent);
    flex-shrink: 0;
}
.adm-save-panel .adm-btn:hover:not(:disabled) {
    background: white;
    color: var(--ps-accent);
}

/* Empty state */
.adm-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ps-text-light);
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(29, 58, 68, 0.06);
    margin-bottom: 24px;
}
.adm-empty p { font-size: 0.95rem; margin-bottom: 16px; }

/* Toast for ephemeral confirmation */
.adm-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ps-dark);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(29, 58, 68, 0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.adm-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 700px) {
    .adm-field-row { flex-direction: column; gap: 0; }
    .adm-save-panel { border-radius: 0; flex-direction: column; align-items: stretch; }
}
