/* ================================================================
   admin.css — Admin dashboard styles
   Extends main.css with admin-specific components
   ================================================================ */

/* ── Admin layout ─────────────────────────────────────────────── */
[data-bs-theme="dark"] {
    --bs-body-bg: #0d0d0d;
    --bs-body-color: #f0f0f0;
}
[data-bs-theme="dark"] body {
    background-color: #0d0d0d;
    color: #f0f0f0;
}

.navbar.bg-dark {
    background-color: #111111 !important;
    border-color: #222222 !important;
}

/* ── Cards ────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .card {
    background-color: #1a1a1a;
    border-color: #2a2a2a;
}

[data-bs-theme="dark"] .card-header {
    background-color: #222222;
    border-color: #2a2a2a;
}

/* ── Sidebar-style nav active state ──────────────────────────── */
.nav-link.active {
    color: #fff !important;
    background-color: rgba(79,142,247,0.15);
    border-radius: 6px;
}

/* ── Rich text editor ─────────────────────────────────────────── */
.rich-editor {
    min-height: 100px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    outline: none;
    cursor: text;
    line-height: 1.55;
}
.rich-editor:empty:before {
    content: attr(placeholder);
    color: #666;
    pointer-events: none;
}
.rich-editor:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}

/* ── Step list ────────────────────────────────────────────────── */
.step-item {
    transition: background-color 0.15s;
    cursor: default;
    user-select: none;
}

.step-item:hover {
    background-color: rgba(255,255,255,0.04) !important;
}

[data-bs-theme="dark"] .step-item {
    background-color: #1a1a1a;
    border-color: #2a2a2a;
    color: #f0f0f0;
}

.drag-handle {
    font-size: 1.2rem;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.drag-handle:hover { opacity: 1; }

/* ── Step insert (between-steps "+" button) ────────────────── */
.step-insert-row {
    position: relative;
    height: 0;
    margin: 0;
    pointer-events: none;
}
.step-insert-btn {
    position: absolute;
    left: 0.75rem;
    top: 0;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    line-height: 1;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    z-index: 3;
    transition: opacity 0.15s, transform 0.15s;
}
.step-insert-btn > i {
    line-height: 1;
}
#stepList:hover .step-insert-btn {
    opacity: 0.55;
}
.step-insert-btn:hover {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.2);
}

.ui-sortable-placeholder {
    background-color: rgba(79, 142, 247, 0.08) !important;
    border: 2px dashed rgba(79, 142, 247, 0.4) !important;
    visibility: visible !important;
}

.step-type-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 60px;
    text-align: center;
}

/* ── Tables ───────────────────────────────────────────────────── */
[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.04);
}

[data-bs-theme="dark"] .table thead th {
    color: #888;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom-color: #333;
}

/* ── Forms ────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #222;
    border-color: #333;
    color: #f0f0f0;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #2a2a2a;
    border-color: #4f8ef7;
    color: #f0f0f0;
    box-shadow: 0 0 0 3px rgba(79,142,247,0.2);
}
[data-bs-theme="dark"] .form-control::placeholder { color: #555; }

/* ── Modals ───────────────────────────────────────────────────── */
[data-bs-theme="dark"] .modal-content {
    background-color: #1a1a1a;
    border-color: #2a2a2a;
}

[data-bs-theme="dark"] .modal-header {
    border-color: #2a2a2a;
}

[data-bs-theme="dark"] .modal-footer {
    border-color: #2a2a2a;
}

/* ── Admin login page ─────────────────────────────────────────── */
.min-vh-100.bg-body {
    background-color: #0d0d0d !important;
}

/* ── Event log ────────────────────────────────────────────────── */
#eventLog {
    background-color: #111;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

#eventLog > div {
    border-color: #222 !important;
}

#eventLog > div:hover {
    background-color: rgba(255,255,255,0.03);
}

/* ── Btn-xs (extra small buttons) ────────────────────────────── */
.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* ── Sticky sidebar ───────────────────────────────────────────── */
.sticky-top {
    top: 1rem;
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
[data-bs-theme="dark"] .breadcrumb-item a {
    color: #4f8ef7;
}
[data-bs-theme="dark"] .breadcrumb-item.active {
    color: #888;
}
[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #555;
}

/* ── Hint rows ────────────────────────────────────────────────── */
.hint-row textarea {
    resize: vertical;
    min-height: 58px;
}

/* ── Status indicators ────────────────────────────────────────── */
.table-success td {
    background-color: rgba(34, 197, 94, 0.1) !important;
    transition: background-color 1.5s ease;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 576px) {
    .container-fluid { padding: 0 0.75rem; }
    .card-body { padding: 0.75rem; }
}

/* ── Session detail modal ─────────────────────────────────────── */
.admin-detail-body {
    height: 72vh;
    overflow: hidden;
}

/* bubble-container (from game.css) is used directly for the feed */

.admin-send-bar {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 0.65rem 1rem;
    border-top: 1px solid #2a2a2a;
    background: #1a1a1a;
}
.admin-send-bar textarea { flex: 1; resize: none; }

/* ── Admin-only bubble variants ───────────────────────────────── */

/* Small type/title label at the top of step bubbles */
.bubble-admin-step-meta {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.55;
    margin-bottom: 0.3rem;
}

/* Hint bubble (no frontend equivalent) */
.bubble-hint-admin {
    background: rgba(250, 204, 21, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(250, 204, 21, 0.25);
    border-bottom-left-radius: 0.3rem;
}

/* ── Sortable table headers ───────────────────────────────────── */
.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable:hover { color: #f0f0f0; }
.sort-icon { opacity: 0.25; font-size: 0.9em; transition: transform 0.15s; }
.sort-icon.sort-active { opacity: 1; color: #4f8ef7; }
.sort-icon.sort-active.sort-asc { transform: rotate(180deg); }
