/* ===== Modern SaaS Collapsible Left Sidebar Navigation Architecture ===== */

/* Prevent transitions on page load */
.preload,
.preload * {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}

:root {
    --bg-app: #08090b;
    --bg-header: #0c0d10;
    --bg-card: #111215;
    --bg-card-hover: #14161a;
    --border-subtle: #1c1e24;
    --border-medium: #262932;
    --text-main: #f9fafb;
    --text-sub: #9ca3af;
    --text-muted: #6b7280;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    width: 100vw;
    overflow: hidden; /* Main scrollable area is main panel */
    -webkit-font-smoothing: antialiased;
}

/* Custom Minimalist Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #22242c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #363945;
}

/* App Wrapper Layout */
.app-layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Left Collapsible Sidebar */
.app-left-sidebar {
    width: 72px; /* Collapsed width by default */
    background: var(--bg-header);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    align-items: stretch;
    padding: 20px 12px;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    z-index: 100;
    box-sizing: border-box;
    overflow: hidden;
    cursor: ew-resize;
}

.sidebar-nav-item,
.sidebar-reset-btn,
.sidebar-brand-logo,
.sidebar-toggle-btn {
    cursor: pointer !important;
}

.sidebar-nav-item *,
.sidebar-reset-btn *,
.sidebar-brand-logo *,
.sidebar-toggle-btn * {
    cursor: pointer !important;
}

html[data-sidebar-state="expanded"] .app-left-sidebar {
    width: 240px; /* Expanded width */
}

/* Danger Zone & Reset Button Footer behavior when Sidebar collapses/expands */
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .sidebar-footer {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    height: auto;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .danger-zone-card {
    background: transparent;
    border: none;
    padding: 0;
    align-items: center;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .danger-zone-title {
    display: none !important;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .sidebar-reset-btn {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 8px !important;
    margin: 0 auto !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .sidebar-reset-btn .reset-icon {
    font-size: 13px !important;
    width: auto !important;
    color: #ef4444 !important;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .sidebar-reset-btn:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .sidebar-reset-btn:hover .reset-icon {
    color: #ef4444 !important;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .reset-label {
    display: none !important;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin-bottom: 32px;
    padding: 0 4px;
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

html[data-sidebar-state="expanded"] .sidebar-header,
html.mobile-sidebar-open .sidebar-header {
    justify-content: space-between !important;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn i {
    font-size: 14px;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar {
    cursor: ew-resize !important;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-nav-item,
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-nav-item *,
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-toggle-btn,
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-toggle-btn *,
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-brand-logo,
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-brand-logo *,
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-footer,
html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .app-left-sidebar .sidebar-footer * {
    cursor: pointer !important;
}

.sidebar-toggle-btn:hover {
    background: #1c1e24;
    color: #ffffff;
}

.sidebar-brand-logo {
    font-size: 18px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    display: none;
}

html[data-sidebar-state="expanded"] .sidebar-brand-logo,
html.mobile-sidebar-open .sidebar-brand-logo {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
    padding-left: 6px; /* Align with navigation items padding */
}

.brand-yt {
    color: var(--accent-red);
}

.brand-spy {
    color: var(--text-main);
}

/* Sidebar Menu Items */
.sidebar-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px;
    color: #9ca3af;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    position: relative;
}

.sidebar-nav-item:hover {
    background: #14161a;
    color: #ffffff;
}

.sidebar-nav-item.active,
html[data-active-tab="competitors"] #navCompetitors,
html[data-active-tab="feed"] #navFeed,
html[data-active-tab="saved"] #navSaved {
    background: #232630;
    border-color: #383c4a;
    color: #ffffff;
}

.nav-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

html[data-sidebar-state="expanded"] .nav-label {
    opacity: 1;
    pointer-events: auto;
}

/* Badge dot in collapsed state */
.nav-icon-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.saved-count-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid var(--bg-header);
}

html[data-sidebar-state="expanded"] .saved-count-dot {
    display: none !important;
}

/* Badge count in expanded state */
.saved-count-badge {
    background: #3b4050;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

html[data-sidebar-state="expanded"] .saved-count-badge {
    opacity: 1;
}

/* Sidebar Reset Button Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.danger-zone-card {
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.danger-zone-title {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default !important;
}

.danger-zone-title * {
    cursor: default !important;
}

.sidebar-reset-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #dc2626 !important;
    border: 1px solid #ef4444 !important;
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff !important;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    position: relative !important;
    overflow: hidden !important;
}

.reset-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: #ffffff !important;
    transition: color 0.15s ease;
}

.sidebar-reset-btn:hover {
    background: #b91c1c !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
}

.sidebar-reset-btn:hover .reset-icon {
    color: #ffffff !important;
}

.sidebar-reset-btn.morph-undo {
    background: var(--accent-red) !important;
    color: #ffffff !important;
}

.sidebar-reset-btn.morph-undo .reset-icon {
    color: #ffffff !important;
}

.reset-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

html[data-sidebar-state="expanded"] .danger-zone-card,
html.mobile-sidebar-open .danger-zone-card {
    background: rgba(239, 68, 68, 0.04) !important;
    border: 1px solid rgba(239, 68, 68, 0.15) !important;
    border-radius: 10px !important;
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
}

html[data-sidebar-state="expanded"] .danger-zone-title,
html.mobile-sidebar-open .danger-zone-title {
    display: flex !important;
}

html[data-sidebar-state="expanded"] .sidebar-reset-btn,
html.mobile-sidebar-open .sidebar-reset-btn {
    width: 100% !important;
    height: auto !important;
    padding: 8px 12px !important;
    justify-content: flex-start !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

html[data-sidebar-state="expanded"] .reset-label,
html.mobile-sidebar-open .reset-label {
    opacity: 1 !important;
    display: inline-block !important;
    pointer-events: auto !important;
}

.undo-progress-bar-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.35);
    width: 100%;
    z-index: 10;
}

.undo-progress-line {
    height: 100%;
    background: #ffffff;
    width: 100%;
    border-radius: 2px;
    transition: width 0.05s linear;
}

/* ===== Main Content Area ===== */
.app-main-content {
    width: 100%;
}

.view-inner-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

/* Smooth Tab Transition Animations (Straight vertical pop-up rise) */
.view-panel {
    display: none;
    padding: 0 32px 60px 32px;
    box-sizing: border-box;
    animation: viewPanelPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: bottom center;
}

/* Display view panel matching current active tab */
html[data-active-tab="competitors"] #viewCompetitors,
html[data-active-tab="feed"] #viewFeed,
html[data-active-tab="saved"] #viewSaved,
html[data-active-tab="inspect"] #viewInspect {
    display: block;
}

@keyframes viewPanelPopIn {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Specific Vertical Pop-Up Animation for Viral Feed (#viewFeed) */
#viewFeed {
    animation: viralFeedPopUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: bottom center;
}

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

/* ===== Google-Style Competitors Layout with Smooth macOS Collapsible Search ===== */
.competitors-google-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 20px 0;
    gap: 28px;
    width: 100%;
}

/* Search Trigger Button — shown when search bar is collapsed */
.search-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #111215;
    border: 1px solid #232630;
    color: #9ca3af;
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    max-width: 400px;
    justify-content: space-between;
}

.search-trigger-btn:hover {
    background: #181a21;
    border-color: #383c4a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.search-trigger-btn .search-trigger-arrow {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.search-trigger-btn:hover .search-trigger-arrow {
    transform: translateX(3px);
}

.search-collapse-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0; /* Collapsed: hidden */
    height: 28px;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.google-search-wrapper.expanded .search-collapse-btn {
    width: 28px;
    opacity: 1;
    pointer-events: auto;
}

.search-collapse-btn:hover {
    background: #282c38;
    color: #ffffff;
}

/* Collapsible Smooth Search Wrapper */
.google-search-wrapper {
    width: 100%;
    max-width: 400px; /* Collapsed width by default */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.google-search-wrapper.expanded {
    max-width: 660px; /* Expanded width */
}

/* Empty state hero styling */
.competitors-empty-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    width: 100%;
    max-width: 600px;
    margin: 40px auto 0 auto;
    animation: fadeIn 0.4s ease forwards;
}

.empty-hero-headline {
    margin-bottom: 24px;
}

.empty-hero-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
}

.empty-hero-sub {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto;
}

/* Circle Ghost Add Channel Button */
.empty-hero-ghost-add {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.empty-hero-ghost-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px dashed #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.empty-hero-ghost-label {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.empty-hero-ghost-add:hover .empty-hero-ghost-circle {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.empty-hero-ghost-add:hover .empty-hero-ghost-label {
    color: #ffffff;
}

@keyframes searchSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Search Bar Container */
.google-search-bar {
    display: flex;
    align-items: center;
    background: #111215; /* Collapsed background */
    border: 1px solid #232630; /* Collapsed border */
    border-radius: 12px; /* Collapsed border-radius */
    padding: 0 18px;
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.google-search-wrapper.expanded .google-search-bar {
    background: #13151a; /* Expanded background */
    border-color: #4b5266; /* Expanded border */
    border-radius: 24px; /* Expanded border-radius */
    cursor: text;
}

.google-search-wrapper:not(.expanded) .google-search-bar:hover {
    background: #181a21;
    border-color: #383c4a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.google-search-icon {
    color: #717684;
    font-size: 14px;
    margin-right: 10px;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.google-search-wrapper.expanded .google-search-icon {
    color: #9ca3af;
}

.google-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    min-width: 0;
    pointer-events: none; /* Clicking collapsed bar expands it first */
    cursor: pointer;
}

.google-search-wrapper.expanded .google-search-input {
    pointer-events: auto; /* Typeable when expanded */
    cursor: text;
}

.google-search-input::placeholder {
    color: #6b7280;
}

/* In-Flow Dedicated Search Results Area (Smooth macOS Slide Down) */
.google-search-results-area {
    display: none; /* Hidden by default */
    width: 100%;
    background: #14161a;
    border: 1px solid #282a32;
    border-radius: 14px;
    overflow: hidden;
    flex-direction: column;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.google-search-results-area.open {
    display: flex; /* Toggle visible */
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Shortcuts Section Container */
.shortcuts-section-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.shortcuts-header-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
}

.shortcuts-meta-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.shortcuts-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #16181f;
    border: 1px solid #282d3b;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9999px;
    font-variant-numeric: tabular-nums;
}

/* Channels Row Scroll Window: fixed visible width, centered */
.shortcuts-scroll-wrap {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
}

/* The channel list is one shared card: a compact row when collapsed and the
   same container becomes a scrollable grid when expanded. All channels stay
   in the DOM; the collapsed state hides the overflow via .hidden-overflow,
   so toggling never rebuilds the list (no flicker). */
.shortcuts-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: safe center;
    gap: 12px;
    position: relative;
    width: 100%;
    max-height: 118px;
    overflow: hidden;
    padding: 8px 0;
    margin-bottom: 4px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
}

/* Overflow channels are hidden when collapsed (never removed from DOM) */
.channel-shortcut-item.hidden-overflow {
    display: none !important;
}

/* When expanded, all channels are visible again */
.shortcuts-grid.expanded .channel-shortcut-item.hidden-overflow {
    display: inline-flex !important;
}

.shortcuts-grid.empty {
    display: none;
}

.shortcuts-grid.expanded {
    display: grid;
    grid-template-columns: repeat(auto-fill, 88px);
    justify-content: center;
    align-items: start;
    max-height: 360px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 76px 14px 12px;
    border-color: #343844;
}

.shortcuts-expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 56px;
    min-width: 56px;
    height: 26px;
    margin: 0;
    padding: 0 6px;
    border: 1px solid #2d303a;
    border-radius: 7px;
    background: #15171c;
    color: #d1d5db;
    display: inline-grid;
    grid-template-columns: 10px 28px;
    align-items: center;
    justify-content: center;
    column-gap: 4px;
    cursor: pointer;
    font-family: inherit;
    z-index: 3;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.shortcuts-expand-btn:hover,
.shortcuts-expand-btn.expanded {
    background: #1c1e24;
    border-color: #464a58;
    color: #ffffff;
}

.shortcuts-expand-btn i {
    font-size: 9px;
    transition: transform 0.2s ease;
}

.shortcuts-expand-btn.expanded i {
    transform: rotate(180deg);
}

.shortcuts-expand-count {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    text-align: left;
}

/* Google-Style Circular Channel Shortcut */
.channel-shortcut-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 88px;
    min-width: 88px;
    flex-shrink: 0;
    padding: 8px 6px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.channel-shortcut-item:hover {
    background: #14161c;
    transform: translateY(-2px);
}

.shortcut-avatar-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a1c24;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #282a36;
    transition: border-color 0.15s ease;
}


.shortcut-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.shortcut-delete-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #252834;
    border: 1px solid #3d4252;
    color: #9ca3af;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.channel-shortcut-item:hover .shortcut-delete-btn {
    display: flex;
}

.shortcut-delete-btn:hover {
    color: #ffffff;
    background: #ef4444;
    border-color: #ef4444;
}

/* Touch devices have no hover state, so always show the per-channel
   delete button (at reduced opacity) instead of hiding it entirely. */
@media (hover: none) {
    .shortcut-delete-btn {
        display: flex;
        opacity: 0.85;
    }
}

.shortcut-channel-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.channel-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-external-icon {
    font-size: 10px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

/* MANDATORY REQUIREMENT: Hover Underline Link Effect on ALL Added Channels */
.channel-shortcut-item:hover .shortcut-channel-name,
.channel-shortcut-item:focus-visible .shortcut-channel-name,
.shortcut-channel-name:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    text-decoration-thickness: 1.5px !important;
    color: #ffffff !important;
}

.channel-shortcut-item:hover .channel-external-icon {
    opacity: 1;
    transform: scale(1);
}

/* Mobile version: ALWAYS show external link icon so user knows it's an external link */
@media (max-width: 900px) {
    .channel-external-icon {
        opacity: 0.9 !important;
        transform: scale(1) !important;
    }
}

/* Ghost Add Channel Shortcut Circle */
.shortcut-ghost-add {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 80px;
    max-width: 120px;
    padding: 8px 6px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.shortcut-ghost-add:hover {
    background: #14161c;
    transform: translateY(-2px);
}

.shortcut-ghost-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #121318;
    border: 2px dashed #313544;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 18px;
    transition: all 0.15s ease;
}

.shortcut-ghost-add:hover .shortcut-ghost-circle {
    border-color: #ffffff;
    color: #ffffff;
    background: #1c1e28;
}

.shortcut-ghost-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub);
    text-align: center;
    width: 100%;
}

.shortcut-ghost-add:hover .shortcut-ghost-label {
    color: #ffffff;
}

/* Competitors View Feed CTA */
.competitors-feed-cta-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

/* Persistent Top Header Fixed at Top Across Desktop/Tablet/Mobile */
.app-top-header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: var(--bg-app);
    border-bottom: 1px solid #1c1e24;
    margin-bottom: 24px;
    box-sizing: border-box;
    width: 100%;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-toggle-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.mobile-menu-toggle-btn:hover {
    background: #1c1e24;
    color: #ffffff;
}

@media (min-width: 901px) {
    .mobile-menu-toggle-btn {
        display: none;
    }
}

.top-header-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin: 0;
    line-height: 1.2;
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Demo Status Pill in Header */
.demo-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    padding: 6px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #eab308;
    user-select: none;
}

.demo-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #eab308;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.8);
    animation: demoPulse 2s infinite ease-in-out;
}

@keyframes demoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Header Upgrade CTA Button */
.header-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #0b0c0e;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.25);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-decoration: none;
}

.header-upgrade-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35);
    color: #000000;
}

.header-upgrade-btn:active {
    transform: translateY(0);
}

.header-upgrade-btn i {
    font-size: 12px;
    color: #0b0c0e;
}

/* Sidebar Demo Badge */
.sidebar-demo-tag {
    font-size: 9px;
    font-weight: 800;
    color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Sidebar Footer Upgrade Card */
.sidebar-footer-upgrade {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    width: 100%;
}

.sidebar-upgrade-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    padding: 10px 8px;
    color: #f59e0b;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-decoration: none;
}

.sidebar-upgrade-btn:hover {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fbbf24;
}

.sidebar-upgrade-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-upgrade-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.2;
}

.upgrade-main-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.upgrade-sub-price {
    font-size: 10.5px;
    font-weight: 600;
    color: #f59e0b;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .sidebar-upgrade-text {
    display: none !important;
}

html[data-sidebar-state="collapsed"]:not(.mobile-sidebar-open) .sidebar-upgrade-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    margin: 0 auto;
}

/* Demo Notice Bar in views */
.demo-notice-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(234, 179, 8, 0.07);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
    gap: 12px;
}

.demo-notice-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #d1d5db;
}

.demo-notice-icon {
    color: #eab308;
    font-size: 14px;
}

.demo-notice-text strong {
    color: #fef08a;
}

.demo-notice-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eab308;
    border: none;
    color: #0b0c0e;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.demo-notice-upgrade-btn:hover {
    background: #facc15;
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .demo-notice-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .demo-notice-upgrade-btn {
        width: 100%;
        justify-content: center;
    }
    .demo-badge-pill {
        display: none;
    }
}

/* Sub-toolbars placed under header inside view panels */
.feed-sub-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Filters on left, Saved Ideas pushed to the far right */
    margin-bottom: 16px;
    width: 100%;
}

.saved-sub-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
}

/* Sidebar Backdrop (Hidden on desktop) */
.sidebar-backdrop {
    display: none;
}

/* Core Main Content Layout Viewport */
.app-main-content {
    flex: 1;
    min-width: 0;
    padding: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Leaderboard Feed Swipe Animations (only replayed on Videos/Shorts format switch) */
.leaderboard-list-container.slide-from-left {
    animation: feedSwipeLeft 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.leaderboard-list-container.slide-from-right {
    animation: feedSwipeRight 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes feedSwipeRight {
    from {
        transform: translateX(80px);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes feedSwipeLeft {
    from {
        transform: translateX(-80px);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive Media Queries */
@media (max-width: 900px) {
    .app-left-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -240px !important;
        width: 240px !important;
        z-index: 500 !important;
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.6) !important;
        cursor: default !important;
    }
    
    html.mobile-sidebar-open .app-left-sidebar {
        left: 0 !important;
    }
    
    html.mobile-sidebar-open .sidebar-brand-logo {
        display: flex !important;
        opacity: 1 !important;
    }
    html.mobile-sidebar-open .nav-label {
        display: inline !important;
        opacity: 1 !important;
    }
    html.mobile-sidebar-open .reset-label {
        display: inline !important;
        opacity: 1 !important;
    }
    html.mobile-sidebar-open .saved-count-badge {
        display: inline-block !important;
        opacity: 1 !important;
    }
    html.mobile-sidebar-open .sidebar-footer {
        display: block !important;
    }
    
    .google-search-wrapper {
        max-width: 180px !important;
    }
    
    .google-search-wrapper.expanded {
        max-width: 100% !important;
    }
    
    .sidebar-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        z-index: 450;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    
    html.mobile-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 16px;
        background: var(--bg-header);
        border-bottom: 1px solid var(--border-subtle);
        width: 100%;
        box-sizing: border-box;
        position: sticky;
        top: 0;
        z-index: 300;
    }
    
    .mobile-menu-toggle-btn {
        background: transparent;
        border: none;
        color: #ffffff;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }
    
    .mobile-menu-toggle-btn:hover {
        background: #1c1e24;
    }
    
    .mobile-tab-title {
        font-size: 17px;
        font-weight: 800;
        color: #ffffff;
        margin-left: 12px;
        margin-right: auto;
    }

    .saved-page-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
        padding: 10px 14px !important;
    }

    .app-top-header {
        padding: 12px 16px !important;
        margin-bottom: 16px !important;
    }

    .app-main-content {
        padding: 0 !important;
        height: 100vh;
        overflow-y: auto;
    }
    
    .view-panel {
        padding: 0 14px 40px 14px !important;
        box-sizing: border-box;
    }

    .shortcut-delete-btn {
        display: flex !important;
    }

    .shortcuts-scroll-wrap {
        max-width: 376px;
    }
}

@media (max-width: 480px) {
    .view-panel {
        padding: 16px 12px 32px 12px;
    }
    
    .page-title {
        font-size: 20px;
    }
}

/* ===== Desktop Shorts Grid View (Compact & Shorter Height) ===== */
#resultsGrid.shorts-grid-view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 220px)) !important;
    justify-content: start !important;
    gap: 16px !important;
    width: 100% !important;
}

#resultsGrid.shorts-grid-view .outlier-card {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
    align-items: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#resultsGrid.shorts-grid-view .rank-badge-wrap {
    display: none !important;
}

#resultsGrid.shorts-grid-view .outlier-card.rank-one-champion .rank-badge-wrap {
    position: absolute !important;
    top: -14px !important;
    left: -12px !important;
    background: transparent !important;
    border: none !important;
    transform: rotate(-22deg) !important;
    z-index: 50 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
}

#resultsGrid.shorts-grid-view .outlier-card.rank-one-champion .rank-badge-wrap .rank-crown-icon {
    font-size: 24px !important;
    color: #fbbf24 !important;
    filter: none !important;
}

#resultsGrid.shorts-grid-view .outlier-thumb-wrap {
    grid-column: span 3 !important;
    width: 100% !important;
    height: 180px !important;
    max-height: 180px !important;
    aspect-ratio: auto !important;
    border-radius: 8px !important;
}

#resultsGrid.shorts-grid-view .outlier-thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#resultsGrid.shorts-grid-view .outlier-info-col {
    grid-column: span 3 !important;
    margin-bottom: 4px !important;
}

#resultsGrid.shorts-grid-view .outlier-divider-barrier {
    display: none !important;
}

#resultsGrid.shorts-grid-view .outlier-score-col {
    grid-column: 1 !important;
    width: auto !important;
    align-items: center !important;
    text-align: center !important;
}

#resultsGrid.shorts-grid-view .outlier-published-col {
    grid-column: 2 !important;
    width: auto !important;
    align-items: center !important;
    text-align: center !important;
}

#resultsGrid.shorts-grid-view .outlier-views-col {
    grid-column: 3 !important;
    width: auto !important;
    align-items: center !important;
    text-align: center !important;
}

#resultsGrid.shorts-grid-view .outlier-actions-col {
    grid-column: span 3 !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 6px !important;
}

#resultsGrid.shorts-grid-view .outlier-actions-col .card-action-btn {
    flex: 1 !important;
    justify-content: center !important;
}
