/**
 * Developed by: GrounnyDev.com
 * SubUnlock custom styles (use npm run build for compiled Tailwind)
 */

[x-cloak] {
    display: none !important;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.15);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html.dark .lang-switcher {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
}

.lang-switcher-globe {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-left: 0.15rem;
    border-radius: 9999px;
    color: #2563eb;
    font-size: 0.75rem;
}

html.dark .lang-switcher-globe {
    color: #93c5fd;
}

.lang-switcher-track {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.85);
}

html.dark .lang-switcher-track {
    background: rgba(30, 41, 59, 0.9);
}

.lang-switcher-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.35rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #64748b;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.lang-switcher-option:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

.lang-switcher-option.is-active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

html.dark .lang-switcher-option {
    color: #94a3b8;
}

html.dark .lang-switcher-option:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}

.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: #78350f;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.impersonation-banner-text {
    font-size: 0.8125rem;
    font-weight: 600;
}

.impersonation-banner-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: #78350f;
    color: #fff;
}

.impersonation-banner-btn:hover {
    opacity: 0.9;
}

html.impersonating-active #sidebar {
    top: 2.5rem;
    height: calc(100vh - 2.5rem);
}

html.impersonating-active #admin-main {
    padding-top: 2.5rem;
}

html.impersonating-active #sidebar-backdrop {
    top: 2.5rem;
}

.unlock-btn-primary {
    background-color: var(--primary, #2563EB);
}
.unlock-btn-primary:hover {
    background-color: #1D4ED8;
}

.link-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.link-status-btn:hover {
    transform: scale(1.04);
}

.link-status-btn::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.link-status-on {
    background: #dcfce7;
    color: #15803d;
}

.dark .link-status-on {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.link-status-warn {
    background: #fef9c3;
    color: #a16207;
}

.dark .link-status-warn {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.link-status-off {
    background: #fee2e2;
    color: #b91c1c;
}

.dark .link-status-off {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.link-status-locked {
    background: #ffedd5;
    color: #c2410c;
}

.link-status-locked::before {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: 0.65rem;
}

.dark .link-status-locked {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

/**
 * Developed by: GrounnyDev.com
 */
.dashboard-chart-wrap {
    min-height: 14rem;
}

.dashboard-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#sidebar {
    transition: transform 0.2s ease;
}

#admin-main {
    transition: padding-left 0.2s ease;
}

#sidebar-backdrop {
    transition: opacity 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.75rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-close-btn:hover,
.sidebar-close-btn:focus-visible {
    background: rgba(255, 255, 255, 0.18);
}

body.sidebar-mobile-open #sidebar-toggle-header {
    position: relative;
    z-index: 60;
}

.publicad-toggle-wrap {
    position: relative;
}

.publicad-toggle-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    z-index: 40;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #0891b2, #2563eb);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.publicad-toggle-bubble.is-visible {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.publicad-toggle-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #2563eb;
}

.publicad-toggle-popover {
    position: fixed;
    z-index: 50;
    width: min(18rem, calc(100vw - 1.5rem));
    padding: 0.85rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    animation: publicadPopoverIn 0.18s ease-out;
}

html.dark .publicad-toggle-popover {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.publicad-toggle-popover.is-open {
    display: block;
}

@keyframes publicadPopoverIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.publicad-popover-title {
    margin: 0 0 0.15rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #111827;
}

html.dark .publicad-popover-title {
    color: #f1f5f9;
}

.publicad-popover-desc {
    margin: 0 0 0.65rem;
    font-size: 0.68rem;
    color: #6b7280;
    line-height: 1.35;
}

.publicad-popover-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    margin-bottom: 0.45rem;
    padding: 0.55rem 0.6rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease;
}

html.dark .publicad-popover-option {
    background: #0f172a;
    border-color: #334155;
}

.publicad-popover-option:hover {
    background: #eef5ff;
    border-color: #93c5fd;
}

html.dark .publicad-popover-option:hover {
    background: #172554;
    border-color: #2563eb;
}

.publicad-popover-option-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #0891b2, #2563eb);
    color: #fff;
    font-size: 0.75rem;
}

.publicad-popover-option-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.publicad-popover-option-text strong {
    font-size: 0.72rem;
    font-weight: 600;
    color: #111827;
}

html.dark .publicad-popover-option-text strong {
    color: #e2e8f0;
}

.publicad-popover-option-text small {
    font-size: 0.62rem;
    color: #6b7280;
    line-height: 1.25;
}

.publicad-popover-badge {
    flex-shrink: 0;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
}

html.dark .publicad-popover-badge {
    background: #334155;
    color: #cbd5e1;
}

.publicad-popover-badge.is-on {
    background: #cffafe;
    color: #0e7490;
}

html.dark .publicad-popover-badge.is-on {
    background: rgba(8, 145, 178, 0.25);
    color: #67e8f9;
}

.publicad-popover-hint {
    margin: 0.35rem 0 0;
    font-size: 0.62rem;
    color: #6b7280;
    line-height: 1.35;
}

.publicad-popover-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.65rem;
}

html.dark .publicad-popover-footer {
    border-top-color: #334155;
}

.publicad-popover-link {
    color: #2563eb;
    font-weight: 600;
}

.publicad-popover-link:hover {
    text-decoration: underline;
}

@media (min-width: 1024px) {
    html.sidebar-pref-open #sidebar {
        transform: translateX(0);
    }

    html.sidebar-pref-open #admin-main {
        padding-left: 16rem;
    }
}
