/* ============================================
   NEET HUB — Shared Admin Panel Styles
   ============================================
   Persistent admin panel available on all pages.
   Only visible to users with role === 'admin'.
*/

/* ---- FLOATING ADMIN BUTTON ---- */
.admin-fab {
    display: none; /* shown via JS for admins */
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    background: var(--bg-secondary);
    color: var(--neon-cyan);
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.25), inset 0 0 12px rgba(0, 245, 255, 0.05);
    transition: all 0.25s ease;
    line-height: 1;
}

.admin-fab:hover {
    background: rgba(0, 245, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.4);
    transform: scale(1.08);
}

.admin-fab.has-new {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
    animation: admin-fab-pulse 2s ease-in-out infinite;
}

@keyframes admin-fab-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(57, 255, 20, 0.2); }
    50% { box-shadow: 0 0 30px rgba(57, 255, 20, 0.5); }
}

.admin-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--neon-green);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}

/* ---- OVERLAY ---- */
.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* ---- PANEL ---- */
.admin-panel-shared {
    width: 90vw;
    max-width: 820px;
    height: 85vh;
    max-height: 700px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(0, 245, 255, 0.15),
        0 25px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
}

.admin-overlay.open .admin-panel-shared {
    transform: scale(1) translateY(0);
}

/* ---- HEADER ---- */
.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glow);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    flex-shrink: 0;
}

.admin-panel-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-panel-title-icon {
    font-size: 1.1rem;
}

.admin-panel-close {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.admin-panel-close:hover {
    color: var(--neon-cyan);
    border-color: var(--border-glow);
    background: rgba(0, 245, 255, 0.05);
}

/* ---- TABS ---- */
.admin-panel-tabs {
    display: flex;
    gap: 2px;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-glow);
    background: var(--bg-primary);
    flex-shrink: 0;
    overflow-x: auto;
}

.admin-panel-tab {
    padding: 0.5rem 0.9rem;
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: var(--font-mono);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.admin-panel-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.admin-panel-tab.active {
    background: rgba(0, 245, 255, 0.08);
    border-color: rgba(0, 245, 255, 0.3);
    color: var(--neon-cyan);
}

.admin-panel-tab .tab-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 5px;
    border-radius: 8px;
    background: var(--neon-green);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    vertical-align: middle;
}

/* ---- CONTENT ---- */
.admin-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.admin-section-shared {
    display: none;
}

.admin-section-shared.active {
    display: block;
}

/* ---- STAT GRID ---- */
.ap-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ap-stat-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.ap-stat-val {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--neon-cyan);
    margin-bottom: 0.25rem;
}

.ap-stat-key {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

/* ---- SEARCH BAR ---- */
.ap-search {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.ap-search:focus {
    border-color: var(--border-glow);
}

.ap-search::placeholder {
    color: var(--text-muted);
}

/* ---- USER ROW ---- */
.ap-user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-radius: 6px;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ap-user-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ap-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ap-user-dot.online { background: var(--neon-green); box-shadow: 0 0 6px rgba(57, 255, 20, 0.5); }
.ap-user-dot.offline { background: var(--text-muted); opacity: 0.4; }

.ap-user-info {
    flex: 1;
    min-width: 0;
}

.ap-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ap-user-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.ap-role-badge {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ap-role-badge.admin { background: rgba(0, 245, 255, 0.15); color: var(--neon-cyan); }
.ap-role-badge.mod { background: rgba(184, 41, 227, 0.15); color: var(--neon-purple); }
.ap-role-badge.member { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.ap-role-badge.banned { background: rgba(255, 59, 59, 0.15); color: #ff3b3b; }

.ap-user-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.ap-btn {
    padding: 0.35rem 0.65rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ap-btn:hover { background: rgba(0,245,255,0.1); border-color: var(--border-glow); color: var(--neon-cyan); }
.ap-btn.danger { color: #ff6b6b; }
.ap-btn.danger:hover { background: rgba(255,59,59,0.1); border-color: rgba(255,59,59,0.3); color: #ff3b3b; }
.ap-btn.success { color: var(--neon-green); }
.ap-btn.success:hover { background: rgba(57,255,20,0.1); border-color: rgba(57,255,20,0.3); }
.ap-btn.primary { background: rgba(0,245,255,0.1); border-color: rgba(0,245,255,0.3); color: var(--neon-cyan); }

/* ---- ROLE DROPDOWN ---- */
.ap-role-select {
    padding: 0.3rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    cursor: pointer;
    outline: none;
}

.ap-role-select:focus { border-color: var(--border-glow); }
.ap-role-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* ---- SUGGESTION FILTERS ---- */
.ap-sug-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ap-sug-filter {
    padding: 0.4rem 0.7rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    border-radius: 4px;
    transition: all 0.2s;
}

.ap-sug-filter:hover { color: var(--text-secondary); background: rgba(255,255,255,0.06); }
.ap-sug-filter.active { background: rgba(0,245,255,0.1); border-color: rgba(0,245,255,0.3); color: var(--neon-cyan); }

/* ---- SUGGESTION CARD ---- */
.ap-sug-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem;
    margin-bottom: 0.6rem;
    transition: border-color 0.2s;
}

.ap-sug-card:hover { border-color: rgba(255,255,255,0.08); }

.ap-sug-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.ap-sug-user {
    font-weight: 600;
    font-size: 0.82rem;
}

.ap-sug-status {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 700;
}

.ap-sug-status.new { background: rgba(57,255,20,0.15); color: var(--neon-green); }
.ap-sug-status.done { background: rgba(0,245,255,0.15); color: var(--neon-cyan); }
.ap-sug-status.archived { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.ap-sug-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.ap-sug-cat {
    display: inline-block;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.ap-sug-text {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.6rem;
    word-break: break-word;
}

.ap-sug-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ---- SECTION HEADER ---- */
.ap-section-header {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ---- EMPTY STATE ---- */
.ap-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.ap-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

/* ---- TOAST ---- */
.ap-toast {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    z-index: 10001;
    padding: 0.7rem 1.2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    color: var(--neon-cyan);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.ap-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---- RECENT ACTIVITY ---- */
.ap-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.8rem;
}

.ap-activity-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.ap-activity-text {
    color: var(--text-secondary);
    flex: 1;
}

.ap-activity-text strong {
    color: var(--text-primary);
}

.ap-activity-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .admin-panel-shared {
        width: 96vw;
        height: 92vh;
        max-height: none;
        border-radius: 8px;
    }

    .admin-panel-tabs {
        gap: 1px;
        padding: 0.5rem 0.5rem;
    }

    .admin-panel-tab {
        font-size: 0.65rem;
        padding: 0.4rem 0.6rem;
    }

    .ap-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ap-user-row {
        flex-wrap: wrap;
    }

    .ap-user-actions {
        width: 100%;
        margin-top: 0.4rem;
    }

    .admin-fab {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}
