/* ============================================
   Header
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-lg);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-green), var(--accent-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(52, 211, 153, 0.5);
    }
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-badge {
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(52, 211, 153, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Demo Tour Button */
#demo-tour-btn {
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    animation: demo-pulse 2.5s ease-in-out infinite;
    white-space: nowrap;
}

#demo-tour-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

#demo-tour-btn.demo-running {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.15));
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
    animation: none;
}

@keyframes demo-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }

    50% {
        box-shadow: 0 0 12px 2px rgba(139, 92, 246, 0.2);
    }
}

/* Demo Overlay */
.demo-overlay {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-overlay.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.demo-overlay-card {
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 18px;
    padding: 20px 26px 16px;
    min-width: 400px;
    max-width: 520px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 50px rgba(139, 92, 246, 0.06);
}

.demo-card-enter {
    animation: demo-card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes demo-card-in {
    from { opacity: 0.5; transform: translateY(8px); }
    to   { opacity: 1;   transform: translateY(0); }
}

.demo-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.demo-step-indicator {
    font-size: 0.62rem;
    font-weight: 700;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.demo-step-icon {
    font-size: 1.15rem;
    margin-right: 6px;
}

.demo-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0 0 10px;
    line-height: 1.7;
}

.demo-desc ul {
    margin: 4px 0 0 0;
    padding-left: 16px;
    list-style: none;
}

.demo-desc ul li {
    position: relative;
    padding-left: 4px;
    margin-bottom: 2px;
}

.demo-desc ul li::before {
    content: '›';
    position: absolute;
    left: -12px;
    color: #a78bfa;
    font-weight: 700;
}

.demo-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.demo-nav-btn {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.08);
    color: #c4b5fd;
    transition: all 0.2s;
}

.demo-nav-btn:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
}

.demo-nav-btn.stop {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
}

.demo-nav-btn.stop:hover {
    background: rgba(239, 68, 68, 0.18);
}

.demo-dots {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 280px;
    margin: 0 auto;
}

.demo-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.2);
    transition: all 0.3s;
}

.demo-dot.active {
    background: #a78bfa;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.demo-dot.done {
    background: rgba(139, 92, 246, 0.4);
}

.demo-progress {
    height: 3px;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.demo-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a78bfa, #6366f1);
    border-radius: 2px;
    width: 0%;
}

/* Highlight ring for spotlighted elements */
.demo-highlight-ring {
    position: absolute;
    border: 2px dashed rgba(139, 92, 246, 0.5);
    border-radius: 10px;
    pointer-events: none;
    z-index: 9999;
    animation: demo-ring-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.15), inset 0 0 16px rgba(139, 92, 246, 0.05);
}

@keyframes demo-ring-pulse {
    0%, 100% { border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 0 16px rgba(139, 92, 246, 0.15); }
    50%      { border-color: rgba(139, 92, 246, 0.8); box-shadow: 0 0 24px rgba(139, 92, 246, 0.3); }
}

@media (max-width: 480px) {
    .demo-overlay-card {
        min-width: 300px;
        max-width: 360px;
        padding: 16px 18px 12px;
    }
    .demo-dots { max-width: 200px; }
}

/* Header User Info */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.header-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.header-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.header-role-badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
}

.header-role-badge.role-admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.header-role-badge.role-manager {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.header-role-badge.role-tech {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.header-role-badge.role-viewer {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.header-logout-btn {
    background: none;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-right: 8px;
    color: var(--text-secondary);
}

.header-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 640px) {

    .header-user-name,
    .header-role-badge {
        display: none;
    }
}


/* ============================================
   Tab Navigation
   ============================================ */
.tab-nav {
    max-width: 1400px;
    margin: var(--space-lg) auto 0;
    padding: 0 var(--space-lg);
    display: flex;
    gap: var(--space-sm);
}

.tab-btn {
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    border-color: var(--accent-green);
    background: rgba(52, 211, 153, 0.1);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.15);
}


/* ============================================
   Main Content
   ============================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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


/* ============================================
   Footer
   ============================================ */
.site-footer {
    margin-top: var(--space-2xl);
    padding: var(--space-lg);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}


/* ============================================
   Hamburger Button
   ============================================ */
.hamburger {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.hamburger:hover {
    background: var(--bg-hover);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ============================================
   Sidebar
   ============================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    z-index: 95;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light .sidebar {
    background: rgba(255, 255, 255, 0.95);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu {
    flex: 1;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: rgba(52, 211, 153, 0.1);
    color: var(--accent-green);
    font-weight: 600;
}

.sidebar-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.sidebar-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 16px 4px;
    margin-top: var(--space-xs);
    border-top: 1px solid var(--border-color);
}

.sidebar-group-label:first-of-type {
    border-top: none;
    margin-top: 0;
}


/* ============================================
   Responsive (merged from responsive.css)
   ============================================ */
@media (max-width: 900px) {

    .recorder-layout,
    .cc-layout,
    .report-layout {
        grid-template-columns: 1fr;
    }

    .cc-full,
    .report-full {
        grid-column: 1;
    }

    .tab-nav {
        overflow-x: auto;
    }

    .compare-cards {
        grid-template-columns: 1fr;
    }

    .compare-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
}