/*
 * ============================================
 *  ZUBOPACT � Component Styles 2026
 *  Modals, Toasts, Stats, Profile Cards,
 *  Tags, Tooltips, Empty States, and more
 *  Uses --zp-* tokens from theme.css
 * ============================================
 */

/* ============================================
   CUSTOM MODALS (non-Bootstrap)
   ============================================ */

.modal.zp-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.zp-modal.active {
    display: flex;
}

.zp-modal .modal-content {
    background: var(--zp-bg-card);
    border-radius: var(--zp-radius-2xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--zp-shadow-2xl);
    animation: zp-modalIn 250ms var(--zp-ease);
}

@keyframes zp-modalIn {
    from {
        transform: translateY(20px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.zp-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--zp-space-5) var(--zp-space-6);
    border-bottom: 1px solid var(--zp-border);
}

.zp-modal .modal-title {
    font-size: var(--zp-text-xl);
    font-weight: 700;
    margin: 0;
}

.zp-modal .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--zp-text-muted);
    transition: color var(--zp-duration-fast);
    border-radius: var(--zp-radius-sm);
    padding: var(--zp-space-1);
}

.zp-modal .modal-close:hover {
    color: var(--zp-text);
    background: var(--zp-bg-muted);
}

.zp-modal .modal-body {
    padding: var(--zp-space-6);
}

.zp-modal .modal-footer {
    display: flex;
    gap: var(--zp-space-3);
    justify-content: flex-end;
    padding: var(--zp-space-4) var(--zp-space-6);
    border-top: 1px solid var(--zp-border);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.zp-toast-container {
    position: fixed;
    bottom: var(--zp-space-6);
    right: var(--zp-space-6);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    gap: var(--zp-space-3);
    pointer-events: none;
}

.zp-toast {
    background: var(--zp-bg-card);
    border: 1px solid var(--zp-border);
    border-radius: var(--zp-radius-lg);
    padding: var(--zp-space-4) var(--zp-space-5);
    box-shadow: var(--zp-shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--zp-space-3);
    min-width: 300px;
    max-width: 420px;
    animation: zp-toastIn 0.4s var(--zp-ease-bounce);
    pointer-events: auto;
}

@keyframes zp-toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.zp-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--zp-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.zp-toast--success .zp-toast-icon {
    background: var(--zp-success-bg);
    color: var(--zp-success);
}

.zp-toast--error .zp-toast-icon {
    background: var(--zp-error-bg);
    color: var(--zp-error);
}

.zp-toast--warning .zp-toast-icon {
    background: var(--zp-warning-bg);
    color: var(--zp-warning);
}

.zp-toast--info .zp-toast-icon {
    background: var(--zp-info-bg);
    color: var(--zp-info);
}

.zp-toast-text {
    flex: 1;
}

.zp-toast-title {
    font-weight: 700;
    font-size: var(--zp-text-sm);
    color: var(--zp-text);
    margin-bottom: 2px;
}

.zp-toast-message {
    font-size: var(--zp-text-xs);
    color: var(--zp-text-secondary);
}

.zp-toast-close {
    background: none;
    border: none;
    color: var(--zp-text-muted);
    cursor: pointer;
    padding: var(--zp-space-1);
    font-size: 1rem;
    line-height: 1;
}

.zp-toast-close:hover {
    color: var(--zp-text);
}

/* ============================================
   STAT CARDS
   ============================================ */

.zp-stat-card {
    background: var(--zp-bg-card);
    border: 1px solid var(--zp-border);
    border-radius: var(--zp-radius-xl);
    padding: var(--zp-space-6);
    display: flex;
    align-items: center;
    gap: var(--zp-space-5);
    transition: var(--zp-transition);
}

.zp-stat-card:hover {
    box-shadow: var(--zp-shadow-md);
    transform: translateY(-2px);
}

.zp-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--zp-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.zp-stat-icon--primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--zp-brand);
}

.zp-stat-icon--success {
    background: var(--zp-success-bg);
    color: var(--zp-success);
}

.zp-stat-icon--warning {
    background: var(--zp-warning-bg);
    color: var(--zp-warning);
}

.zp-stat-icon--error {
    background: var(--zp-error-bg);
    color: var(--zp-error);
}

.zp-stat-icon--info {
    background: var(--zp-info-bg);
    color: var(--zp-info);
}

.zp-stat-label {
    font-size: var(--zp-text-xs);
    font-weight: 600;
    color: var(--zp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.zp-stat-value {
    font-size: var(--zp-text-2xl);
    font-weight: 800;
    color: var(--zp-text);
    line-height: 1.2;
}

.zp-stat-change {
    font-size: var(--zp-text-xs);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.zp-stat-change--up {
    color: var(--zp-success);
}

.zp-stat-change--down {
    color: var(--zp-error);
}

/* ============================================
   PROFILE CARDS
   ============================================ */

.zp-profile-card {
    background: var(--zp-bg-card);
    border: 1px solid var(--zp-border);
    border-radius: var(--zp-radius-xl);
    padding: var(--zp-space-6);
    text-align: center;
    transition: var(--zp-transition);
}

.zp-profile-card:hover {
    box-shadow: var(--zp-shadow-lg);
    transform: translateY(-4px);
    border-color: var(--zp-brand-200);
}

.zp-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--zp-radius-full);
    object-fit: cover;
    margin: 0 auto var(--zp-space-4);
    border: 3px solid var(--zp-brand-100);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.zp-profile-name {
    font-size: var(--zp-text-base);
    font-weight: 700;
    color: var(--zp-text);
    margin-bottom: 2px;
}

.zp-profile-role {
    font-size: var(--zp-text-xs);
    color: var(--zp-text-muted);
    margin-bottom: var(--zp-space-3);
}

.zp-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--zp-space-1);
    justify-content: center;
}

.zp-profile-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--zp-radius-full);
    background: var(--zp-bg-muted);
    color: var(--zp-text-secondary);
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   TAGS / CHIPS
   ============================================ */

.zp-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--zp-space-1);
    padding: var(--zp-space-1) var(--zp-space-3);
    border-radius: var(--zp-radius-full);
    font-size: var(--zp-text-xs);
    font-weight: 600;
    transition: var(--zp-transition);
    border: 1px solid var(--zp-border);
    background: var(--zp-bg-muted);
    color: var(--zp-text-secondary);
}

.zp-tag:hover {
    border-color: var(--zp-brand);
    color: var(--zp-brand);
    background: var(--zp-brand-50);
}

.zp-tag--brand {
    background: var(--zp-brand-50);
    border-color: var(--zp-brand-100);
    color: var(--zp-brand);
}

.zp-tag--success {
    background: var(--zp-success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--zp-success);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.zp-empty-state {
    text-align: center;
    padding: var(--zp-space-16) var(--zp-space-6);
}

.zp-empty-icon {
    font-size: 3rem;
    color: var(--zp-text-muted);
    margin-bottom: var(--zp-space-4);
    opacity: 0.5;
}

.zp-empty-title {
    font-size: var(--zp-text-xl);
    font-weight: 700;
    color: var(--zp-text);
    margin-bottom: var(--zp-space-2);
}

.zp-empty-desc {
    font-size: var(--zp-text-sm);
    color: var(--zp-text-muted);
    max-width: 400px;
    margin: 0 auto var(--zp-space-6);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.zp-progress {
    height: 8px;
    background: var(--zp-bg-muted);
    border-radius: var(--zp-radius-full);
    overflow: hidden;
}

.zp-progress-bar {
    height: 100%;
    border-radius: var(--zp-radius-full);
    background: var(--zp-gradient-glow);
    transition: width 0.6s var(--zp-ease);
}

/* ============================================
   AVATAR GROUP
   ============================================ */

.zp-avatar-group {
    display: flex;
    align-items: center;
}

.zp-avatar-group img {
    width: 36px;
    height: 36px;
    border-radius: var(--zp-radius-full);
    border: 2px solid var(--zp-bg);
    margin-left: -10px;
    object-fit: cover;
    transition: var(--zp-transition);
}

.zp-avatar-group img:first-child {
    margin-left: 0;
}

.zp-avatar-group img:hover {
    transform: scale(1.15);
    z-index: 10;
}

.zp-avatar-more {
    width: 36px;
    height: 36px;
    border-radius: var(--zp-radius-full);
    background: var(--zp-bg-muted);
    border: 2px solid var(--zp-bg);
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--zp-text-muted);
}

/* ============================================
   TOOLTIP (CSS-only)
   ============================================ */

.zp-tooltip {
    position: relative;
}

.zp-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    background: var(--zp-text);
    color: var(--zp-bg);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--zp-radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.zp-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   DIVIDER WITH TEXT
   ============================================ */

.zp-divider-text {
    display: flex;
    align-items: center;
    gap: var(--zp-space-4);
    margin: var(--zp-space-6) 0;
}

.zp-divider-text::before,
.zp-divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--zp-border);
}

.zp-divider-text span {
    font-size: var(--zp-text-xs);
    font-weight: 600;
    color: var(--zp-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   COUNT BADGE (notification dot)
   ============================================ */

.zp-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--zp-radius-full);
    background: var(--zp-error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--zp-bg);
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */

@media (max-width: 768px) {
    .zp-toast-container {
        bottom: var(--zp-space-4);
        right: var(--zp-space-4);
        left: var(--zp-space-4);
    }

    .zp-toast {
        min-width: auto;
        max-width: 100%;
    }

    .zp-stat-card {
        padding: var(--zp-space-4);
    }

    .zp-stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .zp-stat-value {
        font-size: var(--zp-text-xl);
    }
}



/* ============================================
   Floating Auth Toast - Label Notification
   ============================================ */
.zp-auth-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .10), 0 2px 8px rgba(30, 168, 88, .08);
    font-family: 'Plus Jakarta Sans', sans-serif;
    max-width: 400px;
    opacity: 0;
    transform: translateX(120%) translateY(-8px);
    transition: transform .8s cubic-bezier(.22, 1, .36, 1), opacity .8s cubic-bezier(.22, 1, .36, 1);
    pointer-events: auto;
}

.zp-auth-toast.zp-toast-in {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.zp-auth-toast.zp-toast-out {
    opacity: 0;
    transform: translateX(60%) translateY(-12px);
    transition: transform .6s cubic-bezier(.55, .06, .68, .19), opacity .5s ease;
}

/* Lock icon pill */
.zp-at-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #dbeafe, #a8ecc3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zp-at-icon i {
    font-size: 16px;
    color: #1e3a5f;
}

/* Text body */
.zp-at-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.zp-at-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #64748b;
    line-height: 1.2;
}

.zp-at-feature {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action buttons */
.zp-at-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.zp-at-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}

.zp-at-signin {
    background: #2563eb;
    color: #fff;
}

.zp-at-signin:hover {
    background: #1d4ed8;
    color: #fff;
}

.zp-at-signup {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.zp-at-signup:hover {
    background: #dbeafe;
    color: #1e3a5f;
}

/* Close button */
.zp-at-close {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    padding: 0;
}

.zp-at-close:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Mobile: stretch full width at bottom */
@media (max-width: 576px) {
    .zp-auth-toast {
        top: auto;
        bottom: 16px;
        right: 12px;
        left: 12px;
        max-width: none;
        transform: translateY(120%);
    }

    .zp-auth-toast.zp-toast-in {
        transform: translateY(0);
    }

    .zp-auth-toast.zp-toast-out {
        transform: translateY(80%);
    }
}