/**
 * CBT Exam Pro — Frontend Header Bar
 * File: assets/css/frontend-bar.css
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Space+Grotesk:wght@400;500;700&display=swap');

/* ─── Bar Wrapper ─────────────────────────────────────────── */
#cbt-frontend-bar {
    width: 100%;
    position: relative;
    z-index: 99998;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
}

/* ─── Animated background ─────────────────────────────────── */
#cbt-frontend-bar .cbt-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    min-height: 58px;
    background: linear-gradient(100deg, #0f0c29, #1a1060, #24243e);
    background-size: 300% 300%;
    animation: cbtGradientShift 8s ease infinite;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: relative;
    gap: 16px;
}

@keyframes cbtGradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Shimmer line at bottom */
#cbt-frontend-bar .cbt-bar-inner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #a78bfa, #60a5fa, transparent);
    animation: cbtShimmer 4s ease-in-out infinite;
}

@keyframes cbtShimmer {
    0%   { left: -60%; }
    100% { left: 120%; }
}

/* ─── Left: Brand + Tagline ───────────────────────────────── */
.cbt-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.cbt-bar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}

.cbt-bar-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
    flex-shrink: 0;
    transition: box-shadow 0.3s ease;
}

.cbt-bar-logo:hover .cbt-bar-logo-icon {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.8);
}

.cbt-bar-logo-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1;
}

.cbt-bar-logo-name span {
    color: #a78bfa;
}

.cbt-bar-divider {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.15);
}

/* ─── Center: Rotating taglines ──────────────────────────── */
.cbt-bar-center {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 22px;
    display: flex;
    align-items: center;
}

.cbt-tagline-track {
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cbt-tagline {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    height: 22px;
    line-height: 22px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.cbt-tagline strong {
    color: #c4b5fd;
    font-weight: 600;
}

.cbt-tagline .cbt-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    margin: 0 6px 1px;
    animation: cbtPulse 2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes cbtPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ─── Right: Auth Buttons ─────────────────────────────────── */
.cbt-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Logged-in user info */
.cbt-bar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cbt-bar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(167, 139, 250, 0.5);
    overflow: hidden;
    flex-shrink: 0;
}

.cbt-bar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cbt-bar-username {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buttons */
.cbt-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.cbt-bar-btn-ghost {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85) !important;
    border: 1px solid rgba(255,255,255,0.15);
}

.cbt-bar-btn-ghost:hover {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.cbt-bar-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
    border: 1px solid transparent;
}

.cbt-bar-btn-primary:hover {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.6);
    transform: translateY(-1px);
    color: #fff !important;
}

.cbt-bar-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.cbt-bar-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca !important;
    transform: translateY(-1px);
}

.cbt-bar-btn-dashboard {
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
    border: 1px solid transparent;
}

.cbt-bar-btn-dashboard:hover {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.5);
    transform: translateY(-1px);
    color: #fff !important;
}

/* Icon inside button */
.cbt-bar-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ─── Live exam ticker (shown when exams available) ───────── */
.cbt-bar-ticker {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #6ee7b7;
    font-weight: 500;
    white-space: nowrap;
}

.cbt-bar-ticker .cbt-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    animation: cbtPulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    #cbt-frontend-bar .cbt-bar-inner {
        padding: 0 14px;
        min-height: 50px;
    }

    .cbt-bar-center,
    .cbt-bar-divider,
    .cbt-bar-ticker {
        display: none;
    }

    .cbt-bar-username {
        max-width: 80px;
    }

    .cbt-bar-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cbt-bar-logo-name {
        display: none;
    }

    .cbt-bar-user .cbt-bar-username {
        display: none;
    }
}