/* ================================================================
   SmartMap Pro — Frontend CSS v1.0.2
   Compatible with BootScore / Bootstrap 5
================================================================ */

.smp-fe {
    --smp-bg:      #0d0f14;
    --smp-surface: #141720;
    --smp-border:  #2a2f42;
    --smp-text:    #e8eaf0;
    --smp-muted:   #7b82a0;
    --smp-accent:  #6366f1;
    --smp-radius:  14px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 24px 0;
}

.smp-fe.smp-theme-light {
    --smp-bg:      #f3f4f8;
    --smp-surface: #ffffff;
    --smp-border:  #dde0ec;
    --smp-text:    #1a1d2e;
    --smp-muted:   #6b7194;
}

.smp-fe *, .smp-fe *::before, .smp-fe *::after {
    box-sizing: border-box;
}

/* ── Grid ───────────────────────────────────────────────── */
.smp-fe-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: 18px;
    align-items: start;
}
@media (max-width: 991px) { .smp-fe-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px)  { .smp-fe-grid { grid-template-columns: 1fr; } }

/* ── Card ───────────────────────────────────────────────── */
.smp-fe-card {
    background: var(--smp-surface);
    border: 1px solid var(--smp-border);
    border-radius: var(--smp-radius);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    height: 100%;
}
.smp-fe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0,0,0,.28);
}

/* Accent bar */
.smp-fe-accent-bar {
    height: 4px;
    background: var(--accent, var(--smp-accent));
}

/* ── Card header ────────────────────────────────────────── */
.smp-fe-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--smp-border);
    transition: background .12s;
}
.smp-fe-card-header:hover {
    background: rgba(255,255,255,.025);
}
.smp-fe-card-header:focus {
    outline: 2px solid var(--smp-accent);
    outline-offset: -2px;
}
.smp-fe-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.smp-fe-card-icon { font-size: 22px; flex-shrink: 0; }
.smp-fe-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--smp-text);
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smp-fe-card-title a {
    color: inherit;
    text-decoration: none;
}
.smp-fe-card-title a:hover {
    color: var(--accent, var(--smp-accent));
}
.smp-fe-chevron {
    font-size: 13px;
    color: var(--smp-muted);
    flex-shrink: 0;
    transition: transform .22s ease;
    margin-left: 8px;
}

/* Collapsed card */
.smp-fe-card.smp-fe-collapsed .smp-fe-chevron {
    transform: rotate(-90deg);
}
.smp-fe-card.smp-fe-collapsed .smp-fe-card-body {
    display: none;
}

/* ── Card body ──────────────────────────────────────────── */
.smp-fe-card-body {
    padding: 0;
}

/* ── Children list ──────────────────────────────────────── */
.smp-fe-children {
    list-style: none;
    margin: 0;
    padding: 10px 16px 6px;
}
.smp-fe-child {
    margin-bottom: 2px;
}

/* ── Child row ──────────────────────────────────────────── */
.smp-fe-child-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    transition: background .12s;
}
.smp-fe-child-row.smp-fe-child-toggle {
    cursor: pointer;
    user-select: none;
}
.smp-fe-child-row.smp-fe-child-toggle:hover {
    background: rgba(255,255,255,.04);
}
.smp-fe-child-row:focus {
    outline: 2px solid var(--smp-accent);
    outline-offset: -2px;
}
.smp-fe-child-icon { font-size: 15px; flex-shrink: 0; }
.smp-fe-child-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--smp-text);
    text-decoration: none;
}
a.smp-fe-child-name:hover {
    color: var(--accent, var(--smp-accent));
}
.smp-fe-child-chev {
    font-size: 11px;
    color: var(--smp-muted);
    flex-shrink: 0;
    transition: transform .2s ease;
}

/* Grandchildren shown state — chev points down */
.smp-fe-child-row[aria-expanded="true"] .smp-fe-child-chev {
    transform: rotate(90deg);
}

/* ── Grandchildren ──────────────────────────────────────── */
.smp-fe-grandchildren {
    list-style: none;
    margin: 0;
    padding: 4px 0 6px 34px;
    border-left: 2px solid var(--smp-border);
    margin-left: 18px;
    overflow: hidden;
    transition: max-height .25s ease, opacity .25s ease;
    max-height: 600px;
    opacity: 1;
}
/* Initially hidden */
.smp-fe-grandchildren.smp-fe-gc-hidden {
    max-height: 0;
    opacity: 0;
}
.smp-fe-gc-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 0;
    font-size: 13px;
    color: var(--smp-muted);
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.smp-fe-gc-item:last-child { border-bottom: none; }
.smp-fe-gc-icon { font-size: 13px; flex-shrink: 0; }
.smp-fe-gc-item a {
    color: var(--smp-muted);
    text-decoration: none;
}
.smp-fe-gc-item a:hover { color: var(--accent, var(--smp-accent)); }

/* ── Plugins bar ────────────────────────────────────────── */
.smp-fe-plugins {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 18px 14px;
    border-top: 1px solid var(--smp-border);
    margin-top: 4px;
}
.smp-fe-plugins-lbl {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--smp-muted);
    font-weight: 700;
    width: 100%;
    margin-bottom: 2px;
}
.smp-fe-plugin-tag {
    font-size: 11px;
    padding: 3px 10px;
    background: rgba(99,102,241,.1);
    border: 1px solid rgba(99,102,241,.25);
    color: #818cf8;
    border-radius: 20px;
    font-weight: 600;
}

/* ── Empty state ────────────────────────────────────────── */
.smp-fe-empty {
    color: var(--smp-muted);
    text-align: center;
    padding: 48px 20px;
    font-size: 15px;
}
.smp-fe-empty a { color: var(--smp-accent); }
