:root {
    --wpsic-bg-dark: #13151a;
    /* Slightly lighter than #0f1115 */
    --wpsic-bg-sidebar: #181a21;
    /* Adjusted */
    --wpsic-bg-nav: #13151a;
    --wpsic-bg-resources: #1c1f26;
    /* Adjusted */
    --wpsic-bg-card: #1c1f26;
    --wpsic-bg-hover: #252830;
    /* Slightly lighter than sidebar */
    --wpsic-text-primary: #ffffff;
    --wpsic-text-secondary: #8b949e;
    /* Changed from #a9b1d6 */
    --wpsic-accent: #7aa2f7;
    --wpsic-accent-hover: #8ab0ff;
    /* New */
    --wpsic-border: #242830;
    /* Changed from #24283b */
    --wpsic-hover: #1c2025;
    /* Updated to new --wpsic-bg-hover value */

    --nav-width: 60px;
    /* Changed from 48px */
    --cat-width: 240px;
    /* Changed from 208px */
    --cat-width-collapsed: 60px;
    /* Changed from 0px */
    --res-width: 280px;
    /* Changed from 260px */
    --res-width-collapsed: 60px;
    /* Changed from 0px */
}

.wpsic-light-mode {
    --wpsic-bg-dark: #f5f7fa;
    --wpsic-bg-sidebar: #ffffff;
    --wpsic-bg-nav: #f5f7fa;
    --wpsic-bg-resources: #ffffff;
    --wpsic-bg-card: #ffffff;
    --wpsic-bg-hover: #e2e6ea;
    --wpsic-text-primary: #1a1d21;
    --wpsic-text-secondary: #64748b;
    --wpsic-border: #e2e8f0;
    --wpsic-accent: #3b82f6;
    --wpsic-accent-hover: #2563eb;
    --wpsic-text-hover: #1a1d21;
}

/* Reset & Base */
#wpsic-app-root {
    font-family: 'Inter', sans-serif;
    background-color: var(--wpsic-bg-dark);
    color: var(--wpsic-text-primary);
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483647;
    /* Max z-index to cover everything */
    background-color: var(--wpsic-bg-dark);
    /* Ensure opaque background */
}

#wpsic-app-root * {
    box-sizing: border-box;
}

/* 1. Static Left Nav */
.wpsic-nav {
    width: var(--nav-width);
    height: 100%;
    background-color: var(--wpsic-bg-nav);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
    padding-bottom: 16px;
    border-right: 1px solid var(--wpsic-border);
    flex-shrink: 0;
    z-index: 20;
}

.wpsic-nav-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--wpsic-border);
    color: var(--wpsic-text-secondary);
    transition: all 0.2s;
    margin-bottom: 12px;
    position: relative;
    /* For tooltip positioning */
}

.wpsic-nav-item:hover {
    background-color: var(--wpsic-nav-hover);
    color: var(--wpsic-text-hover);
}

.wpsic-nav-item.active {
    background-color: var(--wpsic-active-indicator);
    color: #fff;
}

.wpsic-nav-item img,
.wpsic-nav-item svg {
    width: 38px;
    height: 38px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.wpsic-nav-item:hover img,
.wpsic-nav-item:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* Tooltip */
.wpsic-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: normal;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, left 0.2s;
    z-index: 100;
    pointer-events: none;
    margin-left: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default, cloned by JS */
}

.wpsic-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent #333 transparent transparent;
}

/* Tooltip hover logic moved to JS to avoid overflow clipping */
/* .wpsic-nav-item:hover .wpsic-tooltip,
.wpsic-sidebar-cat.collapsed .wpsic-menu-item:hover .wpsic-tooltip,
.wpsic-sidebar-res.collapsed .wpsic-res-card:hover .wpsic-tooltip {
    opacity: 1;
    visibility: visible;
    left: calc(100% + 10px);
} */

.wpsic-tooltip-title {
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
}

.wpsic-tooltip-desc {
    color: #ccc;
    font-size: 11px;
}

.wpsic-nav-spacer {
    flex-grow: 1;
}

/* 2. Category Sidebar */
.wpsic-sidebar-cat {
    width: var(--cat-width);
    height: 100%;
    background-color: var(--wpsic-bg-sidebar);
    border-right: 1px solid var(--wpsic-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease;
    overflow: hidden;
}

.wpsic-sidebar-cat.collapsed {
    width: var(--cat-width-collapsed);
}

.wpsic-sidebar-header {
    padding: 20px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
}

.wpsic-sidebar-cat.collapsed .wpsic-sidebar-header {
    opacity: 0;
    pointer-events: none;
}

.wpsic-menu-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

.wpsic-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--wpsic-text-secondary);
    transition: all 0.2s;
    margin-bottom: 4px;
    position: relative;
    overflow: visible;
}

.wpsic-menu-item:hover {
    background-color: var(--wpsic-bg-hover);
    color: var(--wpsic-text-hover);
}

.wpsic-menu-item.active {
    background-color: rgba(122, 162, 247, 0.1);
    color: var(--wpsic-active-indicator);
    border-left: 3px solid var(--wpsic-active-border);
}

.wpsic-menu-icon {
    width: 30px;
    height: 30px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpsic-cat-icon {
    filter: brightness(0) invert(0);
    transition: filter 0.3s;
}

body.dark-mode .wpsic-cat-icon {
    filter: brightness(0) invert(1);
}

.wpsic-menu-text {
    font-size: 14px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpsic-sidebar-cat.collapsed .wpsic-menu-text {
    opacity: 0;
    width: 0;
    display: none;
}

.wpsic-sidebar-cat.collapsed .wpsic-menu-item {
    justify-content: center;
    padding: 10px 0;
}

.wpsic-sidebar-cat.collapsed .wpsic-menu-icon {
    margin-right: 0;
}

/* 3. Resources Sidebar */
.wpsic-sidebar-res {
    width: var(--res-width);
    height: 100%;
    background-color: var(--wpsic-bg-resources);
    border-right: 1px solid var(--wpsic-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease;
    position: relative;
    overflow: visible;
}

.wpsic-sidebar-res.collapsed {
    width: var(--res-width-collapsed);
    border-right: none;
}

.wpsic-res-inner {
    flex-grow: 1;
    width: var(--res-width);
    /* Keep fixed width to avoid layout shift during collapse */
    overflow-y: auto;
    overflow-x: hidden;
    transition: opacity 0.2s;
    opacity: 1;
}

.wpsic-sidebar-res.collapsed .wpsic-res-inner {
    opacity: 1;
    pointer-events: auto;
    width: 100%;
}

.wpsic-sidebar-res.collapsed .wpsic-res-header {
    display: none;
}

.wpsic-sidebar-res.collapsed .wpsic-res-info {
    display: none;
}

.wpsic-sidebar-res.collapsed .wpsic-star-icon {
    display: none;
}

.wpsic-sidebar-res.collapsed .wpsic-card-save {
    display: none;
}

.wpsic-sidebar-res.collapsed .wpsic-res-card {
    justify-content: center;
    padding: 12px 0;
    border: none;
}

.wpsic-sidebar-res.collapsed .wpsic-res-icon {
    margin-right: 0;
    width: 28px;
    height: 28px;
}

.wpsic-res-header {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--wpsic-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpsic-res-list {
    /* Removed flex-grow here as it is now on inner */
    padding: 12px;
}

.wpsic-res-card {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background-color: var(--wpsic-bg-res-card);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: visible;
    border: 1px solid transparent;
    /* Prepare for hover border */
}

.wpsic-res-card:hover {
    background-color: var(--wpsic-bg-res-hover);
    border-color: var(--wpsic-border-res-hover);
    transform: translateY(-2px);
    color: var(--wpsic-text-res-hover);
}

.wpsic-res-card:hover .wpsic-res-title,
.wpsic-res-card:hover .wpsic-res-desc {
    color: var(--wpsic-text-res-hover);
}

.wpsic-res-card.active {
    border-color: var(--wpsic-active-border);
    background-color: rgba(122, 162, 247, 0.05);
}

.wpsic-res-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.wpsic-res-info {
    flex-grow: 1;
    min-width: 0;
}

.wpsic-res-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpsic-res-desc {
    font-size: 12px;
    color: var(--wpsic-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpsic-star-icon {
    color: #fbbf24;
    /* Amber/Gold */
    margin-left: 6px;
}

/* Mobile Elements (Hidden on Desktop) */
.wpsic-res-actions-mobile,
.wpsic-mobile-res-header,
.wpsic-mobile-header-icon,
.wpsic-mobile-menu-container {
    display: none;
}

/* Hide mobile description on desktop */
.wpsic-res-mobile-desc {
    display: none;
}

/* Collapse Button (Attached to Resources Sidebar) */
.wpsic-collapse-btn {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-color: var(--wpsic-bg-resources);
    border: 1px solid var(--wpsic-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    color: var(--wpsic-text-secondary);
    transition: transform 0.3s;
}

.wpsic-sidebar-res.collapsed .wpsic-collapse-btn {
    right: -24px;
    transform: translateY(-50%) rotate(180deg);
    background-color: var(--wpsic-bg-dark);
    /* Match content bg when collapsed */
}

/* Removed previous hack blocks as they are replaced by proper structure above */


/* 4. Content Area (Iframe) */
.wpsic-content {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
    min-width: 0;
    /* Flexbox fix */
}

/* Address Bar */
.wpsic-address-bar {
    height: 48px;
    width: 100%;
    /* Ensure full width */
    background-color: var(--wpsic-bg-sidebar);
    border-bottom: 1px solid var(--wpsic-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    flex-shrink: 0;
}

.wpsic-url-display {
    background-color: var(--wpsic-bg-dark);
    padding: 0 12px;
    height: 32px;
    line-height: 32px;
    border-radius: 4px;
    color: var(--wpsic-text-secondary);
    font-size: 13px;
    font-family: monospace;
    flex-grow: 1;
    margin-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--wpsic-border);
    display: block;
    /* Ensure block behavior for width */
}

.wpsic-actions {
    display: flex;
    gap: 8px;
    position: relative;
    /* For share menu positioning */
}

.wpsic-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    /* Changed from 4px */
    cursor: pointer;
    color: var(--wpsic-text-secondary);
    transition: all 0.2s;
}

.wpsic-action-btn:hover {
    background-color: var(--wpsic-hover);
    color: var(--wpsic-text-primary);
}

.wpsic-action-btn:hover {
    background: var(--wpsic-bg-hover);
    color: var(--wpsic-text-primary);
}

.wpsic-action-btn.active {
    color: var(--wpsic-accent);
}

.wpsic-share-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--wpsic-bg-card);
    border: 1px solid var(--wpsic-border);
    border-radius: 8px;
    padding: 8px;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}

.wpsic-share-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wpsic-share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--wpsic-text-primary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.wpsic-share-item:hover {
    background: var(--wpsic-bg-hover);
}

.wpsic-iframe-container {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    position: relative;
}

.wpsic-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.wpsic-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-size: 14px;
    background-color: #f5f5f5;
}

/* Mini Menu Container */
.wpsic-mini-menu {
    padding: 16px;
    border-top: 1px solid var(--wpsic-border);
    position: relative;
    background-color: var(--wpsic-bg-sidebar);
}

.wpsic-sidebar-cat.collapsed .wpsic-mini-menu {
    display: none;
}

/* Menu Button */
.wpsic-menu-btn {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    border: 1px solid var(--wpsic-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--wpsic-text-secondary);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.wpsic-menu-btn:hover {
    border-color: var(--wpsic-accent);
    color: var(--wpsic-text-primary);
    background-color: var(--wpsic-bg-hover);
}

/* Popup Menu */
.wpsic-mini-popup {
    position: absolute;
    bottom: calc(100% - 10px);
    /* Sit just above the container */
    left: 10px;
    width: calc(100% - 20px);
    background-color: var(--wpsic-bg-sidebar);
    border: 1px solid var(--wpsic-border);
    border-radius: 12px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    padding: 8px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wpsic-mini-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wpsic-popup-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--wpsic-text-primary);
    font-weight: 500;
    font-size: 13px;
    transition: background-color 0.2s;
}

.wpsic-popup-item:hover {
    background-color: var(--wpsic-bg-hover);
}

.wpsic-popup-icon {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.wpsic-popup-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--wpsic-border);
}

.wpsic-popup-close {
    width: 100%;
    padding: 10px;
    text-align: center;
    background-color: var(--wpsic-bg-hover);
    border-radius: 6px;
    margin-top: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    color: var(--wpsic-text-primary);
    transition: background-color 0.2s;
}

.wpsic-popup-close:hover {
    background-color: var(--wpsic-border);
}

/* Switch Toggle */
.wpsic-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    margin-left: auto;
}

.wpsic-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wpsic-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: .4s;
    border-radius: 24px;
}

.wpsic-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.wpsic-slider {
    background-color: var(--wpsic-accent);
}

input:checked+.wpsic-slider:before {
    transform: translateX(18px);
}

/* Mobile */
@media (max-width: 768px) {
    .wpsic-nav {
        display: none;
    }

    .wpsic-sidebar-cat {
        display: none;
    }

    /* Simplify for mobile for now */
    .wpsic-sidebar-res {
        width: 100%;
    }

    .wpsic-content {
        display: none;
    }

    /* Mobile View Logic would be more complex, but keeping it simple as requested */
    .wpsic-sidebar-res.mobile-hidden {
        display: none;
    }

    .wpsic-content.mobile-visible {
        display: flex;
    }
}

/* Animations */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

.wpsic-animate-enter {
    /* Animation name and duration will be set via JS inline style or class modification */
    opacity: 0;
    /* Start hidden */
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

/* Heart Pop Animation */
@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.wpsic-heart-pop {
    animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Floating Hearts Particles */
.wpsic-particle {
    position: absolute;
    pointer-events: none;
    animation: particleUp 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes particleUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translateY(-20px) scale(1);
        opacity: 0;
    }
}

/* Newsletter Modal */
.wpsic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2147483647;
    /* Max z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.wpsic-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wpsic-modal {
    background-color: var(--wpsic-bg-sidebar);
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--wpsic-border);
    position: relative;
    transform: scale(0.95);
    transition: all 0.3s;
}

.wpsic-modal-overlay.active .wpsic-modal {
    transform: scale(1);
}

.wpsic-modal h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--wpsic-text-primary);
}

.wpsic-modal p {
    color: var(--wpsic-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.wpsic-form-group {
    margin-bottom: 16px;
}

.wpsic-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--wpsic-text-primary);
}

.wpsic-form-input {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--wpsic-bg-dark);
    border: 1px solid var(--wpsic-border);
    border-radius: 6px;
    color: var(--wpsic-text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.wpsic-form-input:focus {
    outline: none;
    border-color: var(--wpsic-accent);
}

.wpsic-btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--wpsic-subscribe-bg);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wpsic-btn-primary:hover {
    opacity: 0.9;
}

.wpsic-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wpsic-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--wpsic-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.wpsic-modal-close svg {
    width: 20px;
    height: 20px;
}

/* --- Mobile Responsive Styles --- */
@media (max-width: 768px) {

    /* Hide Desktop Navigation */
    #wpsic-main-nav {
        display: none !important;
    }

    /* Hide Content Area (since we open in new tab) */
    #wpsic-content {
        display: none;
    }

    /* Layout Adjustments */
    #wpsic-app-root {
        flex-direction: column;
    }

    .wpsic-sidebar-cat,
    .wpsic-sidebar-res {
        width: 100%;
        border-right: none;
        display: flex;
        flex-direction: column;
    }

    /* Mobile Headers */
    .wpsic-sidebar-header,
    .wpsic-mobile-res-header {
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        /* Title left, Icon right */
        padding: 0 16px;
        font-size: 18px;
        font-weight: 700;
        border-bottom: 1px solid var(--wpsic-border);
        background-color: var(--wpsic-bg-sidebar);
        flex-shrink: 0;
    }

    .wpsic-mobile-res-header {
        justify-content: flex-start;
        /* Back arrow, Title, Icon */
        gap: 12px;
    }

    .wpsic-mobile-back {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
    }

    .wpsic-mobile-title {
        flex-grow: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wpsic-mobile-header-icon {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 14px;
        color: var(--wpsic-text-secondary);
    }

    /* Resource Card Mobile Layout - Match Screenshot */
    .wpsic-res-card {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 12px;
        padding: 16px;
        align-items: center;
    }

    /* Icon - Row 1, Column 1 */
    .wpsic-res-card-left {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
    }

    .wpsic-res-icon {
        width: 32px;
        height: 32px;
        margin-right: 12px;
    }

    /* Title - Row 1, Column 2 */
    .wpsic-res-info {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .wpsic-res-title {
        font-size: 16px;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide desktop description on mobile */
    .wpsic-res-desc {
        display: none;
    }

    /* Actions - Row 1, Column 3 */
    .wpsic-res-actions-mobile {
        grid-column: 3;
        grid-row: 1;
        display: flex;
        flex-direction: row;
        gap: 16px;
        align-items: center;
        justify-content: flex-end;
    }

    /* Mobile Description - Row 2, spans columns 2-3 */
    .wpsic-res-mobile-desc {
        grid-column: 2 / 4;
        grid-row: 2;
        font-size: 13px;
        color: var(--wpsic-text-secondary);
        line-height: 1.4;
        display: block !important;
        /* Override desktop display:none */
    }

    .wpsic-card-save-mobile,
    .wpsic-card-link-mobile {
        cursor: pointer;
        color: var(--wpsic-text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    /* Hide Desktop Save Button */
    .wpsic-card-save.desktop-only {
        display: none !important;
    }

    /* Bottom Menu Positioning */
    .wpsic-mini-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        border-top: 1px solid var(--wpsic-border);
        background-color: var(--wpsic-bg-sidebar);
        z-index: 100;
    }

    .wpsic-menu-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .wpsic-mini-popup {
        bottom: 48px;
        /* Above the menu button */
        left: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .wpsic-mini-popup.open {
        transform: translateY(0);
    }

    /* Adjust list padding for bottom menu */
    .wpsic-menu-list,
    .wpsic-res-list {
        padding-bottom: 60px;
    }

    /* Hide collapse button on mobile */
    .wpsic-collapse-btn {
        display: none;
    }


    /* Show Mobile Menu Container */
    .wpsic-mobile-menu-container {
        display: block !important;
    }
}

/* Coming Soon Overlay */
.wpsic-res-card {
    position: relative;
    overflow: hidden;
    /* Ensure overlay stays inside */
}

.wpsic-coming-soon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(31, 41, 55, 0.9);
    /* Dark semi-transparent background */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.wpsic-res-card:hover .wpsic-coming-soon-overlay {
    opacity: 1;
    visibility: visible;
}

/* Hide resource descriptions on desktop (only visible on mobile) */
@media (min-width: 769px) {
    .wpsic-res-desc {
        display: none !important;
    }
}

/* Iframe Tutorial Overlay */
.wpsic-iframe-tutorial {
    position: absolute;
    z-index: 1000;
    animation: fadeInScale 0.3s ease-out;
}

.wpsic-tutorial-content {
    background: linear-gradient(135deg, var(--wpsic-tutorial-gradient-start, #667eea) 0%, var(--wpsic-tutorial-gradient-end, #764ba2) 100%);
    color: var(--wpsic-tutorial-text, white);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-width: 220px;
    min-width: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpsic-tutorial-arrow {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--wpsic-tutorial-gradient-start, #667eea);
}

.wpsic-tutorial-text {
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wpsic-tutorial-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--wpsic-tutorial-text, white);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
}

.wpsic-tutorial-close:hover {
    background: var(--wpsic-tutorial-button-bg, rgba(255, 255, 255, 0.3));
    transform: translateY(-1px);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

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

/* Dark Mode Icons */
.wpsic-has-dark-icon .wpsic-cat-icon-light {
    display: block;
}

.wpsic-has-dark-icon .wpsic-cat-icon-dark {
    display: none;
}

body.dark-mode .wpsic-has-dark-icon .wpsic-cat-icon-light {
    display: none !important;
}

body.dark-mode .wpsic-has-dark-icon .wpsic-cat-icon-dark {
    display: block !important;
}