/* CSS Variables - Unified MeshMerchant Design System */
:root {
    /* Brand Colors - Matching Website */
    --background-color: #fafbfc;
    --sidebar-bg: #ffffff;
    --sidebar-text: #374151;
    --sidebar-hover: #f3f4f6;
    --primary-color: #129ed9;
    --primary-purple: #a474eb;
    --color-gradient: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --button-bg: #e5e7eb;
    --button-hover: #129ed9;
    --input-bg: transparent;
    --input-text: #374151;
    --text-color: #374151;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --card-shadow: rgba(18, 158, 217, 0.08);
    --transition-speed: 0.25s;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* Modern Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Touch-friendly improvements */
button, a, .menu-item, .library-item, .product-row {
    touch-action: manipulation;
}

@media (hover: none) and (pointer: coarse) {
    /* Touch device specific styles */
    button:active, .action-button:active {
        transform: scale(0.98);
    }
}

/* Removed full-screen loading overlay - using inline button loading states instead */

/* Login Screen - Matching Website Theme */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--color-gradient);
    background-attachment: fixed;
}

.login-card {
    background: white;
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), 
                0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: cardSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    margin-bottom: 32px;
    text-align: center;
}

.login-logo {
    width: 180px;
    height: auto;
    margin-bottom: 24px;
}

.login-card h1 {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.login-card p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 400;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.login-button:hover::before {
    width: 400px;
    height: 400px;
}

.login-button:hover {
    border-color: var(--primary-color);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.2);
}

.login-button.google {
    border-color: #4285f4;
}

.login-button.google:hover {
    background: #4285f4;
    color: white;
}

.login-button.secondary {
    background: white;
}

.login-button.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.login-button.primary:hover {
    background: #0d8bc1;
    border-color: #0d8bc1;
}

.login-options {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.login-divider span {
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.email-login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-field {
    margin-bottom: 16px;
}

.login-input {
    width: 100%;
    padding: 12px 18px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.login-input:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-input.error {
    border-color: #ef4444;
}

.login-error-message {
    display: none;
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    padding-left: 4px;
}

.login-error-message.show {
    display: block;
}

.login-form-actions {
    display: flex;
    gap: 12px;
}

.login-form-actions button {
    flex: 1;
}

.magic-link-btn {
    padding: 10px 16px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.magic-link-btn:hover {
    background: #f3f4f6;
}

.back-button {
    padding: 10px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-button:hover {
    color: var(--text-color);
}

.magic-link-sent {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.magic-link-sent h3 {
    margin: 0 0 12px 0;
    color: var(--text-color);
    font-size: 20px;
}

.magic-link-email-display {
    font-weight: 600;
    color: var(--primary-color);
    margin: 8px 0;
}

.magic-link-note {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 12px 0 24px 0;
}

/* Main Container */
.container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 3px 0 16px rgba(15, 23, 42, 0.04);
    border-right: 1px solid rgba(229, 231, 235, 0.8);
    width: 280px;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    border-radius: 0 16px 16px 0;
    overflow-x: hidden;
    overflow-y: auto;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    left: -220px;
}

/* COLLAPSING STATE: Only change the 'left' property, nothing else */
/* The sidebar slides while all content stays EXACTLY in default state */
.sidebar.collapsing {
    left: -220px;
}

/* EXPANDING STATE: Fade out icons while sidebar slides out */
.sidebar.expanding {
    /* No left position - allows sidebar to slide immediately to 0 */
}

/* Keep collapsed icon-only layout during initial expanding phase */
.sidebar.expanding .sidebar-header {
    padding: 12px 10px !important;
    justify-content: flex-end !important;
}

.sidebar.expanding .sidebar-menu {
    padding: 12px 10px !important;
}

.sidebar.expanding .menu-item {
    width: 40px !important;
    height: 40px !important;
    padding: 8px !important;
    margin: 0 !important;
    margin-left: auto !important;
    opacity: 1;
    animation: fadeOutCollapsedIcons 0.1s ease-in forwards;
}

.sidebar.expanding .menu-icon,
.sidebar.expanding .menu-item img {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
}

/* Hide full content elements during expanding - using visibility to prevent layout changes */
.sidebar.expanding .sidebar-logo,
.sidebar.expanding .menu-item-text,
.sidebar.expanding .submenu-arrow,
.sidebar.expanding .menu-section-label,
.sidebar.expanding .menu-divider,
.sidebar.expanding .sidebar-header-store,
.sidebar.expanding .sidebar-footer-card,
.sidebar.expanding .sidebar-footer {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Content is immediately visible when expanding state ends - no animations */
.sidebar:not(.collapsed):not(.expanding) .sidebar-logo,
.sidebar:not(.collapsed):not(.expanding) .menu-item-text,
.sidebar:not(.collapsed):not(.expanding) .submenu-arrow,
.sidebar:not(.collapsed):not(.expanding) .menu-section-label,
.sidebar:not(.collapsed):not(.expanding) .menu-divider,
.sidebar:not(.collapsed):not(.expanding) .sidebar-header-store,
.sidebar:not(.collapsed):not(.expanding) .sidebar-footer-card,
.sidebar:not(.collapsed):not(.expanding) .sidebar-footer {
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar.collapsed:not(.collapsing) .sidebar-header {
    padding: 12px 10px;
    justify-content: flex-end;
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar.collapsed:not(.collapsing) .sidebar-logo {
    display: none; /* Hide logo when collapsed to make room for button */
}

.sidebar.collapsed:not(.collapsing) .sidebar-close-btn {
    position: static;
    opacity: 0;
    width: 40px;
    height: 40px;
    padding: 8px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInCollapsedIcons 0.25s ease-out forwards;
}

.sidebar.collapsed:not(.collapsing) .sidebar-close-btn svg {
    width: 24px;
    height: 24px;
}

/* Fade out close button when expanding */
.sidebar.expanding .sidebar-close-btn {
    opacity: 1;
    animation: fadeOutCollapsedIcons 0.1s ease-in forwards;
}

/* Desktop only: Icon-only collapsed sidebar */
@media (min-width: 769px) {
    /* When collapsed, hide labels and footer */
    .sidebar.collapsed .menu-section-label,
    .sidebar.collapsed .menu-divider,
    .sidebar.collapsed .sidebar-header-store,
    .sidebar.collapsed .sidebar-footer-card,
    .sidebar.collapsed .sidebar-footer {
        display: none;
    }

    /* Show the navigation menu when collapsed */
    .sidebar.collapsed .sidebar-menu {
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        padding: 12px 10px;
        padding-right: 10px;
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        clip: auto !important;
    }

    /* Menu items - content is static, clipped by sidebar */
    .sidebar .menu-item {
        overflow: hidden;
        position: relative;
        white-space: nowrap;
    }
    
    /* Icon styling */
    .sidebar .menu-icon,
    .sidebar .menu-item img {
        flex-shrink: 0;
    }
    
    /* Style menu items in collapsed state - icon only, on right side */
    .sidebar.collapsed .menu-item {
        width: 40px;
        height: 40px;
        padding: 8px;
        margin: 0;
        margin-left: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        cursor: pointer;
        position: relative;
        font-size: 0 !important; /* Hide text nodes */
        box-sizing: border-box;
        gap: 0 !important;
        opacity: 0;
        animation: fadeInCollapsedIcons 0.25s ease-out forwards;
    }
    
    /* When NOT collapsed and NOT expanding, menu items are fully visible with no animations */
    .sidebar:not(.collapsed):not(.expanding) .menu-item {
        opacity: 1 !important;
        animation: none !important;
        transition: none !important;
    }
    
    /* Text content is instantly visible - no transitions/animations */
    .sidebar:not(.collapsed):not(.expanding) .menu-item-text,
    .sidebar:not(.collapsed):not(.expanding) .submenu-arrow,
    .sidebar:not(.collapsed):not(.expanding) .sidebar-logo,
    .sidebar:not(.collapsed):not(.expanding) .menu-section-label,
    .sidebar:not(.collapsed):not(.expanding) .sidebar-footer-card {
        opacity: 1;
        transition: none !important;
    }
    
    /* Sidebar layout elements instantly revert to normal - no transitions */
    .sidebar:not(.collapsed):not(.expanding) .sidebar-header,
    .sidebar:not(.collapsed):not(.expanding) .sidebar-menu {
        transition: none !important;
    }

    /* Hide items without icons in collapsed state */
    .sidebar.collapsed:not(.collapsing) .menu-item:not(:has(.menu-icon)):not(:has(img)) {
        display: none;
    }

    /* Show only the icon, centered */
    .sidebar.collapsed:not(.collapsing) .menu-icon {
        margin: 0 !important;
        display: block !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 24px !important; /* Reset font-size for SVG icons */
    }
    
    /* Ensure img icons display properly in collapsed state */
    .sidebar.collapsed:not(.collapsing) .menu-item img {
        margin: 0 !important;
        display: block !important;
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Smooth fade-in animation for collapsed icons - quick and smooth */
    @keyframes fadeInCollapsedIcons {
        0% {
            opacity: 0;
            transform: scale(0.9);
        }
        100% {
            opacity: 1;
            transform: scale(1);
        }
    }
    
    /* Smooth fade-out animation for expanding - reverse of fade-in */
    @keyframes fadeOutCollapsedIcons {
        0% {
            opacity: 1;
            transform: scale(1);
        }
        100% {
            opacity: 0;
            transform: scale(0.9);
        }
    }

    /* Collapsed menu item hover effect */
    .sidebar.collapsed:not(.collapsing) .menu-item:hover {
        background-color: rgba(18, 158, 217, 0.1);
    }

    /* Collapsed menu item active state */
    .sidebar.collapsed:not(.collapsing) .menu-item.active {
        background-color: rgba(18, 158, 217, 0.15);
    }

    /* Hide help center button in collapsed state */
    .sidebar.collapsed:not(.collapsing) .help-center-btn {
        display: none !important;
    }
    
    
    /* Make logo clickable and add hover effect when collapsed */
    /* Tooltip for collapsed menu items */
    .sidebar.collapsed:not(.collapsing) .menu-item {
        position: relative;
    }
    
    .sidebar.collapsed:not(.collapsing) .menu-item::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 12px;
        padding: 6px 12px;
        background: rgba(0, 0, 0, 0.9);
        color: white;
        font-size: 13px;
        font-weight: 500;
        border-radius: 6px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 1000;
    }
    
    .sidebar.collapsed:not(.collapsing) .menu-item:hover::after {
        opacity: 1;
    }
}

/* Content is always visible and static - revealed by sidebar width */
.menu-section-label,
.sidebar-header-store {
    opacity: 1;
    white-space: nowrap;
}

/* When collapsed - content is clipped by sidebar overflow, but stays in place */
.sidebar.collapsed .menu-section-label,
.sidebar.collapsed .sidebar-header-store {
    pointer-events: none;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 60px;
}

.main-content {
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background-color: transparent;
    margin-bottom: 0;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
    width: 140px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-logo {
    height: 24px;
    width: auto;
    transition: opacity 0.2s ease;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

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

.sidebar-close-btn svg {
    width: 20px;
    height: 20px;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
}

.sidebar-menu {
    flex: 1;
    padding: 20px;
    transition: padding 0.15s ease-out;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, padding 0.15s ease-out, width 0.15s ease-out, height 0.15s ease-out, margin 0.15s ease-out;
    margin-bottom: 8px;
    text-align: left;
    position: relative;
    white-space: nowrap;
}

/* Smooth transition for menu icons */
.menu-icon,
.menu-item img {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: var(--primary-color);
    padding-left: 20px;
}

.menu-item:hover::before {
    height: 50%;
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(79, 70, 229, 0.06) 100%);
    color: var(--primary-color);
    font-weight: 600;
    padding-left: 20px;
}

.menu-item.active::before {
    height: 70%;
}

.menu-item.active .menu-icon {
    stroke: var(--primary-color);
}

.menu-icon {
    flex-shrink: 0;
}

/* Help Center Button - Distinct but Clean */
.help-center-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 32px);
    margin: 12px 16px 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(18, 158, 217, 0.08) 0%, rgba(164, 116, 235, 0.08) 100%);
    border: 1px solid rgba(18, 158, 217, 0.15);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #129ed9;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.help-center-btn:hover {
    background: linear-gradient(135deg, rgba(18, 158, 217, 0.15) 0%, rgba(164, 116, 235, 0.15) 100%);
    border-color: rgba(18, 158, 217, 0.25);
    box-shadow: 0 4px 12px rgba(18, 158, 217, 0.15);
}

.help-center-btn .menu-icon {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.logout-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--danger-color);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.logout-button:hover {
    border-color: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.logout-button:hover::before {
    transform: translateY(0);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    overflow-y: auto;
    background: var(--background-color);
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 32px;
}

.section-header--visual {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    gap: 12px;
    padding: 24px;
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

.section-header--visual::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40%;
    pointer-events: none;
    z-index: 0;
}

.section-header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

.section-header-logo img {
    height: 44px;
    width: auto;
    display: block;
}

.section-header--visual p {
    margin: 0;
    font-size: 15px;
    color: #6b7280;
    max-width: 600px;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* Brand-specific gradients from right side */
.section-header--meshlist::after {
    background: linear-gradient(to left, rgba(82, 209, 160, 0.08) 0%, rgba(82, 209, 160, 0.02) 50%, transparent 100%);
}

.section-header--meshfeed::after {
    background: linear-gradient(to left, rgba(65, 159, 236, 0.08) 0%, rgba(65, 159, 236, 0.02) 50%, transparent 100%);
}

.section-header--meshads::after {
    background: linear-gradient(to left, rgba(255, 117, 71, 0.08) 0%, rgba(255, 117, 71, 0.02) 50%, transparent 100%);
}

.section-header--meshmedia::after {
    background: linear-gradient(to left, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.02) 50%, transparent 100%);
}

.section-header-text {
    max-width: 700px;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1f2937;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 12px;
}

/* Feature Toggle Cards */
.feature-toggle-card {
    position: relative;
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.feature-toggle-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 35%;
    pointer-events: none;
    z-index: 0;
}

.feature-toggle-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.feature-toggle-info {
    flex: 1;
    min-width: 0;
}

.feature-toggle-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.feature-toggle-title i {
    font-size: 16px;
    color: inherit;
}

.feature-toggle-title h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.feature-toggle-description {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.feature-toggle-switch {
    flex-shrink: 0;
}

/* Brand-specific gradients for feature toggle cards */
.feature-toggle-card--autolist::after {
    background: linear-gradient(to left, rgba(82, 209, 160, 0.12) 0%, rgba(82, 209, 160, 0.04) 50%, transparent 100%);
}

.feature-toggle-card--autolist .feature-toggle-title i {
    color: #10b981;
}

.feature-toggle-card--automedia::after {
    background: linear-gradient(to left, rgba(124, 58, 237, 0.12) 0%, rgba(124, 58, 237, 0.04) 50%, transparent 100%);
}

.feature-toggle-card--automedia .feature-toggle-title i {
    color: #7c3aed;
}

.feature-toggle-card--sync::after {
    background: linear-gradient(to left, rgba(65, 159, 236, 0.12) 0%, rgba(65, 159, 236, 0.04) 50%, transparent 100%);
}

.feature-toggle-card--sync .feature-toggle-title i {
    color: #3b82f6;
}

.feature-toggle-card--adrules::after {
    background: linear-gradient(to left, rgba(255, 117, 71, 0.12) 0%, rgba(255, 117, 71, 0.04) 50%, transparent 100%);
}

.feature-toggle-card--adrules .feature-toggle-title i {
    color: #f97316;
}

/* Hover effects */
.feature-toggle-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .feature-toggle-card {
        padding: 16px;
    }
    
    .feature-toggle-card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .feature-toggle-switch {
        align-self: stretch;
        display: flex;
        justify-content: flex-end;
    }
}

.section-header-art img {
    height: 48px;
    width: auto;
    display: block;
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.12));
}

.feature-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.feature-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px 18px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.feature-card::before {
    display: none;
}

.feature-card img {
    height: 32px;
    width: auto;
    margin-bottom: 14px;
}

.feature-card p {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
}

.feature-card .feature-link {
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.feature-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
    border-color: #d1d5db;
}

.chat-feature-cards {
    padding: 32px 24px;
    margin: 6px 0 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.chat-feature-cards .feature-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 0;
}

.chat-feature-cards .feature-card {
    padding: 28px 24px;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.25s ease;
}

.chat-feature-cards .feature-card::before {
    display: none;
}

.chat-feature-cards .feature-card:hover {
    transform: none;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.chat-feature-cards .feature-card img {
    height: 40px;
    width: auto;
    margin-bottom: 20px;
}

.chat-feature-cards .feature-card p {
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
    margin-bottom: 16px;
}

.chat-feature-cards .feature-link {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

/* Brand-specific hover colors for chat feature cards */
.chat-feature-cards .feature-card-meshlist:hover {
    border-color: rgba(82, 209, 160, 0.45);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.chat-feature-cards .feature-card-meshfeed:hover {
    border-color: rgba(65, 159, 236, 0.45);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.chat-feature-cards .feature-card-meshads:hover {
    border-color: rgba(255, 117, 71, 0.45);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.chat-feature-cards .feature-card-meshmedia:hover {
    border-color: rgba(124, 58, 237, 0.45);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
    .chat-feature-cards .feature-card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chat-feature-cards {
        padding: 16px;
    }
    
    .pricing-tiers.compact {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.feature-card:hover .feature-link {
    color: #1d4ed8;
}

@media (max-width: 1100px) {
    .feature-card-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 900px) {
    .section-header--visual {
        padding: 20px;
    }

    .section-header-logo img {
        height: 40px;
    }
    
    .section-header--visual p {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .feature-card-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header--visual {
        padding: 18px 16px;
    }
    
    .section-header-logo img {
        height: 36px;
    }
    
    #meshlistSection .mesh-mode-cards {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        border-radius: 12px 12px 0 0;
        -webkit-overflow-scrolling: touch;
        margin: 24px -12px 20px -12px;
    }
    
    #meshlistSection .mesh-mode-card {
        flex: 0 0 auto;
        min-width: 160px;
        padding: 18px 20px;
        border-bottom: 5px solid transparent;
        white-space: nowrap;
    }
    
    #meshlistSection .mesh-mode-card.active {
        border-bottom-color: #52d1a0;
        background: white;
    }
    
    #meshlistSection .mesh-mode-card:hover {
        border-bottom-color: rgba(82, 209, 160, 0.5);
    }
    
    #meshlistSection .mesh-card-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    #meshlistSection .mesh-card-content h3 {
        font-size: 15px;
    }
    
    #meshlistSection .mesh-card-content p {
        font-size: 13px;
    }
    
    .meshlist-tabs,
    .meshstore-tabs {
        flex-direction: column;
        gap: 10px;
    }
    
    .meshlist-tab,
    .meshstore-tab {
        width: 100%;
        padding: 14px 16px;
    }
    
    .tab-step-label {
        font-size: 14px;
    }
}

.section-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 400;
}

/* Model Selector */
.model-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.model-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
}

.model-button:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fafbff 0%, #f3f4f6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.model-button.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4338ca 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.model-button.active:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

/* Generation Container */
.generation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.input-section,
.output-section {
    background: #f8fafc;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-section:hover,
.output-section:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: rgba(79, 70, 229, 0.2);
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

/* Form Input - Standardized */
.prompt-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font-body);
    color: #111827;
    background: white;
    resize: vertical;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.prompt-input:hover {
    border-color: #d1d5db;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.image-settings,
.video-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

.setting-select {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font-body);
    color: #0f172a;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.setting-select:hover {
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Toggle Switch for Pro Mode */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    margin-top: 20px;
}

.toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ddd;
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-slider {
    background: var(--color-gradient);
}

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

.toggle-input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.generate-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 400px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    background: var(--color-gradient);
    color: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), 
                0 2px 4px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.generate-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5), 
                0 4px 8px rgba(102, 126, 234, 0.3);
}

.generate-button:hover::before {
    opacity: 1;
}

.generate-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.generate-button:disabled {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* File Input Styling */
.file-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.file-input:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.image-preview {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(135deg, #fafbff 0%, #f3f4f6 100%);
    text-align: center;
    transition: all 0.3s ease;
}

.image-preview:hover {
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Output Section */
.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--text-secondary);
    border: 2px dashed rgba(203, 213, 225, 0.6);
    border-radius: 16px;
    padding: 48px;
    background: linear-gradient(135deg, 
        rgba(249, 250, 251, 0.5) 0%, 
        rgba(243, 244, 246, 0.5) 100%);
    transition: all 0.3s ease;
}

.output-placeholder:hover {
    border-color: rgba(79, 70, 229, 0.3);
    background: linear-gradient(135deg, 
        rgba(249, 250, 251, 0.8) 0%, 
        rgba(243, 244, 246, 0.8) 100%);
}

.output-placeholder svg {
    margin-bottom: 20px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.output-placeholder:hover svg {
    opacity: 0.6;
    transform: scale(1.03);
}

.output-placeholder p {
    font-size: 15px;
    margin: 12px 0 0 0;
    font-weight: 500;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(229, 231, 235, 0.3);
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-purple);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modern pulse animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Shimmer effect for skeleton loaders */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loader {
    background: linear-gradient(
        90deg,
        #f0f0f0 0px,
        #f8f8f8 40px,
        #f0f0f0 80px
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
}

.generated-media {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--card-shadow);
}

.media-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-button {
    flex: 1;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.action-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.action-button:hover::after {
    width: 300px;
    height: 300px;
}

.action-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.15);
}

.action-button svg {
    flex-shrink: 0;
}

.action-button.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.action-button.primary::after {
    background: rgba(255, 255, 255, 0.2);
}

.action-button.primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #059669;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.action-button.secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--text-color);
}

.action-button.secondary:hover {
    border-color: #f093fb;
    color: #f093fb;
    background: rgba(240, 147, 251, 0.05);
}

.action-button.secondary.saved {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f5576c;
    color: white;
    animation: likePopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-button.secondary.saved:hover {
    background: linear-gradient(135deg, #e081ea 0%, #e4465b 100%);
    border-color: #e4465b;
}

@keyframes likePopIn {
    0% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

/* Library Section */
.library-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.library-tab {
    padding: 12px 28px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.library-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(79, 70, 229, 0.05) 100%);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.library-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.15);
}

.library-tab:hover::before {
    transform: translateY(0);
}

.library-tab.active {
    background: var(--color-gradient);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.library-tab.active::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    transform: translateY(0);
}

.library-tab.active:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.library-item {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.library-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.library-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 
                0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(79, 70, 229, 0.3);
}

.library-item:hover::before {
    opacity: 1;
}

.library-item-preview {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--sidebar-hover);
}

.library-item-info {
    padding: 16px;
}

.library-item-type {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.library-item-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .generation-container {
        grid-template-columns: 1fr;
    }
    
    .distribution-legend {
        grid-template-columns: 1fr;
    }
}

/* Medium screens - better button sizing */
@media (max-width: 1024px) {
    .products-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .products-header .btn-primary {
        flex: 1;
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    /* Mobile Menu Button */
    .mobile-menu-btn {
        display: flex;
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-menu-btn:active {
        transform: scale(0.95);
    }
    
    /* Sidebar */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed.open {
        transform: translateX(0);
        width: 280px;
    }
    
    .sidebar.collapsed .sidebar-logo {
        display: block !important;
        opacity: 1 !important;
        position: relative;
    }
    
    .sidebar.collapsed .sidebar-close-btn {
        display: none !important;
    }
    
    /* On mobile, collapsed state shows full menu (not icon-only) */
    .sidebar.collapsed .menu-section-label,
    .sidebar.collapsed .menu-divider,
    .sidebar.collapsed .sidebar-header-store,
    .sidebar.collapsed .sidebar-menu,
    .sidebar.collapsed .sidebar-footer,
    .sidebar.collapsed .sidebar-footer-card {
        display: block !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: auto !important;
        height: auto !important;
        clip: auto !important;
    }
    
    .sidebar.collapsed > *:not(.sidebar-header) {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: auto !important;
        height: auto !important;
        clip: auto !important;
    }
    
    /* On mobile, show full menu items with text */
    .sidebar.collapsed .menu-item {
        width: auto !important;
        height: auto !important;
        padding: 12px 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        font-size: 14px !important; /* Restore font-size for text on mobile */
    }
    
    .sidebar.collapsed .menu-item > * {
        display: block !important;
    }
    
    .sidebar.collapsed .menu-icon {
        margin-right: 0 !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    .sidebar.collapsed .menu-item img {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Submenu styles for mobile */
    .sidebar.collapsed .submenu {
        display: flex !important;
        max-height: 300px !important;
    }
    
    .sidebar.collapsed .submenu.open {
        display: flex !important;
    }
    
    .sidebar.collapsed .submenu-arrow {
        display: block !important;
    }
    
    .sidebar.collapsed .help-center-btn {
        display: flex !important;
    }
    
    .sidebar.collapsed .sidebar-header {
        padding: 20px;
        justify-content: center;
        position: relative;
    }
    
    .sidebar.collapsed .sidebar-close-btn svg {
        transform: none;
    }
    
    /* Mobile sidebar header - center logo and hide collapse button */
    .sidebar-header {
        justify-content: center !important;
        padding: 20px;
    }
    
    .sidebar-close-btn {
        display: none !important;
    }
    
    .sidebar-logo {
        display: block !important;
    }
    
    /* Sidebar Logo - smaller on mobile */
    .logo {
        width: 120px;
    }

    /* Main Content */
    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 80px; /* Space for mobile menu button */
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    /* Section Headers */
    .section-header h1 {
        font-size: 28px;
        letter-spacing: -0.02em;
    }
    
    .section-header p {
        font-size: 15px;
        line-height: 1.6;
    }

    /* Model Selector */
    .model-selector {
        flex-direction: column;
        gap: 12px;
    }
    
    .model-button {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        font-size: 16px;
    }

    /* Generation Settings */
    .image-settings,
    .video-settings {
        grid-template-columns: 1fr;
    }
    
    .toggle-label {
        margin-top: 12px;
    }

    /* Library Grid */
    .library-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .library-item {
        border-radius: 12px;
    }
    
    .library-item:hover {
        transform: translateY(-4px);
    }

    /* Templates - make grid single column on mobile */
    .prompt-library-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .template-card {
        padding: 16px;
    }
    
    .template-type {
        font-size: 15px;
    }
    
    .template-prompt {
        font-size: 13px;
    }

    /* Products */
    .products-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .products-header .btn-primary {
        max-width: 100% !important;
    }
    
    .product-row {
        flex-wrap: wrap;
        padding: 12px;
    }
    
    .product-image {
        width: 50px;
        height: 50px;
    }
    
    .product-info {
        flex: 1 1 calc(100% - 70px);
        min-width: 0;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-meta {
        font-size: 12px;
    }
    
    .product-price {
        flex: 1 0 100%;
        margin-top: 8px;
        margin-right: 0;
        text-align: left;
    }
    
    .product-expand-icon {
        position: absolute;
        top: 12px;
        right: 12px;
    }
    
    .product-details-grid {
        grid-template-columns: 1fr;
    }
    
    .product-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    /* Product Type Distribution */
    .product-type-distribution {
        padding: 16px;
    }
    
    .distribution-header h3 {
        font-size: 16px;
    }
    
    .distribution-bar-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .distribution-bar-name {
        font-size: 12px;
    }
    
    .distribution-bar-count {
        font-size: 11px;
    }
    
    .distribution-legend {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .distribution-legend-item {
        font-size: 12px;
    }

    /* Pagination */
    .pagination-controls {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pagination-info {
        flex: 1 0 100%;
        text-align: center;
        margin: 8px 0;
    }

    /* Integration Card */
    .integration-card {
        padding: 20px;
    }
    
    .integration-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .integration-branding {
        width: 100%;
    }
    
    .status-badge {
        align-self: flex-start;
    }
    
    .integration-form .generate-button {
        max-width: 100% !important;
    }
    
    /* Form inputs - prevent iOS zoom */
    .form-group input,
    .form-group textarea,
    .template-form-input,
    .template-form-textarea,
    .prompt-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea {
        font-size: 16px;
    }

    /* Output Section */
    .output-placeholder {
        min-height: 250px;
        padding: 20px;
    }
    
    .media-actions {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
    }

    /* Login Screen */
    .login-card {
        padding: 32px 24px;
        margin: 16px;
    }
    
    .login-logo {
        width: 150px;
    }
    
    .login-card h1 {
        font-size: 24px;
    }

    /* Sidebar Footer */
    .user-info {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    /* Credits Page */
    .credits-balance-card {
        padding: 28px 20px;
        max-width: 100%;
    }

    .balance-amount {
        font-size: 48px;
    }

    .pricing-tiers {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pricing-card {
        padding: 24px;
    }

    .pricing-amount {
        font-size: 48px;
    }

    .credits-info-section {
        padding: 24px 20px;
    }
    
    .billing-credits-header {
        padding: 12px 16px;
    }
    
    .billing-credits-header h3 {
        font-size: 14px;
    }
    
    .billing-credits-header p {
        font-size: 12px;
    }
    
    .billing-credits-balance {
        font-size: 12px;
    }
    
    .pricing-tiers.compact .pricing-card {
        padding: 16px;
    }
    
    .pricing-tiers.compact .pricing-amount {
        font-size: 28px;
    }

    .cost-row {
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Product Filtering & Generation */
    .products-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .product-type-filter {
        width: 100%;
        min-width: auto;
    }

    .generated-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .generated-modal-header {
        padding: 20px;
    }

    .generated-modal-body {
        padding: 20px;
    }

    .generated-images-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Remix Modal Mobile */
    .remix-modal-content {
        width: 95%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .remix-modal-header {
        padding: 20px;
    }

    .remix-modal-header h2 {
        font-size: 20px;
    }

    .remix-modal-body {
        padding: 20px;
    }

    .remix-prompt-input {
        font-size: 16px; /* Prevent iOS zoom */
    }

    .remix-actions {
        flex-direction: column;
    }

    .remix-cancel-btn,
    .remix-submit-btn {
        width: 100%;
    }

    /* Image Processing Modals Mobile */
    .image-processing-modal-content {
        width: 95%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .platform-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .platform-card {
        padding: 16px;
    }

    .platform-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .platform-name {
        font-size: 12px;
    }

    .platform-size {
        font-size: 10px;
    }

    .bg-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .generated-image-actions {
        gap: 6px;
    }

    .action-btn {
        padding: 6px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .main-content {
        padding: 16px 12px;
        padding-top: 65px;
    }
    
    /* Sidebar Logo - even smaller on very small screens */
    .logo {
        width: 100px;
    }
    
    .section-header h1 {
        font-size: 20px;
    }
    
    .generate-button {
        font-size: 15px;
        padding: 14px 20px;
    }
    
    .model-button {
        font-size: 15px;
        padding: 12px 16px;
    }
    
    .distribution-bar-container {
        margin-bottom: 14px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Credits Page */
    .credits-balance-card {
        padding: 24px 16px;
        max-width: 100%;
    }

    .balance-amount {
        font-size: 42px;
    }
    
    /* Product Cards */
    .product-card-simple {
        padding: 10px 12px;
    }
    
    .product-card-image {
        width: 50px;
        height: 50px;
    }
    
    .product-card-title {
        font-size: 14px;
    }
    
    .product-card-type {
        font-size: 12px;
    }
    
    /* Modal buttons */
    .generation-modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .generation-modal-actions button {
        width: 100%;
    }

    .balance-label,
    .balance-unit {
        font-size: 14px;
    }

    .pricing-amount {
        font-size: 40px;
    }

    .pricing-credits {
        font-size: 20px;
    }

    .pricing-features li {
        font-size: 14px;
        padding: 10px 0;
    }
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.4s ease;
}

/* Integration Card Styles */
.integration-card {
    background: #f8fafc;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--card-shadow);
    border: 1px solid var(--border-color);
    max-width: 800px;
}

.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.integration-branding {
    display: flex;
    align-items: center;
    gap: 16px;
}

.integration-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
}

.integration-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge:contains("Not Connected"), 
#shopifyStatusBadge {
    background: #fee;
    color: #c00;
}

.status-badge.connected {
    background: #e6f7ed;
    color: #0b7a3d;
}

.integration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input {
    margin-bottom: 0;
}

/* Products Section Styles */
.products-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.products-list {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.product-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.product-row:hover {
    background: #f9fbff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.product-row:last-child {
    margin-bottom: 0;
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.product-row:hover .product-image {
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
    transform: scale(1.03);
}

/* MeshStore product thumbnail (EXACT MESHMERCHANT) */
.product-thumbnail {
    width: 80px;
    height: 80px;
    margin-right: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.product-row:hover .product-thumbnail img {
    transform: scale(1.03);
}


.product-info {
    flex: 1;
    min-width: 0;
}

.product-info h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.product-info p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

.product-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #f0fdf4;
    color: #16a34a;
    text-transform: capitalize;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.product-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin-right: 20px;
}

.product-expand-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.product-row.expanded .product-expand-icon {
    transform: rotate(180deg);
}

.product-details {
    display: none;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fa;
}

.product-details.expanded {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

/* Details Container & Grid Layout */
.details-container {
    width: 100%;
}

.details-main {
    width: 100%;
}

.details-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.details-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-header h3 i {
    color: var(--primary-color);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.details-section {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.details-section.full-width {
    grid-column: 1 / -1;
}

.details-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.details-section h4 i {
    color: var(--primary-color);
    font-size: 13px;
}

/* Field Group Styling */
.details-field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details-field {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.details-field:last-child {
    border-bottom: none;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.field-value {
    font-size: 13px;
    color: #1f2937;
    word-break: break-word;
}

.field-value.status-badge-active {
    color: #10b981;
    font-weight: 500;
}

.field-value.status-badge-draft {
    color: #f59e0b;
    font-weight: 500;
}

.field-value .missing {
    color: #ef4444;
    font-style: italic;
}

.feed-label-badge {
    display: inline-block;
    background: var(--color-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Tags List */
.details-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-badge {
    display: inline-block;
    background: #eff6ff;
    color: #1e40af;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #dbeafe;
}

/* Description */
.details-description {
    font-size: 13px;
    line-height: 1.6;
    color: #4b5563;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

body.product-page-open {
    overflow: hidden;
}

.product-page-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    display: none;
    align-items: stretch;
    justify-content: center;
    z-index: 1200;
}

.product-page-overlay.active {
    display: flex;
}

.product-page-panel {
    background: #f8fafc;
    width: min(1120px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -24px 0 60px rgba(15, 23, 42, 0.18);
}

.product-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.product-page-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #1e293b;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-page-back:hover {
    background: #e2e8f0;
}

.product-page-header-title {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.product-page-content {
    padding: 24px;
    overflow-y: auto;
}

.product-page-inline {
    width: 100%;
    margin-top: 16px;
}

.product-page-inline .product-page-panel {
    width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.product-page-inline .product-page-header {
    border-radius: 14px 14px 0 0;
}

.product-page-inline .product-page-content {
    overflow: visible;
}

.product-page-hero {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.product-page-main-image {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.product-page-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-page-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.product-page-thumb {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background: white;
}

.product-page-thumb img {
    width: 100%;
    height: 64px;
    object-fit: cover;
    display: block;
}

.product-page-summary h2 {
    font-size: 22px;
    margin: 0 0 8px 0;
    color: #0f172a;
}

.product-page-summary p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.product-page-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
}

.product-page-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.product-page-price {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 12px;
}

.product-page-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.product-page-tag {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.product-page-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-page-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.product-page-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

.product-page-field {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #1e293b;
}

.product-page-field:last-child {
    border-bottom: none;
}

.product-page-field span:first-child {
    color: #64748b;
    font-weight: 600;
}

.product-page-description {
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
}

.product-page-description img {
    max-width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
    border-radius: 6px;
    margin: 6px 0;
}

.product-page-list {
    margin: 0;
    padding-left: 18px;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

.meshmedia-product-row {
    cursor: pointer;
}

.meshmedia-product-row td {
    transition: background 0.2s ease;
}

.meshmedia-product-row:hover td {
    background: #f9fbff;
}

@media (max-width: 900px) {
    .product-page-panel {
        width: 100%;
    }

    .product-page-content {
        padding: 18px;
    }

    .product-page-hero {
        grid-template-columns: 1fr;
    }

    .product-page-summary h2 {
        font-size: 20px;
    }
}

.details-description img {
    max-width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    border-radius: 4px;
    margin: 4px 0;
}

/* Variants List */
.variants-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    align-items: center;
}

.variant-title {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
}

.variant-price {
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
}

.variant-sku {
    font-size: 12px;
    color: #6b7280;
}

.variant-stock {
    font-size: 12px;
    color: #f59e0b;
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.image-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumb.more-images {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}

/* Highlights List */
.highlights-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.highlights-list li {
    padding: 10px 12px;
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #065f46;
}

.highlights-list li:last-child {
    margin-bottom: 0;
}

/* Shipping Info */
.shipping-info {
    padding: 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.6;
}

.product-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.product-detail-item {
    display: flex;
    flex-direction: column;
}

.product-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-detail-value {
    font-size: 14px;
    color: var(--text-color);
}

.product-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.product-detail-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 12px;
}

/* Product Type Distribution Styles */
.product-type-distribution {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

.distribution-header {
    margin-bottom: 20px;
}

.distribution-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
}

.distribution-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.distribution-chart {
    margin-bottom: 20px;
    min-height: 200px;
}

.distribution-bar-container {
    margin-bottom: 16px;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.distribution-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.distribution-bar-name {
    font-weight: 500;
    color: var(--text-color);
}

.distribution-bar-count {
    color: var(--text-secondary);
    font-size: 12px;
}

.distribution-bar-wrapper {
    width: 100%;
    height: 24px;
    background: var(--sidebar-hover);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.distribution-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #6366f1);
    border-radius: 6px;
    transition: width 0.6s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.distribution-bar-percentage {
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.distribution-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.distribution-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.distribution-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.distribution-legend-label {
    color: var(--text-color);
    font-weight: 500;
}

.distribution-legend-value {
    color: var(--text-secondary);
    margin-left: auto;
}

/* Prompt Library / Templates Styles */
.templates-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.template-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
    transition: all 0.2s ease;
}

.template-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.template-type {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.template-actions {
    display: flex;
    gap: 8px;
}

.template-action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    border-radius: 4px;
}

.template-action-btn:hover {
    background: var(--sidebar-hover);
    color: var(--primary-color);
}

.template-prompt {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 12px;
    padding: 12px;
    background: var(--sidebar-hover);
    border-radius: 6px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.template-prompt.empty {
    color: var(--text-secondary);
    font-style: italic;
}

.template-reference-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid var(--border-color);
}

.template-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 150px;
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.template-add-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.02);
}

/* Templates Container - Ensure sections stack vertically */
#templatesList {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

#templatesList > div {
    width: 100%;
    display: block;
}

/* Template Grid Responsive Layout */
@media (min-width: 1800px) {
    /* Extra large screens: 5 cards per row */
    #templatesList > div > div[style*="grid"] {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (min-width: 1400px) and (max-width: 1799px) {
    /* Large screens: 4 cards per row */
    #templatesList > div > div[style*="grid"] {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    /* Medium screens: 3 cards per row */
    #templatesList > div > div[style*="grid"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Small screens: 2 cards per row */
    #templatesList > div > div[style*="grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767px) {
    /* Mobile: 1 card per row */
    #templatesList > div > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}

/* Template Modal */
.template-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.template-modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.template-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.template-modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.template-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.template-modal-close:hover {
    background: var(--sidebar-hover);
    color: var(--text-color);
}

.template-form-group {
    margin-bottom: 20px;
}

.template-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.template-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--input-text);
    background: var(--input-bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.template-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--input-text);
    background: var(--input-bg);
    resize: vertical;
    transition: all 0.2s ease;
}

.template-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.template-image-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.template-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.template-save-btn,
.template-cancel-btn {
    flex: 0 0 auto;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-save-btn {
    background: var(--primary-color);
    border: none;
    color: white;
}

.template-save-btn:hover {
    background: #4338ca;
}

.template-cancel-btn {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.template-cancel-btn:hover {
    background: var(--sidebar-hover);
}

/* Remix Video Modal Styles */
.remix-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

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

.remix-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.remix-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
}

.remix-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.remix-modal-close:hover {
    background: var(--sidebar-hover);
    color: var(--text-color);
}

.remix-modal-body {
    padding: 24px;
}

.remix-description {
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    font-size: 15px;
}

.remix-prompt-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s ease;
}

.remix-prompt-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.remix-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.remix-info svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.remix-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.remix-cancel-btn,
.remix-submit-btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.remix-cancel-btn {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.remix-cancel-btn:hover {
    background: var(--sidebar-hover);
}

.remix-submit-btn {
    background: var(--primary-color);
    border: none;
    color: white;
}

.remix-submit-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.remix-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Image Processing Modal Styles */
.image-processing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.image-processing-modal.active {
    display: flex;
}

.image-processing-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.image-processing-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.image-processing-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
}

.image-processing-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.image-processing-modal-close:hover {
    background: var(--sidebar-hover);
    color: var(--text-color);
}

.image-processing-modal-body {
    padding: 24px;
}

.modal-description {
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    font-size: 15px;
}

/* Platform Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.platform-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.15);
}

.platform-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.platform-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    font-size: 14px;
}

.platform-size {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Background Removal Options */
.bg-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.bg-option-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bg-option-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.15);
}

.bg-option-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.bg-option-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 16px;
}

.bg-option-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Generated Image Actions */
.generated-image-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.action-btn {
    flex: 1;
    padding: 10px 12px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.action-btn svg {
    display: block;
}

.action-btn.save-btn:hover {
    border-color: #f093fb;
    color: #f093fb;
    background: rgba(240, 147, 251, 0.05);
}

.action-btn.save-btn.saved {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f5576c;
    color: white;
    animation: likePopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn.save-btn.saved:hover {
    background: linear-gradient(135deg, #e081ea 0%, #e4465b 100%);
    border-color: #e4465b;
}

.action-btn svg,
.action-button svg {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn.save-btn.saved svg,
.action-button.secondary.saved svg {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(0.9);
    }
    20%, 40%, 50%, 60%, 70% {
        transform: scale(1.1);
    }
    80% {
        transform: scale(1.03);
    }
}

.action-btn.download-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

/* Credits Page Styles */
.credits-badge {
    display: inline-block;
    margin-left: auto;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.credits-balance-card {
    background: linear-gradient(135deg, var(--primary-color)15 0%, var(--primary-purple)15 100%);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    margin: 0 auto 48px;
    max-width: 500px;
    color: var(--text-color);
}

.balance-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.balance-label {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.balance-amount {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-color);
}

.balance-unit {
    font-size: 18px;
    color: var(--text-secondary);
}

.pricing-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.pricing-tiers.compact {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 0;
}

.pricing-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.pricing-tiers.compact .pricing-card {
    padding: 18px 16px;
    border-width: 1px;
    border-radius: 12px;
}

.pricing-tiers.compact .pricing-badge {
    font-size: 10px;
    padding: 3px 10px;
}

.pricing-tiers.compact .pricing-amount {
    font-size: 32px;
    margin: 8px 0;
}

.pricing-tiers.compact .pricing-credits {
    font-size: 16px;
    margin-bottom: 6px;
}

.pricing-tiers.compact .pricing-per-credit {
    font-size: 11px;
    margin-bottom: 12px;
}

.pricing-tiers.compact .pricing-features {
    font-size: 11px;
    margin: 12px 0;
    padding-left: 0;
}

.pricing-tiers.compact .pricing-features li {
    margin: 4px 0;
    text-align: left;
}

.pricing-tiers.compact .pricing-button {
    padding: 10px 14px;
    font-size: 12px;
}

.billing-credits-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.billing-credits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.billing-credits-header:hover {
    background-color: #f9fafb;
}

.billing-credits-header-left {
    flex: 1;
}

.billing-credits-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.billing-credits-header p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.billing-credits-balance {
    font-size: 13px;
    color: #6366f1;
    font-weight: 600;
    margin-top: 4px;
}

.billing-credits-balance span {
    color: #111827;
}

.billing-credits-toggle {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, color 0.2s ease;
    border-radius: 8px;
}

.billing-credits-toggle:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.billing-credits-toggle.expanded {
    transform: rotate(180deg);
}

#creditsPricingTiers {
    padding: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inline-credits-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.inline-credits-info h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.inline-credits-info p {
    margin: 0;
    font-size: 12.5px;
    color: #6b7280;
}

.inline-credits-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-credits-actions .btn-secondary,
.inline-credits-actions .btn-primary {
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 999px;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.pricing-card.popular {
    border-color: var(--primary-color);
    border-width: 3px;
}

.pricing-badge {
    display: inline-block;
    background: var(--border-color);
    color: var(--text-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.pricing-badge.popular {
    background: var(--primary-color);
    color: white;
}

.pricing-amount {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-color);
    margin: 16px 0;
}

.pricing-credits {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.pricing-per-credit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
}

.pricing-features li {
    padding: 12px 0;
    color: var(--text-color);
    font-size: 15px;
    border-bottom: 1px solid var(--border-color);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-button {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pricing-button:hover {
    background: #4338ca;
    transform: scale(1.02);
}

.pricing-card.popular .pricing-button {
    background: var(--color-gradient);
}

.pricing-card.popular .pricing-button:hover {
    background: linear-gradient(135deg, #5569d4 0%, #65408a 100%);
}

.credits-info-section {
    background: white;
    border-radius: 12px;
    padding: 32px;
    border: 1px solid var(--border-color);
}

.credits-info-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 24px 0;
}

.cost-table {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    font-size: 15px;
}

.cost-row span:first-child {
    color: var(--text-color);
    font-weight: 500;
}

.cost-row span:last-child {
    color: var(--primary-color);
    font-weight: 600;
}

/* Product Filters & Bulk Generation */
.products-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px;
    color: #0f172a;
    background: transparent !important;
    transition: all 0.2s ease !important;
}

.search-input:hover {
    border-color: var(--primary-color) !important;
}

.search-input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
}

/* Search Filter Select */
.search-filter {
    padding: 10px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: #0f172a;
    background: transparent !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
}

.search-filter:hover {
    border-color: var(--primary-color) !important;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
}

.search-filter:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text-color);
}

.product-type-filter {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.product-type-filter:hover {
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.product-type-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.product-count {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.product-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.product-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.product-generate-btn svg {
    width: 16px;
    height: 16px;
}

/* ================================================
   PRODUCT CARDS (Single Column List Layout)
   ================================================ */

.products-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.product-card-simple {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    gap: 12px;
}

.product-card-simple:last-child {
    border-bottom: none;
}

.product-card-simple:hover {
    background: #f8fafc;
}

.product-card-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
}

.product-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.product-card-type {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.product-card-image-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.product-card-image-count svg {
    flex-shrink: 0;
}

.product-card-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.product-card-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.product-card-generate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--border-color);
}

.product-card-generate-btn svg {
    flex-shrink: 0;
}

/* Empty State in Products List */
.products-list .empty-state {
    padding: 60px 20px;
}

/* Preview Products Container (EXACT MESHMERCHANT) */
#csvDisplayPreview {
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

#csvDisplayPreview .product-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#csvDisplayPreview .product-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border-radius: 8px;
    margin-bottom: 4px;
}

#csvDisplayPreview .product-row:hover {
    background: #f9fbff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

#csvDisplayPreview .product-row:last-of-type {
    border-bottom: none;
}

#csvDisplayPreview .product-details {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: none;
}

#csvDisplayPreview .product-details.expanded {
    display: block;
}

#csvDisplayPreview .details-gmcfields {
    line-height: 1.8;
    color: #334155;
    font-size: 14px;
}

#csvDisplayPreview .details-gmcfields strong {
    color: #1e293b;
    font-weight: 600;
}

/* Image Selection Grid */
.image-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.image-selection-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.image-selection-item:hover {
    border-color: var(--primary-color);
    opacity: 0.9;
}

.image-selection-item.selected {
    border-color: var(--primary-color);
    border-width: 3px;
    box-shadow: 0 0 0 2px var(--primary-color), inset 0 0 10px rgba(0, 0, 0, 0.1);
    background: rgba(2, 132, 199, 0.05);
}

.image-selection-item.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.image-selection-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Responsive for Product Cards */
@media (max-width: 768px) {
    .product-card-simple {
        padding: 12px;
        flex-wrap: wrap;
    }
    
    .product-card-image {
        width: 60px;
        height: 60px;
    }
    
    .product-card-info {
        flex: 1;
        min-width: 150px;
    }
    
    .product-card-title {
        font-size: 14px;
    }
    
    .product-card-generate-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .image-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-image {
    width: 100%;
    height: 200px;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

/* Generated Images Modal */
.generated-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.generated-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.generated-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.generated-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
}

.generated-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
}

.generated-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.generated-modal-close:hover {
    background: var(--sidebar-hover);
    color: var(--text-color);
}

.generated-modal-body {
    padding: 32px;
    overflow-y: auto;
}

.generated-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.generated-image-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.generated-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.generated-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

.generated-image-wrapper.loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e8e8e8 20%,
        #e8e8e8 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
    position: relative;
    overflow: hidden;
}

.generated-image-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmerGloss 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes shimmerGloss {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.generated-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.generated-image-wrapper .error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #ef4444;
    text-align: center;
}

.generated-image-info {
    padding: 16px;
}

.generated-image-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Like Button for Product Generated Images */
.like-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.like-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.like-btn svg {
    width: 24px;
    height: 24px;
    stroke: #ef4444;
    fill: none;
    transition: all 0.3s ease;
}

.like-btn.liked svg,
.like-btn[data-liked="true"] svg {
    fill: #ef4444;
    stroke: #ef4444;
    animation: likeAnimation 0.6s ease;
}

@keyframes likeAnimation {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.like-btn:active {
    transform: scale(0.95);
}

/* ================================================
   INSUFFICIENT CREDITS MODAL
   ================================================ */

.credits-error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.credits-error-modal.active {
    display: flex !important;
}

.credits-error-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.credits-error-icon {
    margin-bottom: 24px;
}

.credits-error-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
}

.credits-error-message {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.credits-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.credits-error-btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credits-error-btn.secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.credits-error-btn.secondary:hover {
    background: #e5e7eb;
}

.credits-error-btn.primary {
    background: var(--color-gradient);
    color: white;
}

.credits-error-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.credits-error-btn svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .credits-error-content {
        padding: 32px 24px;
    }
    
    .credits-error-actions {
        flex-direction: column;
    }
    
    .credits-error-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================================================
   GENERATION MODALS (Product & Bulk)
   ================================================ */

.generation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    overflow-y: auto;
    padding: 40px 20px;
}

.generation-modal.active,
.generation-modal[style*="display: flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.generation-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.generation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
}

.generation-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.generation-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.generation-modal-close:hover {
    background: var(--button-hover);
    color: white;
}

.generation-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
}

/* Product Preview */
.product-gen-preview {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: var(--background-color);
    border-radius: 12px;
    margin-bottom: 24px;
}

.product-gen-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.product-gen-info {
    flex: 1;
}

.product-gen-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.product-gen-count {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Option Groups */
.generation-option-group {
    margin-bottom: 20px;
}

.generation-option-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 8px;
}

/* Radio Options */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Select & Textarea */
.generation-select {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: transparent;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.generation-select:hover {
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.generation-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.generation-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: transparent;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 100px;
}

.generation-textarea:hover {
    border-color: var(--primary-color);
}

.generation-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.generation-textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Input */
.generation-file-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.generation-file-input:hover {
    border-color: var(--primary-color);
}

/* Reference Preview */
.reference-preview {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.reference-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    background: var(--background-color);
}

/* Cost Info */
.generation-cost-info {
    background: linear-gradient(135deg, var(--primary-color)15 0%, var(--primary-purple)15 100%);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.generation-cost-info .cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    background: transparent;
}

.generation-cost-info .cost-row span {
    color: var(--text-secondary);
}

.generation-cost-info .cost-row strong {
    color: var(--text-color);
    font-size: 16px;
}

/* Progress */
.generation-progress {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-gradient);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .generation-modal {
        padding: 20px 10px;
    }
    
    .generation-modal-content {
        max-width: 100%;
        max-height: calc(100vh - 40px);
        border-radius: 12px;
    }
    
    .generation-modal-header,
    .generation-modal-body {
        padding: 20px 16px;
    }
    
    .generation-modal-header h2 {
        font-size: 20px;
    }
    
    .product-gen-preview {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }
    
    .product-gen-preview img {
        width: 80px;
        height: 80px;
    }
    
    .radio-group {
        gap: 12px;
    }
    
    .radio-option {
        padding: 14px 12px;
        font-size: 15px;
    }
    
    /* Prevent iOS zoom on inputs */
    .generation-select,
    .generation-textarea,
    .generation-file-input {
        font-size: 16px;
    }
    
    .generation-textarea {
        min-height: 120px;
    }
    
    .generation-cost-info {
        padding: 14px;
    }
    
    .cost-row {
        padding: 10px 0;
        font-size: 15px;
    }
    
    .cost-row strong {
        font-size: 17px;
    }
    
    .generate-button {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .image-selection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}


/* ===================================
   MESHMERCHANT INTEGRATION STYLES
   ================================= */

/* Project/Store Selector */
.sidebar-header-store {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.menu-item-store {
    width: 100%;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #6366f1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease, color 0.2s ease;
}

.store-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.store-dropdown-open .store-chevron {
    transform: rotate(180deg);
}


.store-dropdown {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 8px;
}

.store-dropdown-search {
    position: sticky;
    top: 0;
    background: white;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    z-index: 1;
}

.store-dropdown-search .search-input {
    font-size: 13px;
    padding: 8px 36px 8px 12px;
}

.store-dropdown-search .clear-search-btn {
    right: 12px;
}

.store-dropdown-list {
    padding-bottom: 4px;
}

.store-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.store-dropdown.hidden {
    display: none;
}

.store-dropdown-project-header {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.store-dropdown-project-header:hover {
    background: #f3f4f6;
}


.store-dropdown-stores {
    border-bottom: 1px solid var(--border-color);
}

.store-dropdown-option {
    width: 100%;
    padding: 10px 16px 10px 36px;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s;
    text-align: left;
}

.store-dropdown-option:hover {
    background: var(--sidebar-hover);
    color: var(--primary-color);
}

/* Menu Section Labels */
.menu-section-label {
    padding: 20px 16px 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

.menu-section-label:first-of-type {
    border-top: none;
    margin-top: 0;
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 16px;
}

/* Expandable Menu Items with Submenu */
.menu-item-expandable {
    position: relative;
}

/* When expanded (submenu open) - don't show as active unless actually on that page */
.menu-item-expandable.expanded {
    /* No background - only active class gives background */
}

.menu-item-expandable.expanded::before {
    /* No indicator bar when just expanded */
}

.menu-item-text {
    flex: 1;
}

/* Submenu arrow styles */

.submenu-arrow {
    font-size: 11px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    margin-left: auto;
    opacity: 0.7;
}

.menu-item-expandable:hover .submenu-arrow {
    opacity: 1;
    color: var(--primary-color);
}

.menu-item-expandable.expanded .submenu-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
    opacity: 1;
}

.submenu {
    display: none;
    flex-direction: column;
    background: transparent;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.submenu.open {
    display: flex;
    max-height: 300px;
    opacity: 1;
    padding-left: 12px;
    margin-bottom: 12px;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    margin: 0;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 13.5px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, padding 0.2s ease;
    border-radius: 8px;
    position: relative;
}

.submenu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
    transition: height 0.2s ease;
}

.submenu-icon {
    font-size: 14px;
    width: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.submenu-item:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
    padding-left: 18px;
}

.submenu-item:hover::before {
    height: 60%;
}

.submenu-item:hover .submenu-icon {
    transform: translateX(2px);
}

.submenu-item.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.14) 0%, rgba(79, 70, 229, 0.08) 100%);
    color: var(--primary-color);
    font-weight: 600;
    padding-left: 18px;
}

.submenu-item.active::before {
    height: 70%;
}

.submenu-item.active .submenu-icon {
    color: var(--primary-color);
}

/* Hide submenu in collapsed sidebar (but keep visible during collapsing animation) */
.sidebar.collapsed:not(.collapsing) .submenu {
    display: none !important;
}

.sidebar.collapsed:not(.collapsing) .submenu-arrow {
    display: none;
}

/* ===================================
   MESHLIST & MESHFEED STYLES
   ================================= */

/* MeshList Import Grid */
.meshlist-import-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

/* MeshList Import Card */
.meshlist-import-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 24px;
    transition: border-color 0.2s ease;
}

.meshlist-import-card:hover {
    border-color: #d1d5db;
}

.meshlist-import-card .form-group {
    margin-bottom: 0;
}

.meshlist-import-card .input-label {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
    display: block;
}

.meshlist-import-card .input-label i {
    margin-right: 8px;
    color: #52d1a0;
}

.meshlist-import-card .prompt-input {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #0f172a;
}

.meshlist-import-card .prompt-input:hover {
    border-color: var(--primary-color);
}

.meshlist-import-card .prompt-input:focus {
    border-color: var(--primary-color);
}

.meshlist-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.products-selection {
    display: flex;
    align-items: center;
    gap: 16px;
}

.products-actions {
    display: flex;
    gap: 12px;
}

/* Products Grid (for card-based layouts) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* MeshStore Products List (row-based, EXACT MESHMERCHANT) */
#meshstoreProductsGrid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 32px;
}

#meshstoreProductsGrid.meshstore-hidden {
    display: none !important;
}

#meshstoreProductsGrid-pagination.meshstore-hidden {
    display: none !important;
}

/* MeshList Products List (row-based, EXACT MESHMERCHANT) */
#meshlistProductsGrid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 32px;
}

#meshlistProductsGrid .product-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border-radius: 8px;
    margin-bottom: 4px;
}

#meshlistProductsGrid .product-row:hover {
    background: #f8fafc;
    border-left: 3px solid var(--primary-color);
    padding-left: 17px;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.1);
    transform: translateX(2px);
}

#meshlistProductsGrid .product-row:last-of-type {
    border-bottom: none;
}

#meshlistProductsGrid .product-details {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: none;
    margin-top: -4px;
}

#meshlistProductsGrid .product-details.expanded {
    display: block;
}

#meshstoreProductsGrid .product-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border-radius: 8px;
    margin-bottom: 4px;
}

#meshstoreProductsGrid .product-row:hover {
    background: #f9fbff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

#meshstoreProductsGrid .product-row:last-of-type {
    border-bottom: none;
}

#meshstoreProductsGrid .product-details {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: none;
    margin-top: -4px;
}

#meshstoreProductsGrid .product-details.expanded {
    display: block;
}

/* Modal Overlay (EXACT MESHMERCHANT) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    width: 100%;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: #f1f5f9;
}

/* NOTE: btn-secondary is defined in the main Button Styles section */

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid #f1f5f9;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.12), 0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: #e0e7ff;
}

.product-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.product-card-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.product-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.03);
}

.product-card-content {
    padding: 18px;
}

.product-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-top: 8px;
}

.product-card-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
}

.product-card-vendor {
    color: #64748b;
    font-size: 13px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
}

.product-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

/* MeshFeed Controls */
.meshfeed-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.meshfeed-controls-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.product-count-text {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.meshfeed-controls-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Action button styling - pill-shaped like "View Plans" / mode-btn */
#meshadsLoadCampaignsBtn,
#applyRulesBtn,
#applyAdRulesBtn,
#loadProductsBtn,
#syncToGmcBtn,
#syncFromSummaryBtn,
#importProductsBtn,
#bulkGenerateBtn,
#importFromUrlBtn,
#meshlistGenerateImagesBtn,
#publishProductsBtn,
#loadStoreProductsBtn,
#meshstoreGenerateImagesBtn,
#updateProductsBtn,
#onboardingNext,
#onboardingFinish,
.help-next-btn,
[id*="LoadCampaigns"],
[id*="ApplyRules"],
[id*="SaveSettings"],
button[onclick*="connectShopify"],
button[onclick*="connectMerchantCenter"],
button[onclick*="connectGA4"],
button[onclick*="connectGoogleAds"],
button[onclick*="openCreateProjectModal"] {
    appearance: none !important;
    background: white !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 999px !important;
    padding: 10px 16px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

#meshadsLoadCampaignsBtn:hover,
#applyRulesBtn:hover,
#applyAdRulesBtn:hover,
#loadProductsBtn:hover,
#syncToGmcBtn:hover,
#syncFromSummaryBtn:hover,
#importProductsBtn:hover,
#bulkGenerateBtn:hover,
#importFromUrlBtn:hover,
#meshlistGenerateImagesBtn:hover,
#publishProductsBtn:hover,
#loadStoreProductsBtn:hover,
#meshstoreGenerateImagesBtn:hover,
#updateProductsBtn:hover,
#onboardingNext:hover,
#onboardingFinish:hover,
.help-next-btn:hover,
[id*="LoadCampaigns"]:hover,
[id*="ApplyRules"]:hover,
[id*="SaveSettings"]:hover,
button[onclick*="connectShopify"]:hover,
button[onclick*="connectMerchantCenter"]:hover,
button[onclick*="connectGA4"]:hover,
button[onclick*="connectGoogleAds"]:hover,
button[onclick*="openCreateProjectModal"]:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
}

.toggle-switch-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 8px;
}

/* Remove background for toggle switches inside feature cards */
.feature-toggle-card .toggle-switch-inline {
    background: transparent;
    padding: 0;
    gap: 0;
}

.toggle-switch-inline input {
    display: none;
}

.toggle-slider-small {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 20px;
    transition: background 0.3s;
    cursor: pointer;
    border: 1px solid #d1d5db;
}

/* Transparent background for toggle sliders inside feature cards */
.feature-toggle-card .toggle-slider-small {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(209, 213, 219, 0.5);
}

.toggle-switch-inline input:checked + .toggle-slider-small {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.feature-toggle-card .toggle-switch-inline input:checked + .toggle-slider-small {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-slider-small:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch-inline input:checked + .toggle-slider-small:before {
    transform: translateX(20px);
}

.toggle-label-text {
    cursor: pointer;
    user-select: none;
}

/* Rule Tester - Clean Modern Card Style */
.meshfeed-rule-tester {
    margin-top: 24px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.meshfeed-rule-tester-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.meshfeed-rule-tester-header i {
    font-size: 18px;
    color: #8b5cf6;
    flex-shrink: 0;
}

.meshfeed-rule-tester-header > div {
    flex: 1;
}

.meshfeed-rule-tester-header strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.meshfeed-rule-tester-subtitle {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

.meshfeed-rule-tester-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 20px;
}

.rule-test-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
}

.meshfeed-rule-tester-controls .prompt-input {
    margin-bottom: 0;
}

.rule-test-results {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 6px;
}

.rule-test-result {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
}

.rule-test-result:hover {
    background: #f1f5f9;
}

.rule-test-result.active {
    background: #e2e8f0;
}

.rule-test-title {
    font-weight: 500;
}

.rule-test-id {
    font-size: 11px;
    color: #64748b;
}

.rule-test-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: #94a3b8;
}

@media (max-width: 720px) {
    .meshfeed-rule-tester-controls {
        grid-template-columns: 1fr;
    }
}

.meshfeed-rule-tester-meta {
    padding: 0 20px;
    margin-top: -8px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #6b7280;
}

.meshfeed-rule-tester-output {
    font-size: 13px;
    color: #374151;
    max-height: 300px;
    overflow: auto;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    margin: 0;
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
    line-height: 1.6;
}

/* MeshFeed Defaults Toggle */
.meshfeed-defaults-toggle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.meshfeed-defaults-toggle .modern-checkbox {
    padding: 10px 16px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.meshfeed-defaults-toggle .modern-checkbox:hover {
    border-color: var(--primary-color);
}

/* Shipping rows alignment */
.shipping-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.shipping-option label {
    display: flex;
    align-items: center;
    line-height: 1;
}

.shipping-option .modern-select,
.shipping-option .prompt-input {
    margin: 0;
}

.shipping-option .removeShippingRow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 10px 16px;
}

/* MeshFeed Content Layout */
.meshfeed-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    align-items: start;
}

.meshfeed-products-panel,
.meshfeed-rules-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.panel-header {
    padding: 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.table-container {
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.products-table thead {
    background: #f8fafc;
}

.products-table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.products-table th:nth-child(1) {
    width: 50px;
    text-align: center;
    padding: 8px;
}

.products-table th:nth-child(2) {
    width: 80px;
}

.products-table th:nth-child(3) {
    min-width: 200px;
}

.products-table th:nth-child(4) {
    width: 120px;
}

.products-table th:nth-child(5) {
    width: 150px;
}

.products-table th:nth-child(6) {
    width: 200px;
}

.products-table td {
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
    color: #475569;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Products section (media generation) table - 5 columns */
#productsTable {
    table-layout: fixed;
}

#productsTable th:nth-child(1) {
    width: 80px;
}

#productsTable th:nth-child(2) {
    min-width: 250px;
}

#productsTable th:nth-child(3) {
    width: 200px;
}

#productsTable th:nth-child(4) {
    width: 100px;
    text-align: center;
}

#productsTable th:nth-child(5) {
    width: 140px;
    text-align: center;
}

#productsTable td:nth-child(1) {
    width: 80px;
    padding: 12px 8px;
}

#productsTable td:nth-child(1) img {
    width: 50px !important;
    height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
}

#productsTable td:nth-child(1) div {
    width: 50px !important;
    height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    flex-shrink: 0;
}

#productsTable td:nth-child(2) {
    min-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Product Images table - OVERRIDE generic .products-table styles */
#productsTable th:nth-child(1),
#productsTable td:nth-child(1) {
    width: 80px;
    text-align: center;
    padding: 12px 16px;
}

#productsTable th:nth-child(2),
#productsTable td:nth-child(2) {
    min-width: 250px;
    text-align: left;
}

/* MeshFeed products - use same row layout as MeshList/MeshStore */
#meshfeedProductsTableBody {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#meshfeedProductsTableBody .product-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border-radius: 8px;
    margin-bottom: 4px;
}

#meshfeedProductsTableBody .product-row:hover {
    background: #f9fbff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

#meshfeedProductsTableBody .product-row:last-of-type {
    border-bottom: none;
}

#meshfeedProductsTableBody .empty-message-box {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

#productsTable td:nth-child(3) {
    width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#productsTable td:nth-child(4),
#productsTable td:nth-child(5) {
    text-align: center;
}

#productsTable td:nth-child(4) {
    width: 100px;
}

#productsTable td:nth-child(5) {
    width: 140px;
}

.products-table td:nth-child(1) {
    width: 50px;
    text-align: center;
    padding: 8px;
}

.products-table td:nth-child(2) {
    width: 80px;
}

.products-table td:nth-child(3) {
    min-width: 200px;
}

.products-table td:nth-child(4) {
    width: 120px;
}

.products-table td:nth-child(5) {
    width: 150px;
}

.products-table td:nth-child(6) {
    width: 200px;
}

.products-table td img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.products-table tbody tr:hover {
    background: #f8fafc;
}

.empty-message {
    text-align: center;
    color: #94a3b8;
    padding: 48px 16px !important;
}

/* Rules List */
.rules-list {
    padding: 0;
    max-height: 600px;
    overflow-y: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-list::-webkit-scrollbar {
    width: 8px;
}

.rules-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.rules-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.rules-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== RESPONSIVE RULES ==================== */
/* NOTE: Rules now use modern-settings-card which has built-in responsive design */

/* Rule Card - Individual rules in sidebar */
.rule-card {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}

.rule-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(18, 158, 217, 0.1);
}

.rule-card.active {
    border-color: var(--primary-color);
    background: rgba(18, 158, 217, 0.03);
}

.rule-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
    .rule-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .rule-card:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 640px) {
    .rule-card {
        padding: 14px;
        margin-bottom: 10px;
        border-radius: 12px;
    }
}

.rule-card.disabled {
    opacity: 0.6;
}

.rule-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.rule-card-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .rule-card-header {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .rule-card-title {
        font-size: 15px;
    }
}

@media (max-width: 640px) {
    .rule-card-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
}

.rule-card-meta {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-card-meta i {
    color: #94a3b8;
}

.rule-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.rule-card-actions button {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.rule-card-actions button:hover {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.btn-danger {
    background: #ffffff;
    border-color: #fecaca;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

.btn-danger.small,
.btn-small.btn-danger {
    padding: 6px 12px;
    font-size: 12px;
}

.rule-card-content {
    background: #f8fafc;
    padding: 14px;
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

.rule-action-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    font-size: 12px;
}

.rule-action-tag--danger {
    border-color: #fecaca;
    color: #ef4444;
}

.affected-modal {
    background: white;
    border-radius: 14px;
    width: min(900px, 92vw);
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.affected-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.affected-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.affected-modal-subtitle {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 13px;
}

.affected-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.affected-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.affected-modal-summary {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.affected-modal-summary strong {
    color: #0f172a;
}

.affected-search {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.affected-search input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.affected-products-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.affected-product-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.affected-product-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.affected-product-header img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.affected-product-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
}

.affected-product-meta {
    font-size: 12px;
    color: #64748b;
}

.affected-product-status {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
}

.affected-product-status--excluded {
    border-color: #fecaca;
    color: #ef4444;
    background: #fee2e2;
}

.affected-product-status--modified {
    border-color: #bbf7d0;
    color: #16a34a;
    background: #dcfce7;
}

.affected-product-body {
    padding: 14px;
}

.affected-change-card {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 10px;
}

.affected-change-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

.affected-change-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
}

.affected-change-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

.affected-change-value {
    padding: 6px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    word-break: break-word;
}

.affected-empty {
    text-align: center;
    color: #94a3b8;
    padding: 24px 12px;
    font-size: 14px;
}

@media (max-width: 720px) {
    .affected-modal {
        width: 94vw;
    }

    .affected-change-grid {
        grid-template-columns: 1fr;
    }
}

.rule-action-text {
    color: #475569;
    font-weight: 600;
    margin-right: 6px;
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rule-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.rule-description {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.5;
}

.rule-description strong {
    color: #475569;
}

.rule-description em {
    color: #0f172a;
    font-style: normal;
    font-weight: 600;
}

.no-rules {
    text-align: center;
    padding: 32px 16px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.no-rules i {
    font-size: 24px;
    color: #cbd5e1;
}

.no-rules p {
    margin: 0;
    font-size: 13px;
}

.no-rules p:first-of-type {
    font-weight: 500;
    color: #64748b;
}

/* Rules Info Card - using standard info-card styles */
.rules-templates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rules-templates-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-templates-subtitle {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #64748b;
}

.rules-templates-toggle {
    padding: 6px 12px;
    font-size: 12px;
}

.rule-templates-section--gradient {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Billing Section */
/* Removed old billing-current-plan styles - see updated version below */

.feature-selector {
    margin-bottom: 32px;
}

.feature-selector h3 {
    margin: 0 0 16px;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.feature-card {
    padding: 24px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.feature-card.active {
    border-color: #cbd5e1;
    border-width: 2px;
}

.feature-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.feature-card h4 {
    margin: 0 0 8px;
    font-size: 18px;
}

.feature-card p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* Billing Cards (MeshMerchant style with Media Studio colors) */
.billing-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    position: relative;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 280px;
    margin: 0;
    vertical-align: top;
}

.billing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.billing-card[data-tag]::before {
    content: attr(data-tag);
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--color-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.billing-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.billing-card p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 16px;
}

.billing-card h4 {
    font-size: 36px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}

.billing-card ul {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.billing-card ul li {
    padding: 10px 0;
    color: #374151;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.billing-card ul li i {
    color: #10b981;
    font-size: 16px;
}

.billing-card ul li.not-included i {
    color: #ef4444;
}

.billing-card ul li.meshfeed-bonus-feature i,
.billing-card ul li.autolist-feature i,
.billing-card ul li.ugc-video-feature i,
.billing-card ul li.competitor-tracking-feature i {
    color: #667eea;
}

.billing-card-price-per-product {
    color: #6b7280;
    font-size: 13px;
    margin-top: 8px;
}

.billing-content.hidden {
    display: none;
}

/* Feed Settings Card - Clean Modern Style */
.feed-settings-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.feed-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.feed-settings-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.feed-settings-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.feed-settings-grid {
    display: grid;
    gap: 0;
    padding: 24px;
}

.feed-settings-section {
    border-bottom: 1px solid #f1f5f9;
    padding: 0 0 24px 0;
    margin-bottom: 24px;
    background: transparent;
}

.feed-settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.feed-settings-section h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.feed-settings-section > p {
    margin: 8px 0 16px 0;
    color: #6b7280;
    font-size: 13px;
}

/* Style checkboxes in feed-settings-section like AI Metafields */
.feed-settings-section .modern-checkbox {
    padding: 10px 16px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.feed-settings-section .modern-checkbox:hover {
    border-color: var(--primary-color);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.settings-grid.two-col {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.translations-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.translations-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.translations-card h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #0f172a;
}

.translation-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.translation-fields-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.collection-loader .collection-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.collection-status {
    margin-top: 10px;
    font-size: 13px;
}

.translation-product-count {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 10px;
}

.translations-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.translation-progress {
    flex: 1;
    min-width: 240px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.helper-text {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 8px;
}

/* Tier Cards */
.tier-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.tier-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.tier-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.15);
    transform: translateY(-4px);
}

.tier-card.featured {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.15);
}

.tier-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tier-card h4 {
    margin: 0 0 16px;
    font-size: 22px;
}

.tier-price {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 24px;
}

.tier-price span {
    font-size: 16px;
    color: #64748b;
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    text-align: left;
}

.tier-features li {
    padding: 12px 0;
    font-size: 14px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tier-features i {
    color: #10b981;
}

.tier-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tier-btn:hover {
    background: #4338ca;
}

.tier-btn.plan-owned {
    background: #10b981;
    cursor: not-allowed;
}

/* Discount Section */
.discount-section {
    margin: 24px auto;
    padding: 24px;
    background: #f8fafb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e6f0;
    max-width: 600px;
}

.discount-input-group {
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.discount-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

/* Invoice Section */
.invoice-section {
    margin-top: 32px;
}

.invoices-list {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Connection Cards */
/* Connections Grid Layout (2x2 on desktop) */
.connections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
}

@media (min-width: 1024px) {
    .connections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.connection-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.connection-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .connection-card {
        padding: 20px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .connection-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .connection-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .connection-description {
        font-size: 13px;
    }
}

/* Help Section Styles */
#shopifyHelpContent {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.help-subsection {
    animation: slideDown 0.3s ease-out;
}

#shopifyHelpIcon,
.help-subsection i[class*="chevron"] {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.connection-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.connection-icon {
    width: 48px;
    height: 48px;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.connection-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.connection-info {
    flex: 1;
}

.connection-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.connection-features {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.feature-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-badge-optional {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.connection-description {
    color: #64748b;
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Connection Help Box */
.connection-help-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #e0f2fe;
    cursor: pointer;
    transition: background 0.2s ease;
}

.help-header:hover {
    background: #bae6fd;
}

.help-header span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
}

.help-header i.fa-chevron-down {
    transition: transform 0.3s ease;
    color: #0369a1;
}

.help-header.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.help-content {
    padding: 16px;
    background: white;
    animation: slideDown 0.3s ease-out;
}

.help-content ol {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    font-size: 13px;
    line-height: 1.8;
}

.help-content ol li {
    margin-bottom: 8px;
}

.help-content a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
}

.help-content a:hover {
    text-decoration: underline;
}

.help-content code {
    background: #f0f9ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    color: #0369a1;
}

.help-content p {
    margin: 0;
    line-height: 1.8;
}

.meshfeed-mode-toggle {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.mode-buttons {
    display: flex;
    gap: 8px;
}

.mode-btn {
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: var(--color-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.mode-description {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    flex: 1 1 240px;
}

.meshfeed-tabs.hidden {
    display: none;
}

.meshfeed-step {
    display: none !important;
}

.meshfeed-step.active {
    display: block !important;
}

.meshfeed-step.hidden {
    display: none !important;
}

/* MeshList Tabs - Flow Steps Style */
.meshlist-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0;
    max-width: none;
    position: relative;
}

.meshlist-tab {
    flex: 1;
    border: none;
    background: #f8fafc;
    padding: 16px 20px;
    font-weight: 600;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Connector line between tabs */
.meshlist-tab::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.meshlist-tab:last-child::after {
    display: none;
}

/* Completed steps (before active) - lighter green borders and line */
.meshlist-tab.completed {
    border-color: rgba(82, 209, 160, 0.5);
}

.meshlist-tab.completed .tab-step-number {
    background: rgba(82, 209, 160, 0.15);
    color: #52d1a0;
}

.meshlist-tab.completed::after {
    background: rgba(82, 209, 160, 0.5);
}

.tab-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tab-step-label {
    font-size: 14px;
    line-height: 1.3;
}

.meshlist-tab:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #52d1a0;
}

.meshlist-tab:hover .tab-step-number {
    background: #e2e8f0;
    color: #52d1a0;
}

.meshlist-tab.active {
    background: transparent;
    border-color: #52d1a0;
    color: #111827;
}

.meshlist-tab.active .tab-step-number {
    background: #52d1a0;
    color: white;
}

/* MeshList Step Visibility - Ensure only active step shows */
.meshlist-step {
    display: none !important;
}

.meshlist-step.active {
    display: block !important;
}

/* Hide all step-nav buttons by default unless parent step is active */
.meshlist-step .step-nav {
    display: none !important;
}

.meshlist-step.active .step-nav {
    display: flex !important;
    justify-content: flex-end;
    margin-top: 20px;
}

.meshlist-step.hidden {
    display: none !important;
}

.meshlist-step.hidden .step-nav {
    display: none !important;
}

.meshstore-step .step-nav {
    display: none !important;
}

.meshstore-step.active .step-nav {
    display: flex !important;
    justify-content: flex-end;
    margin-top: 20px;
}

.meshstore-step.hidden .step-nav {
    display: none !important;
}

.meshfeed-step .step-nav {
    display: none !important;
}

.meshfeed-step.active .step-nav {
    display: flex !important;
    justify-content: flex-end;
    margin-top: 20px;
}

.meshfeed-step.hidden .step-nav {
    display: none !important;
}

/* MeshStore Tabs - Flow Steps Style (same as MeshList) */
.meshstore-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0;
    max-width: none;
    position: relative;
}

.meshstore-tab {
    flex: 1;
    border: none;
    background: #f8fafc;
    padding: 16px 20px;
    font-weight: 600;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Connector line between tabs */
.meshstore-tab::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.meshstore-tab:last-child::after {
    display: none;
}

/* Completed steps (before active) - lighter green borders and line */
.meshstore-tab.completed {
    border-color: rgba(82, 209, 160, 0.5);
}

.meshstore-tab.completed .tab-step-number {
    background: rgba(82, 209, 160, 0.15);
    color: #52d1a0;
}

.meshstore-tab.completed::after {
    background: rgba(82, 209, 160, 0.5);
}

.meshstore-tab:hover {
    background: rgba(82, 209, 160, 0.05);
    border-color: rgba(82, 209, 160, 0.3);
    color: #52d1a0;
}

.meshstore-tab:hover .tab-step-number {
    background: rgba(82, 209, 160, 0.2);
    color: #52d1a0;
}

.meshstore-tab.active {
    background: rgba(82, 209, 160, 0.1);
    border-color: #52d1a0;
    color: #111827;
}

.meshstore-tab.active .tab-step-number {
    background: #52d1a0;
    color: white;
}

.meshstore-step {
    display: none !important;
}

.meshstore-step.active {
    display: block !important;
}

.meshstore-step.hidden {
    display: none !important;
}

/* MeshStore empty states should not look disabled */
.meshstore-step .empty-state {
    background: transparent;
    border: 1px dashed #e2e8f0;
}

.meshstore-step .empty-state i {
    opacity: 1;
}

.meshstore-step .empty-state p {
    color: #475569;
}

/* NOTE: .step-nav display is controlled by meshlist-step/meshstore-step/meshfeed-step rules above */

.step-next-btn {
    background: none !important;
    border: none !important;
    padding: 8px 0 !important;
    min-width: auto;
    font-size: 14px;
    font-weight: 500;
    color: #6366f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: none !important;
}

.step-next-btn:hover {
    color: #6366f1;
    gap: 10px;
    opacity: 0.8;
}

.step-next-btn i {
    font-size: 16px;
}

.step-next-btn::after {
    content: ' →';
    margin-left: 4px;
}

/* Publish Summary Card */
.publish-summary-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.publish-summary-card h3 {
    margin-bottom: 16px;
    color: #1e293b;
}

.publish-summary-card > div {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.publish-summary-card > div:last-of-type {
    border-bottom: none;
}

/* ==================== RULES SECTION LAYOUT ==================== */
/* NOTE: Rules now use modern-settings-card structure */

.rule-editor-panel {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.rule-builder-card,
.rules-sidebar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.rule-builder-card {
    flex: 1 1 0;
    min-width: 320px;
}

.rules-sidebar {
    flex: 0 0 320px;
    min-width: 260px;
}

.rule-builder-card .rule-builder-body {
    padding: 16px 20px;
}

.rules-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.rules-sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.rules-sidebar .rules-list {
    padding: 16px 20px;
}

.meshfeed-rule-editor.is-single .rules-sidebar,
.meshads-rule-editor.is-single .rules-sidebar {
    flex: 1 1 100%;
    min-width: 0;
}

@media (max-width: 960px) {
    .rule-editor-panel {
        flex-direction: column;
    }

    .rule-builder-card,
    .rules-sidebar {
        width: 100%;
        min-width: 0;
    }
}

/* MeshFeed Cards - Clean Professional Style */
.meshfeed-preview-card,
.meshfeed-sync-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.meshfeed-preview-card:hover,
.meshfeed-sync-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Card header styling */
.rule-builder-card .rule-builder-header {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

/* Preview and sync card internal padding */
.meshfeed-preview-card > *,
.meshfeed-sync-card > * {
    padding-left: 24px;
    padding-right: 24px;
}

.meshfeed-preview-card > *:first-child,
.meshfeed-sync-card > *:first-child {
    padding-top: 20px;
}

.meshfeed-preview-card > *:last-child,
.meshfeed-sync-card > *:last-child {
    padding-bottom: 20px;
}

/* NOTE: Rules now use modern-settings-card structure - old rules-sidebar and rule-editor-section styles removed */

.meshfeed-sync-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.rule-builder-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.preview-toolbar .preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-output {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    max-height: 420px;
    overflow: auto;
    margin-top: 16px;
}

.meshfeed-sync-card p {
    margin: 8px 0;
    color: #475569;
}

.meshfeed-sync-card button {
    margin-top: 12px;
}

/* NOTE: .meshfeed-step.hidden is defined above in step visibility section */

.connection-info h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.connection-info p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.connection-status {
    font-size: 14px;
    font-weight: 500;
}

.connection-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
}

.connection-form .btn-primary {
    width: fit-content;
    align-self: flex-start;
}

/* Projects Section */
.projects-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.projects-search {
    max-width: 420px;
    flex: 1;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Button Styles - Standardized */
.btn-primary {
    padding: 10px 20px;
    background: var(--primary-color, #129ed9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(18, 158, 217, 0.15);
}

.btn-primary:hover {
    background: #0d8bc2;
    box-shadow: 0 4px 12px rgba(18, 158, 217, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
    background: #f3f4f6;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Ghost Button */
.btn-ghost {
    padding: 10px 20px;
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ghost:hover {
    background: #f3f4f6;
    color: #374151;
}

.btn-small {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.btn-icon.danger:hover {
    color: #ef4444;
    background: #fee2e2;
}

.modern-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    width: 100%;
}

.modern-toggle .toggle-label {
    display: inline;
    margin-top: 0;
    justify-content: initial;
    order: -1;
    flex: 1;
}

.modern-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.modern-toggle .toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background-color: #cbd5e1;
    border-radius: 26px;
    transition: all 0.3s ease;
}

.modern-toggle .toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modern-toggle input:checked + .toggle-slider {
    background: var(--color-gradient);
}

.modern-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.modern-toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.modern-toggle.small {
    transform: scale(0.9);
    transform-origin: left center;
}

/* Loading Overlay - Never cover full screen */
.loading-overlay {
    display: none; /* Hidden by default */
}

.loading-overlay:not(.hidden) {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
    padding: 32px 48px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-overlay p {
    color: white;
    margin-top: 16px;
    font-size: 16px;
}

/* Progress Indicator (non-blocking) */
.progress-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    max-width: 350px;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.progress-indicator.hidden {
    display: none !important;
}

.progress-content {
    width: 100%;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.progress-count {
    background: #f1f5f9;
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #2563eb, #1d4ed8);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    animation: gradientShift 2s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading Overlay - Modern Design */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    border-radius: 12px;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-overlay p {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

/* Modern dots loading animation (alternative) */
.loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .meshfeed-content {
        grid-template-columns: 1fr;
    }
    
    .meshfeed-rules-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .tier-cards {
        grid-template-columns: 1fr;
    }
    
    .meshfeed-controls {
        flex-direction: column;
    }
    
    .discount-input-group {
        flex-direction: column;
    }
}

/* ===================================
   MODE SWITCHING CARDS (TAB STYLE)
   ================================= */

#meshlistSection .mesh-mode-cards {
    display: flex;
    gap: 0;
    margin: 32px 0 24px 0;
    padding: 0;
    max-width: none;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 16px 16px 0 0;
    box-shadow: none;
    position: relative;
    z-index: 10;
}

#templatesSection .mesh-mode-cards {
    display: flex;
    gap: 0;
    margin: 32px 0 24px 0;
    padding: 0;
    max-width: none;
    border-bottom: 2px solid #e5e7eb;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    z-index: 10;
}

.mesh-mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 24px auto;
    max-width: 900px;
}

#meshlistSection .mesh-mode-card {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    position: relative;
    margin-bottom: -2px;
    text-align: center;
}

#templatesSection .mesh-mode-card {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    position: relative;
    margin-bottom: -2px;
    text-align: center;
}

#meshlistSection .mesh-mode-card:hover {
    background: transparent;
    border-bottom-color: #52d1a0;
    transform: none;
    box-shadow: none;
}

#templatesSection .mesh-mode-card:hover {
    background: transparent;
    border-bottom-color: #cbd5e1;
    transform: none;
    box-shadow: none;
}

#meshlistSection .mesh-mode-card.active {
    border-bottom: 2px solid #52d1a0;
    background: transparent;
    box-shadow: none;
}

#templatesSection .mesh-mode-card.active {
    border-bottom: 2px solid var(--primary-color);
    background: transparent;
    box-shadow: none;
}

#meshlistSection .mesh-mode-card.active::before,
#meshlistSection .mesh-mode-card.active::after {
    display: none;
}

#templatesSection .mesh-mode-card.active::before,
#templatesSection .mesh-mode-card.active::after {
    display: none;
}

.mesh-mode-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.mesh-mode-card:hover {
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.mesh-mode-card.active {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.mesh-mode-card.active::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mesh-mode-card.active::after {
    content: '✓';
    position: absolute;
    top: 14px;
    right: 16px;
    color: #475569;
    font-size: 12px;
    font-weight: bold;
}

.mesh-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mesh-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#meshlistSection .mesh-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(82, 209, 160, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(82, 209, 160, 0.7);
}

#templatesSection .mesh-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(18, 158, 217, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(18, 158, 217, 0.7);
}

#meshlistSection .mesh-mode-card.active .mesh-card-icon {
    background: rgba(82, 209, 160, 0.12);
    color: #2fb07f;
    box-shadow: none;
}

#templatesSection .mesh-mode-card.active .mesh-card-icon {
    background: rgba(18, 158, 217, 0.12);
    color: #129ed9;
}

.mesh-card-icon {
    width: 40px;
    height: 40px;
    background: #f5f3ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
}

.mesh-mode-card.active .mesh-card-icon {
    background: var(--primary-color);
    color: white;
}

#meshlistSection .mesh-card-content h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #6b7280;
}

#meshlistSection .mesh-mode-card.active .mesh-card-content h3 {
    color: #111827;
}

#templatesSection .mesh-card-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #6b7280;
}

#templatesSection .mesh-mode-card.active .mesh-card-content h3 {
    color: #0f172a;
}

#meshlistSection .mesh-card-content p {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
    text-align: left;
}

#meshlistSection .mesh-mode-card.active .mesh-card-content p {
    color: #6b7280;
}

#templatesSection .mesh-card-content p {
    margin: 0;
    color: #9ca3af;
    font-size: 13px;
    text-align: left;
}

#templatesSection .mesh-mode-card.active .mesh-card-content p {
    color: #64748b;
}

.mesh-card-content h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.mesh-card-content p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

/* ===================================
   MESHADS MODE CARDS (Tab Style)
   ================================= */

#meshadsSection .mesh-mode-cards {
    display: flex;
    gap: 0;
    margin: 24px 0;
    padding: 0;
    max-width: none;
    border-bottom: 2px solid #e5e7eb;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    z-index: 10;
}

#meshadsSection .mesh-mode-card {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    position: relative;
    margin-bottom: -2px;
    text-align: center;
}

#meshadsSection .mesh-mode-card:hover {
    background: transparent;
    border-bottom-color: #ff7547;
    transform: none;
    box-shadow: none;
}

#meshadsSection .mesh-mode-card.active {
    border-bottom: 2px solid #ff7547;
    background: transparent;
    box-shadow: none;
}

#meshadsSection .mesh-mode-card.active::before,
#meshadsSection .mesh-mode-card.active::after {
    display: none;
}

#meshadsSection .mesh-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 117, 71, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(255, 117, 71, 0.7);
}

#meshadsSection .mesh-mode-card.active .mesh-card-icon {
    background: rgba(255, 117, 71, 0.12);
    color: #e0633e;
    box-shadow: none;
}

#meshadsSection .mesh-card-content h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #6b7280;
}

#meshadsSection .mesh-mode-card.active .mesh-card-content h3 {
    color: #111827;
}

#meshadsSection .mesh-card-content p {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
    text-align: left;
}

#meshadsSection .mesh-mode-card.active .mesh-card-content p {
    color: #6b7280;
}

/* ===================================
   MESHFEED TABS (Tab Style)
   ================================= */

.meshfeed-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0;
    max-width: none;
    position: relative;
}

.meshfeed-tab {
    flex: 1;
    border: none;
    background: #f8fafc;
    padding: 16px 20px;
    font-weight: 600;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Connector line between tabs - force visibility */
#meshfeedTabs .meshfeed-tab::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: calc(100% + 2px) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 16px !important;
    height: 2px !important;
    background: #e5e7eb !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

#meshfeedTabs .meshfeed-tab:last-child::after {
    display: none !important;
}

/* Completed steps (before active) - lighter blue borders and line */
#meshfeedTabs .meshfeed-tab.completed {
    border-color: rgba(65, 159, 236, 0.5);
}

#meshfeedTabs .meshfeed-tab.completed .tab-step-number {
    background: rgba(65, 159, 236, 0.15);
    color: #419fec;
}

#meshfeedTabs .meshfeed-tab.completed::after {
    background: rgba(65, 159, 236, 0.5) !important;
}

#meshfeedTabs .meshfeed-tab:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #419fec;
}

#meshfeedTabs .meshfeed-tab:hover .tab-step-number {
    background: #e2e8f0;
    color: #419fec;
}

#meshfeedTabs .meshfeed-tab.active {
    background: transparent;
    border-color: #419fec;
    color: #111827;
}

#meshfeedTabs .meshfeed-tab.active .tab-step-number {
    background: #419fec;
    color: white;
}

/* ===================================
   FEED HEALTH DASHBOARD (Clean Style)
   ================================= */

.feed-health-dashboard {
    margin-bottom: 24px;
}

/* Use modern-settings-card styling */
.health-dashboard-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.health-dashboard-title {
    margin: 0;
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.health-dashboard-title i {
    color: #419fec;
}

.health-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    padding: 24px 24px 0 24px;
}

.sync-history-section {
    padding: 0 24px 24px 24px;
}

.health-metric-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s ease;
}

.health-metric-card:hover {
    border-color: #419fec;
}

.health-metric-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
}

.health-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.sync-history-section {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

.sync-history-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-history-title i {
    color: #419fec;
}

.sync-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-history-empty {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
}

/* ===================================
   SYNC PREVIEW OVERVIEW (Clean Style)
   ================================= */

.sync-preview-overview {
    margin-bottom: 24px;
}

.sync-preview-container {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.sync-preview-header {
    margin-bottom: 16px;
}

.sync-preview-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-preview-header h3 i {
    color: #419fec;
}

.sync-preview-header p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.sync-preview-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.sync-metric-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.2s ease;
}

.sync-metric-card:hover {
    border-color: #419fec;
}

.sync-metric-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
}

.sync-metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.sync-preview-rules {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.sync-rule-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sync-rule-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.sync-rule-value {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

@media (max-width: 768px) {
    .sync-preview-metrics {
        grid-template-columns: 1fr;
    }
    
    .sync-preview-rules {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* NOTE: feed-settings-card and feed-settings-section are defined in the main styles above */

/* Style checkboxes in feed-settings-section like AI Metafields */
.feed-settings-section .modern-checkbox {
    padding: 10px 16px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.feed-settings-section .modern-checkbox:hover {
    border-color: var(--primary-color);
}

/* ===================================
   MESHFEED RULE EDITOR (Clean Style)
   ================================= */

/* Rule Section - Clean Modern Style */
.rule-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.rule-section:hover {
    background: #f8fafc;
}

.rule-section:last-of-type {
    margin-bottom: 0;
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.section-label i {
    color: #3b82f6;
    font-size: 14px;
}

/* Section label with icon - gets uppercase and border */
.section-label:has(i) {
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

/* ===================================
   MESHADS CONTROLS (Clean Style)
   ================================= */

.meshads-controls {
    /* Removed border/box - already in modern-card */
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.meshads-controls:hover {
    box-shadow: none !important;
}

.meshads-table-container {
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}

.meshads-table-container:hover {
    box-shadow: none !important;
}

.meshads-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.table-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.meshads-table-header h3 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0;
}

.sort-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

.sort-indicator i {
    color: var(--primary-color);
}

/* Table Headers */
.meshads-table-headers {
    display: grid;
    grid-template-columns: 2fr repeat(7, 1fr) 120px;
    gap: 12px;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    align-items: center;
}

.meshads-header-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meshads-header-cell.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 6px 8px;
    border-radius: 6px;
}

.meshads-header-cell.sortable:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.meshads-header-cell.sortable i {
    font-size: 10px;
    opacity: 0.5;
}

.meshads-header-cell.sortable:hover i {
    opacity: 1;
    color: var(--primary-color);
}

/* Product Rows */
.meshads-product-row {
    display: grid;
    grid-template-columns: 2fr repeat(7, 1fr) 120px;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
    align-items: center;
}

.meshads-product-row:hover {
    background: #f1f5f9;
}

.meshads-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meshads-product-index {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    min-width: 32px;
}

.meshads-product-details {
    flex: 1;
}

.meshads-product-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.meshads-product-brand {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.meshads-metrics-grid {
    display: contents;
}

.meshads-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meshads-metric-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.meshads-metric-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.meshads-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Minimal Analyze Button */
.meshads-analyze-btn-mini {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.meshads-analyze-btn-mini:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(18, 158, 217, 0.3);
}

.meshads-analyze-btn-mini i {
    font-size: 14px;
}

/* Analysis Card */
/* Analysis & Grouping section uses standard modern-settings-card pattern */

.analysis-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.analysis-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.analysis-action-btn:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.analysis-action-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.analysis-action-btn i {
    font-size: 14px;
}

.grouping-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.grouping-results h5 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grouped-stats {
    display: grid;
    gap: 16px;
}

.grouped-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

/* Skeleton loading placeholders (like YouTube video thumbnails) */
.stat-card-skeleton {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    animation: shimmer 2s infinite;
}

.stat-card-skeleton {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.stat-icon-skeleton {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.stat-content-skeleton {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 16px;
    border-radius: 4px;
    background: #e5e7eb;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.value {
    height: 24px;
    width: 80%;
    margin: 4px 0;
}

@keyframes shimmer {
    0% {
        background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
        background-size: 200% 100%;
        background-position: 200% 0;
    }
    100% {
        background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
        background-size: 200% 100%;
        background-position: -200% 0;
    }
}

.grouped-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.grouped-stat-header strong {
    font-size: 15px;
    color: #111827;
}

.grouped-count {
    font-size: 12px;
    color: #64748b;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 6px;
}

.grouped-stat-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.grouped-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grouped-metric span {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grouped-metric strong {
    font-size: 14px;
    color: #111827;
}

.comparison-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
}

.comparison-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a474eb 100%);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}

.comparison-info {
    flex: 1;
}

.comparison-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 6px;
}

.comparison-bar-container {
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.comparison-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #a474eb 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.comparison-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 80px;
    text-align: right;
}

/* Product Performance Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.product-performance-modal {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #111827;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 16px 24px;
    position: relative;
}

.modal-header-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    font-size: 24px;
}

.modal-header-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.modal-header-text p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.modal-status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.modal-status-banner i {
    font-size: 18px;
}

.modal-content {
    padding: 24px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section:last-of-type {
    margin-bottom: 0;
}

.modal-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section h4 i {
    color: var(--primary-color);
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.modal-stat.highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border-color: var(--primary-color);
}

.modal-stat-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.modal-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.modal-stat.highlight .modal-stat-value {
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .meshads-table-headers {
        display: none;
    }
    
    .meshads-product-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .meshads-metrics-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .analysis-card-actions {
        flex-direction: column;
    }
    
    .analysis-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   MESH INTERFACES
   ================================= */

.mesh-interface {
    width: 100%;
    position: relative;
    z-index: 1;
}

.mesh-interface.hidden {
    display: none !important;
}

/* Mesh Interface Header */
.mesh-interface-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.mesh-interface-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mesh-interface-title i {
    font-size: 22px;
    color: #52d1a0;
}

/* MeshAds interface titles use orange icons */
#meshadsRulesInterface .mesh-interface-title i,
#meshadsPerformanceInterface .mesh-interface-title i,
#meshadsRulesTitle .mesh-interface-title i,
#meshadsPerformanceTitle .mesh-interface-title i {
    color: #f97316;
}

.mesh-interface-subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    padding-left: 34px;
}

/* ===================================
   SECTION HIGHLIGHTING (Scroll-based)
   ================================= */

/* Default state - section out of view (subtle fade) */
.modern-settings-card.section-out-view {
    opacity: 0.7;
    transform: scale(0.992);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Section in view - full visibility */
.modern-settings-card.section-in-view {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add subtle shadow to sections in view for extra emphasis */
.modern-settings-card.section-in-view {
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.08), 
                0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

/* Ensure hover state works on visible sections */
.modern-settings-card.section-in-view:hover {
    box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.12), 
                0 3px 6px -3px rgba(0, 0, 0, 0.07);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================
   MESHSTORE SPECIFIC STYLES
   ================================= */

.meshstore-header {
    margin-bottom: 24px;
}

/* ===================================
   AUTOLIST SPECIFIC STYLES
   ================================= */

.autolist-toggle-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.autolist-toggle-section .toggle-switch-inline {
    justify-content: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 16px;
}

.toggle-description {
    margin: 16px 0 0;
    font-size: 14px;
    color: #64748b;
}

/* AutoList/AutoMedia Settings Card - Clean Modern Style */
.autolist-settings-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.autolist-settings-card > h3 {
    margin: 0;
    padding: 20px 24px;
    font-size: 16px;
    color: #111827;
    font-weight: 600;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.autolist-settings-card > .settings-subtitle {
    margin: 0;
    padding: 0 24px 16px;
    color: #6b7280;
    font-size: 13px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

/* Settings sections inside card */
.autolist-settings-card .autolist-grid,
.autolist-settings-card .autolist-sources,
.autolist-settings-card .autolist-textareas,
.autolist-settings-card .form-group,
.autolist-settings-card .settings-row {
    padding: 0 24px;
}

.autolist-settings-card .autolist-grid:first-of-type {
    padding-top: 24px;
}

.autolist-settings-card > *:last-child {
    padding-bottom: 24px;
}

.settings-subtitle {
    margin: 0 0 24px;
    color: #6b7280;
    font-size: 13px;
}

.autolist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    border: none;
}

.settings-row label {
    font-weight: 500;
    color: #475569;
    min-width: 150px;
}

.settings-row input[type="number"] {
    width: 80px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    background: transparent;
    transition: all 0.2s ease;
}

.settings-row input[type="number"]:hover {
    border-color: var(--primary-color);
}

.settings-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.settings-row textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    background: transparent;
    transition: all 0.2s ease;
}

.settings-row textarea:hover {
    border-color: var(--primary-color);
}

.settings-row span {
    color: #64748b;
    font-size: 14px;
}

.ai-image-settings {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 0;
    margin-top: 12px;
}

.autolist-sources {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.autolist-sources h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #0f172a;
}

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.autolist-source {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: transparent;
    transition: all 0.2s ease;
}

.autolist-source:hover {
    border-color: var(--primary-color);
}

.autolist-textareas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.autolist-history {
    background: #f8fafc;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.autolist-history h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #1e293b;
}

.history-entry {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}

.history-date {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.history-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.history-products {
    font-weight: 600;
    color: #0f172a;
}

.history-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.history-status.success {
    background: #dcfce7;
    color: #166534;
}

.history-status.error {
    background: #fee2e2;
    color: #b91c1c;
}

.history-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.history-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    border-radius: 4px;
    font-size: 13px;
    color: #991b1b;
}

/* ===================================
   MESHLIST SETTINGS PANELS
   ================================= */

.meshlist-settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
    /* No max-width - match import cards width */
}

/* Modern Settings Card - Clean Professional Style */
.modern-settings-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    margin-bottom: 20px;
}

.modern-settings-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.modern-card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 24px 24px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* Direct h3/p children (for simple headers without .header-content wrapper) */
.modern-card-header > h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
}

.modern-card-header > p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.modern-card-content {
    padding: 24px;
}

/* Info Card - Consistent Styling */
.info-card {
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
    width: fit-content;
    max-width: 100%;
}

.info-card-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(96, 165, 250, 0.04) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.info-card-green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(52, 211, 153, 0.04) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.info-card-purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(167, 139, 250, 0.04) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.info-card-icon {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-card-blue .info-card-icon {
    color: #3b82f6;
}

.info-card-green .info-card-icon {
    color: #10b981;
}

.info-card-purple .info-card-icon {
    color: #8b5cf6;
}

.info-card-text {
    flex: 1;
}

.info-card-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.info-card-text p {
    margin: 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.info-card-text a {
    color: #3b82f6;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.info-card-text a:hover {
    color: #2563eb;
}

/* Clean section separators */
.modern-card-content > .setting-group:not(:last-child) {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

/* Header Content Structure */
.modern-card-header .header-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
}

.modern-card-header .header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eef2ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Feature-specific header icon colors */
#meshlistSection .header-icon,
#meshstoreInterface .header-icon {
    background: rgba(82, 209, 160, 0.15);
    color: #52d1a0;
}

#autolistInterface .header-icon {
    background: rgba(82, 209, 160, 0.15);
    color: #52d1a0;
}

#automediaInterface .header-icon {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

#meshadsSection .header-icon {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

#meshfeedSection .header-icon {
    background: rgba(65, 159, 236, 0.15);
    color: #419fec;
}

#productsSection .header-icon {
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
}

/* Header Text */
.modern-card-header .header-text {
    flex: 1;
}

.modern-card-header .header-text h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
}

.modern-card-header .header-text p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.settings-grid.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.setting-group small {
    display: block;
    color: #94a3b8;
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.4;
}

.prompt-editor {
    margin-top: 16px;
}

.prompt-editor textarea {
    width: 100%;
}

.card-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-ghost.small-btn {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn-ghost.small-btn:hover {
    color: var(--primary-color);
}

.custom-fields-list {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    min-height: 90px;
}

.custom-field-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.custom-field-item:last-child {
    border-bottom: none;
}

.custom-field-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-field-name {
    font-weight: 600;
    color: #0f172a;
}

.custom-field-type {
    font-size: 12px;
    color: #94a3b8;
}

.custom-field-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-field-form {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.stores-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.store-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.store-checkbox input {
    width: 16px;
    height: 16px;
}

.stock-level-row {
    margin-top: 10px;
}

.stock-level-row.hidden {
    display: none;
}

.empty-state.small {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
}

.edit-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.edit-modal.hidden {
    display: none;
}

.edit-modal-content {
    width: min(900px, 92%);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}

.edit-modal-header,
.edit-modal-footer {
    padding: 20px 28px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.edit-modal-footer {
    border-top: 1px solid #e2e8f0;
    border-bottom: none;
}

.edit-modal-body {
    padding: 24px 28px;
    max-height: 70vh;
    overflow-y: auto;
}

.edit-modal-close {
    border: none;
    background: #eef2ff;
    color: var(--primary-color);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.edit-modal-actions {
    display: flex;
    gap: 12px;
}

.edit-status {
    font-size: 13px;
    color: #94a3b8;
}

.setting-group.full-width {
    grid-column: 1 / -1;
}

.modern-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s ease;
    font-family: inherit;
    color: #0f172a;
    background: transparent;
}

.modern-textarea:hover {
    border-color: var(--primary-color);
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===================================
   MODERN FORM ELEMENTS
   ================================= */

.modern-select {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.modern-select:hover {
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.modern-select.compact {
    padding: 8px 32px 8px 12px;
    font-size: 13px;
}

.modern-input {
    width: 100%;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    transition: all 0.2s ease;
    font-family: inherit;
}

.modern-input:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(18, 158, 217, 0.1);
}

.modern-input::placeholder {
    color: #94a3b8;
}

.modern-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* NOTE: .input-label and .prompt-input are defined in the main Form Styles section */

.modern-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
}

.modern-checkbox input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-mark {
    display: none;
}

.checkbox-label {
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
}

.translation-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 16px;
}

.collection-loader-card {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.collection-loader-card:hover {
    border-color: var(--primary-color);
    background: #fafbfc;
}

.collection-loader-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #0f172a;
}

.collection-loader-card p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #64748b;
}

.collection-loader-card input {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 12px;
}

/* NOTE: btn-primary and btn-secondary are defined in the main Button Styles section */

/* Manage Templates Button - Clean text link style */
.btn-manage-templates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: transparent;
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-manage-templates:hover {
    background: rgba(79, 70, 229, 0.08);
}

.btn-manage-templates:active {
    background: rgba(79, 70, 229, 0.12);
}

/* ===================================
   PAGINATION (EXACT PORT FROM MESHMERCHANT)
   ================================= */

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid #e1e1e1;
    margin-top: 20px;
}

.pagination-button {
    background: #fff;
    border: 1.5px solid #d1e6f5;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary-color);
    font-family: 'Inter', sans-serif;
}

.pagination-button:hover:not(:disabled) {
    background: #fff;
    border-color: #4338ca;
    color: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.15);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 16px;
}

/* ===================================
   RESPONSIVE DESIGN
   ================================= */

/* Smaller desktop screens - wrap step tabs to 2 columns */
@media (max-width: 1200px) {
    .meshlist-tabs,
    .meshstore-tabs {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .meshlist-tab,
    .meshstore-tab {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }
    
    /* First 2 tabs get horizontal connectors */
    .meshlist-tab:nth-child(1)::after,
    .meshlist-tab:nth-child(3)::after,
    .meshstore-tab:nth-child(1)::after,
    .meshstore-tab:nth-child(3)::after {
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        width: 14px;
        height: 2px;
    }
    
    /* Hide connectors after 2nd and 4th (right column) */
    .meshlist-tab:nth-child(2)::after,
    .meshlist-tab:nth-child(4)::after,
    .meshstore-tab:nth-child(2)::after,
    .meshstore-tab:nth-child(4)::after {
        display: none;
    }
    
    /* MeshFeed with 6 tabs - 3 rows of 2 */
    #meshfeedTabs {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    #meshfeedTabs .meshfeed-tab {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }
    
    /* Horizontal connectors for left column tabs (1, 3, 5) */
    #meshfeedTabs .meshfeed-tab:nth-child(1)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(3)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(5)::after {
        content: '' !important;
        display: block !important;
        position: absolute !important;
        left: calc(100% + 2px) !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 12px !important;
        height: 2px !important;
        background: #e5e7eb !important;
        z-index: 1 !important;
    }
    
    /* Hide connectors for right column tabs (2, 4, 6) */
    #meshfeedTabs .meshfeed-tab:nth-child(2)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(4)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(6)::after {
        display: none !important;
    }
    
    /* Completed state for MeshFeed connectors */
    #meshfeedTabs .meshfeed-tab.completed:nth-child(1)::after,
    #meshfeedTabs .meshfeed-tab.completed:nth-child(3)::after,
    #meshfeedTabs .meshfeed-tab.completed:nth-child(5)::after {
        background: rgba(65, 159, 236, 0.5) !important;
    }
}

/* Tablets and medium screens - 2x2 grid */
@media (max-width: 1024px) {
    #meshlistSection .mesh-mode-cards,
    #meshadsSection .mesh-mode-cards {
        flex-wrap: wrap;
        border-radius: 12px 12px 0 0;
        margin: 24px 0 20px 0;
        gap: 0;
    }

    #templatesSection .mesh-mode-cards {
        flex-wrap: wrap;
        border-radius: 12px 12px 0 0;
        margin: 24px 0 20px 0;
        gap: 0;
    }
    
    #meshlistSection .mesh-mode-card,
    #meshadsSection .mesh-mode-card {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
        padding: 16px 16px;
        border-right: 1px solid #e5e7eb;
    }

    #meshlistSection .mesh-mode-card:nth-child(2n),
    #meshadsSection .mesh-mode-card:nth-child(2n) {
        border-right: none;
    }

    #templatesSection .mesh-mode-card {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
        padding: 16px 16px;
        border-right: 1px solid #e5e7eb;
    }

    #templatesSection .mesh-mode-card:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .mesh-mode-cards {
        grid-template-columns: 1fr;
    }
    
    #meshlistSection .mesh-mode-card,
    #meshadsSection .mesh-mode-card {
        padding: 14px 12px;
    }

    #templatesSection .mesh-mode-card {
        padding: 14px 12px;
    }
    
    .mesh-interface-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .mesh-interface-title {
        font-size: 20px;
    }
    
    .mesh-interface-title i {
        font-size: 18px;
    }
    
    .mesh-interface-subtitle {
        font-size: 13px;
        padding-left: 30px;
    }
    
    #meshlistSection .mesh-card-icon,
    #meshadsSection .mesh-card-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    #templatesSection .mesh-card-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    #meshlistSection .mesh-card-content h3,
    #meshadsSection .mesh-card-content h3 {
        font-size: 15px;
    }

    #templatesSection .mesh-card-content h3 {
        font-size: 15px;
    }
    
    #meshlistSection .mesh-card-content p,
    #meshadsSection .mesh-card-content p {
        font-size: 12px;
        line-height: 1.4;
    }

    #templatesSection .mesh-card-content p {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .meshlist-tabs,
    .meshstore-tabs,
    #meshfeedTabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .meshlist-tab,
    .meshstore-tab,
    #meshfeedTabs .meshfeed-tab {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        padding: 10px 12px;
        gap: 8px;
    }
    
    /* Vertical connector lines for mobile (2x2 grid) */
    .meshlist-tab::after,
    .meshstore-tab::after {
        content: '';
        display: block;
        position: absolute;
        left: 50%;
        top: 100%;
        transform: translateX(-50%);
        width: 2px;
        height: 10px;
        background: #e5e7eb;
        z-index: -1;
    }
    
    /* MeshFeed vertical connectors for top 4 tabs */
    #meshfeedTabs .meshfeed-tab:nth-child(1)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(2)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(3)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(4)::after {
        content: '' !important;
        display: block !important;
        position: absolute !important;
        left: 50% !important;
        top: calc(100% + 2px) !important;
        transform: translateX(-50%) !important;
        width: 2px !important;
        height: 8px !important;
        background: #e5e7eb !important;
        z-index: 1 !important;
    }
    
    /* Hide connector after last row (3rd and 4th items in 2x2 grid) */
    .meshlist-tab:nth-child(3)::after,
    .meshlist-tab:nth-child(4)::after,
    .meshstore-tab:nth-child(3)::after,
    .meshstore-tab:nth-child(4)::after {
        display: none;
    }
    
    /* For meshfeed with 6 tabs, hide last row (5th and 6th) */
    #meshfeedTabs .meshfeed-tab:nth-child(5)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(6)::after {
        display: none !important;
    }
    
    /* Completed state connector lines */
    .meshlist-tab.completed::after,
    .meshstore-tab.completed::after {
        background: rgba(82, 209, 160, 0.5);
    }
    
    #meshfeedTabs .meshfeed-tab.completed:nth-child(1)::after,
    #meshfeedTabs .meshfeed-tab.completed:nth-child(2)::after,
    #meshfeedTabs .meshfeed-tab.completed:nth-child(3)::after,
    #meshfeedTabs .meshfeed-tab.completed:nth-child(4)::after {
        background: rgba(65, 159, 236, 0.5) !important;
    }
    
    .tab-step-number {
        width: 26px;
        height: 26px;
        font-size: 12px;
        flex-shrink: 0;
    }
    
    .tab-step-label {
        font-size: 12px;
        line-height: 1.3;
    }
    
    /* Adjust completed step styling for mobile */
    .meshlist-tab.completed,
    .meshstore-tab.completed {
        border-color: rgba(82, 209, 160, 0.4);
    }
    
    #meshfeedTabs .meshfeed-tab.completed {
        border-color: rgba(65, 159, 236, 0.4);
    }
    
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .settings-row label {
        min-width: auto;
    }
}

/* Mobile small screens - compact 2x2 layout for MeshList, side by side for MeshAds */
@media (max-width: 600px) {
    /* MeshList - 2x2 grid with 4 tabs */
    #meshlistSection .mesh-mode-cards {
        flex-wrap: wrap;
        gap: 0;
    }
    
    #meshlistSection .mesh-mode-card {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
        border-right: 1px solid #e5e7eb;
        border-bottom: 2px solid #e5e7eb;
        padding: 12px 8px;
    }
    
    #meshlistSection .mesh-mode-card:nth-child(2n) {
        border-right: none;
    }
    
    /* MeshAds - side by side with 2 tabs */
    #meshadsSection .mesh-mode-cards {
        flex-wrap: nowrap;
        gap: 0;
    }
    
    #meshadsSection .mesh-mode-card {
        flex: 1;
        border-right: 1px solid #e5e7eb;
        border-bottom: 2px solid #e5e7eb;
        padding: 12px 8px;
    }
    
    #meshadsSection .mesh-mode-card:last-child {
        border-right: none;
    }
    
    /* Templates - keep as is */
    #templatesSection .mesh-mode-cards {
        flex-wrap: wrap;
        gap: 0;
    }
    
    #templatesSection .mesh-mode-card {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
        border-right: 1px solid #e5e7eb;
        border-bottom: 2px solid #e5e7eb;
        padding: 12px 8px;
    }
    
    #templatesSection .mesh-mode-card:nth-child(2n) {
        border-right: none;
    }
    
    /* Icon and title layout - stacked vertically */
    #meshlistSection .mesh-card-title-row,
    #meshadsSection .mesh-card-title-row,
    #templatesSection .mesh-card-title-row {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
    
    #meshlistSection .mesh-card-content h3,
    #meshadsSection .mesh-card-content h3,
    #templatesSection .mesh-card-content h3 {
        font-size: 12px;
        text-align: center;
    }
    
    /* Hide descriptions on mobile */
    #meshlistSection .mesh-card-content p,
    #meshadsSection .mesh-card-content p,
    #templatesSection .mesh-card-content p {
        display: none;
    }
    
    #meshlistSection .mesh-card-icon,
    #meshadsSection .mesh-card-icon,
    #templatesSection .mesh-card-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Extra small mobile - stack tabs vertically for better readability */
@media (max-width: 480px) {
    .meshlist-tabs,
    .meshstore-tabs,
    #meshfeedTabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .meshlist-tab,
    .meshstore-tab,
    #meshfeedTabs .meshfeed-tab {
        flex: 1 1 100%;
        padding: 12px 14px;
    }
    
    /* Show all connector lines vertically except last tab */
    .meshlist-tab::after,
    .meshstore-tab::after {
        content: '';
        display: block;
        position: absolute;
        left: 50%;
        top: 100%;
        transform: translateX(-50%);
        width: 2px;
        height: 10px;
        background: #e5e7eb;
        z-index: -1;
    }
    
    /* MeshFeed vertical connectors for all except last */
    #meshfeedTabs .meshfeed-tab:nth-child(1)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(2)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(3)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(4)::after,
    #meshfeedTabs .meshfeed-tab:nth-child(5)::after {
        content: '' !important;
        display: block !important;
        position: absolute !important;
        left: 50% !important;
        top: calc(100% + 2px) !important;
        transform: translateX(-50%) !important;
        width: 2px !important;
        height: 8px !important;
        background: #e5e7eb !important;
        z-index: 1 !important;
    }
    
    .meshlist-tab:last-child::after,
    .meshstore-tab:last-child::after,
    #meshfeedTabs .meshfeed-tab:last-child::after {
        display: none !important;
    }
    
    .tab-step-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .tab-step-label {
        font-size: 13px;
    }
}


/* ===================================
   AI FIELD LIST WITH TOOLTIPS
   ================================= */

.ai-field-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.ai-field {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #0f172a;
}

.ai-field:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.ai-field input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* Select All checkbox styling */
.select-all-metafields {
    margin-bottom: 20px;
}

.select-all-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
}

.select-all-label input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* Products selection checkboxes (Select All in product lists) */
.products-selection label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
}

.products-selection label input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* General standardized checkbox styling for any remaining checkboxes */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

label:has(> input[type="checkbox"]) {
    cursor: pointer;
}

.ai-field .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.ai-field .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.ai-field:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* AI Options Panel */
.ai-options-panel {
    margin: 20px 0;
}


/* ===================================
   UTILITY CLASSES
   ================================= */

.hidden {
    display: none !important;
}

/* ===================================
   PROJECTS & STORES UI
   ================================= */

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.project-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-header h3 i {
    color: #129ed9;
}

.store-count {
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.store-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.store-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.store-info h4 i {
    color: #129ed9;
}

.store-url {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.role-owner {
    background: #dbeafe;
    color: #1e40af;
}

.role-admin {
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 500;
}

.role-write {
    background: #dcfce7;
    color: #166534;
}

.role-read {
    background: #fef3c7;
    color: #92400e;
}

.owner-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    background: #f3f4f6;
    color: #6b7280;
}

.store-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-primary.small {
    padding: 6px 14px;
    font-size: 13px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: auto;
    overflow-y: visible;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.onboarding-panel {
    padding: 16px 20px 20px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

/* Highlighted state for connection onboarding - subtle gradient */
.onboarding-panel.highlighted {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.04) 0%, rgba(18, 158, 217, 0.04) 100%);
    border: 1px solid transparent;
    box-shadow: 
        0 0 0 1px rgba(164, 116, 235, 0.15),
        0 4px 12px rgba(164, 116, 235, 0.08);
}

.onboarding-panel.highlighted::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, #a474eb 0%, #129ed9 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    pointer-events: none;
}

.onboarding-panel.highlighted .onboarding-panel-header h3 {
    background: linear-gradient(135deg, #a474eb 0%, #129ed9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.onboarding-panel--login {
    background: #f1f5f9;
    border-color: #e2e8f0;
    margin-top: 16px;
}

.onboarding-panel-header h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.onboarding-panel-header p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.onboarding-panel-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.onboarding-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #ffffff;
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.onboarding-step-number {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.onboarding-panel .btn-secondary {
    width: 100%;
    justify-content: center;
}

@media (max-width: 640px) {
    .onboarding-panel {
        padding: 16px;
    }
    
    .onboarding-panel-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

/* AutoList Credits Estimate - Prominent Display */
.autolist-credits-estimate {
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid rgba(18, 158, 217, 0.2);
    background: linear-gradient(135deg, rgba(18, 158, 217, 0.05) 0%, rgba(164, 116, 235, 0.05) 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.autolist-credits-estimate::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color, #129ed9);
    flex-shrink: 0;
}

/* MeshList Credits Display */
.meshlist-credits-display {
    padding: 20px 24px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    margin-bottom: 20px;
}

.credits-display-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.credits-display-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.credits-display-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    transition: color 0.2s ease;
}

.credits-display-value:hover {
    color: var(--primary-color);
}

@media (max-width: 640px) {
    .meshlist-credits-display {
        padding: 16px 20px;
    }
    
    .credits-display-content {
        gap: 10px;
    }
    
    .credits-display-value {
        font-size: 18px;
    }
}

.connections-intro {
    margin: 0 0 24px;
}

.connections-intro-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

.connections-intro-text h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.connections-intro-text p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    max-width: 520px;
}

.connections-intro-steps {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.connections-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.connections-step-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Shopify Quick Connect Styling */
.shopify-quick-connect {
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    margin-bottom: 16px;
}

.quick-connect-header {
    margin-bottom: 16px;
}

.quick-connect-text {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.quick-connect-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-connect-text h4 i {
    color: #7c3aed;
}

.recommended-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
}

.quick-connect-header p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* Shopify Guide Modal Steps */
.shopify-guide-step {
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.2s ease;
}

.shopify-guide-step:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.shopify-guide-step-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background 0.2s ease;
}

.shopify-guide-step-header:hover {
    background: #f9fafb;
}

.shopify-guide-step-number {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.shopify-guide-step-title {
    flex: 1;
    text-align: left;
}

.shopify-guide-step-title h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.shopify-guide-step-title p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.shopify-guide-step-content {
    padding: 0 20px 20px 80px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shopify Guide Button */
.shopify-guide-btn {
    width: 100%;
    padding: 12px 20px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shopify-guide-btn:hover {
    background: #bae6fd;
}

/* Info Boxes in Modal */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
}

.info-box i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 16px;
}

.info-box-yellow {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.info-box-blue {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.info-box-red {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

/* Mobile Responsiveness for Shopify Guide Modal */
@media (max-width: 768px) {
    .shopify-guide-step-header {
        padding: 16px;
        gap: 12px;
    }
    
    .shopify-guide-step-number {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .shopify-guide-step-title h4 {
        font-size: 15px;
    }
    
    .shopify-guide-step-title p {
        font-size: 12px;
    }
    
    .shopify-guide-step-content {
        padding: 0 16px 16px 56px;
    }
    
    .info-box {
        padding: 12px;
        font-size: 12px;
    }
    
    .shopify-guide-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
    }
    
    .modal-header h2 {
        font-size: 16px !important;
    }
    
    .modal-body {
        padding: 16px !important;
    }
    
    .shopify-guide-step-header {
        padding: 12px;
        gap: 10px;
    }
    
    .shopify-guide-step-number {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .shopify-guide-step-title h4 {
        font-size: 14px;
    }
    
    .shopify-guide-step-title p {
        display: none; /* Hide subtitle on very small screens */
    }
    
    .shopify-guide-step-content {
        padding: 0 12px 12px 48px;
    }
    
    .shopify-guide-step-content ol,
    .shopify-guide-step-content ul {
        padding-left: 16px;
        font-size: 13px;
    }
    
    .form-group {
        margin-bottom: 16px !important;
    }
    
    .prompt-input {
        font-size: 14px !important;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.modal-body {
    padding: 24px;
}

.create-project-body {
    padding: 20px 24px 24px;
    display: grid;
    gap: 18px;
}

.create-project-section {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
}

.create-project-section .section-head {
    margin-bottom: 12px;
}

.create-project-section .section-head h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.create-project-section .section-head p {
    margin: 0;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.5;
}

.create-project-section .form-group {
    margin-bottom: 14px;
}

.create-project-section .form-group:last-child {
    margin-bottom: 0;
}

.create-project-section label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.create-project-section .label-muted {
    color: #9ca3af;
    font-weight: 500;
    font-size: 12px;
}

.create-project-section small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.create-project-section .prompt-input {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 10px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   MESHFEED RULES - Modernized Styles
   EXACT PORT from Meshmerchant styles.css
   ======================================== */

.modern-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.modern-rule-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.modern-rule-item.rule-active {
  border-color: #94a3b8;
  background: #f8fafc;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

/* Compact rule view for sidebars */
.modern-rule-item.compact {
  padding: 12px;
  margin-bottom: 8px;
}

.modern-rule-item.compact .rule-main-content {
  flex: 1;
  min-width: 0;
}

.modern-rule-item.compact .rule-line {
  margin-bottom: 0;
}

.modern-rule-item.compact .rule-line span {
  font-size: 13px;
  line-height: 1.4;
}

.modern-rule-item.compact .drag-handle {
  font-size: 14px;
}

.modern-rule-item.compact .rule-actions {
  margin-left: 8px;
  gap: 6px;
}

.drag-handle {
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #cbd5e1;
  font-size: 16px;
  margin-top: 2px;
  user-select: none;
}

.rule-main-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rule-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.5;
}

.rule-line strong {
  font-weight: 600;
  color: #0f172a;
}

.rule-line span {
  color: #475569;
}

.rule-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
}

.rule-icon.then {
  background: #f1f5f9;
  color: #64748b;
}

.rule-icon.else {
  background: #f1f5f9;
  color: #64748b;
}

.logic-badge {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  margin: 0 2px;
}

/* Rule actions container (affected label + delete button) */
.rule-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.affected-label {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}

.rule-delete-btn {
  background: #ffffff;
  color: #ef4444;
  border: 1px solid #fecaca;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rule-delete-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

@media (max-width: 700px) {
  .modern-rule-item {
    flex-direction: row;
    padding: 12px;
    margin-bottom: 8px;
  }
  .drag-handle {
    margin-bottom: 0;
  }
  /* Hide "Then" action line on mobile - always compact */
  .modern-rule-item .rule-main-content .rule-line:nth-child(2) {
    display: none;
  }
  /* Hide affected count on mobile - always compact */
  .modern-rule-item .affected-label {
    display: none;
  }
  /* Truncate condition text on mobile */
  .modern-rule-item .rule-line span {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
  }
  .rule-actions {
    margin-left: 8px;
    margin-top: 0;
  }
}

/* Rule item active state */
.rule-item.rule-active {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
}

.rule-item.rule-active .rule-main-content {
    color: #0f172a !important;
}

.rule-item.rule-active .rule-icon {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

.rule-item.rule-active .affected-label {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

.rule-item.rule-active .rule-delete-btn {
    background: #ffffff !important;
    color: #ef4444 !important;
}

.rule-item.rule-active .rule-delete-btn:hover {
    background: #dc2626 !important;
}

/* Compact rule cards when shown in left sidebar */
.rules-sidebar .modern-rule-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.rules-sidebar .drag-handle {
    flex: 0 0 18px;
    font-size: 14px;
    margin-top: 0;
}

.rules-sidebar .rule-main-content {
    gap: 4px;
}

.rules-sidebar .rule-line {
    font-size: 12px;
    line-height: 1.35;
}

.rules-sidebar .rule-line span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rules-sidebar .rule-icon {
    width: 16px;
    height: 16px;
    font-size: 10px;
}

.rules-sidebar .logic-badge {
    font-size: 10px;
    padding: 1px 6px;
}

.rules-sidebar .rule-actions {
    gap: 6px;
}

.rules-sidebar .affected-label {
    padding: 2px 8px;
    font-size: 11px;
}

.rules-sidebar .rule-actions .btn-secondary {
    padding: 4px 6px;
    font-size: 11px;
}

.rules-sidebar .rule-delete-btn {
    padding: 4px 6px;
    font-size: 11px;
}

/* Rule Form Sections - EXACT MESHMERCHANT */
.rule-condition-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Compound Conditions */
.compound-condition {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 14px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
    transition: all 0.2s ease;
}

.compound-condition:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.compound-condition select,
.compound-condition input {
    min-width: 120px;
}

/* Ad Rule Condition Rows */
.condition-row {
    padding: 14px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
    transition: all 0.2s ease;
}

.condition-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

/* Logic Badge */
.logic-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    margin: 0 4px;
}

/* No rules placeholder */
.no-rules {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* ========================================
   INFO BOX & MISSING FIELDS REPORT
   ======================================== */

.info-box2 {
    background: #f8fafc !important;
    padding: 16px 20px 20px !important;
    border-radius: 14px !important;
    border: 1px solid #e5e7eb !important;
    margin-top: 20px !important;
    text-align: left !important;
    font-size: 14px !important;
    color: #111827 !important;
    line-height: 1.6 !important;
    font-family: 'Manrope', sans-serif !important;
}

/* Credits/subscription needed - subtle purple like connection onboarding */
.info-box2--credits-needed {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%) !important;
    border: 1px solid rgba(164, 116, 235, 0.2) !important;
    box-shadow: 0 0 0 1px rgba(164, 116, 235, 0.1), 0 2px 8px rgba(164, 116, 235, 0.06) !important;
}

.info-box2--credits-needed strong {
    color: #7c3aed;
}

.info-box2 strong {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.info-box2 p {
    color: #6b7280;
}

.info-box2 i {
    color: #129ed9;
    margin-right: 8px;
}

.info-box2 code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    max-width: 50%;
}

.icon-orange {
    color: #ff9800;
}

@media (max-width: 768px) {
    .info-box2 code {
        max-width: 100px;
    }
    
    .info-box2 {
        padding: 16px !important;
    }
}

/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVENESS
   Additional improvements for production
   ======================================== */

/* Tablet and below */
@media (max-width: 1024px) {
    /* Projects section */
    .projects-list {
        grid-template-columns: 1fr;
    }
    
    /* Billing tiers */
    .billing-tiers {
        grid-template-columns: 1fr;
    }
    
    /* Settings forms */
    .settings-form {
        grid-template-columns: 1fr;
    }
    
    /* Connection cards */
    .connections-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    /* Product tables - make scrollable */
    .products-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .products-table {
        min-width: 600px;
    }
    
    /* Product cards */
    .product-card {
        flex-direction: column;
        padding: 16px;
    }
    
    .product-card-image {
        width: 100%;
        max-width: 200px;
        height: auto;
        margin: 0 auto 12px;
    }
    
    /* Forms and inputs */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Buttons */
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
    
    /* Modals */
    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
        width: calc(100% - 40px);
    }
    
    .modal-body {
        padding: 16px;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Stats cards */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* MeshFeed specific */
    .meshfeed-products-table {
        min-width: 600px;
    }
    
    .meshfeed-step-indicator {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* MeshList specific */
    .meshlist-products-grid {
        grid-template-columns: 1fr;
    }
    
    .meshlist-settings-grid {
        grid-template-columns: 1fr;
    }
    
    /* MeshStore specific */
    .meshstore-products-grid {
        grid-template-columns: 1fr;
    }
    
    /* Translations specific */
    .translation-controls {
        flex-direction: column;
    }
    
    .translation-control-group {
        width: 100%;
    }
    
    /* AutoList specific */
    .autolist-settings-grid {
        grid-template-columns: 1fr;
    }
    
    /* Projects list */
    .project-card {
        padding: 16px;
    }
    
    .store-option {
        padding: 12px;
    }
    
    /* Billing */
    .invoice-table {
        min-width: 600px;
    }
    
    .tier-card {
        padding: 20px;
    }
    
    /* Credits */
    .credit-balance {
        font-size: 32px;
    }
    
    /* Settings */
    .setting-card {
        padding: 16px;
    }
    
    /* Image selection */
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Small phones */
@media (max-width: 480px) {
    /* Even smaller adjustments */
    .section-header h1 {
        font-size: 22px;
    }
    
    .section-header p {
        font-size: 13px;
    }
    
    /* Buttons */
    .btn, .action-button {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    /* Cards */
    .card, .settings-card {
        padding: 16px;
    }
    
    /* Product images */
    .product-image {
        max-width: 80px;
        max-height: 80px;
    }
    
    /* Modal titles */
    .modal-header h2,
    .modal-header h3 {
        font-size: 18px;
    }
    
    /* Form labels */
    label {
        font-size: 13px;
    }
    
    /* Pagination */
    .pagination-button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .pagination-info {
        font-size: 12px;
    }
    
    /* Stats */
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

/* Landscape phones */
@media (max-width: 896px) and (orientation: landscape) {
    .main-content {
        padding-top: 60px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* Touch interactions */
@media (hover: none) {
    /* Make clickable areas larger for touch */
    .checkbox-label,
    .radio-label {
        padding: 12px;
        margin: 4px 0;
    }
    
    /* Remove hover effects that don't work on touch */
    .product-card:hover,
    .store-option:hover,
    .tier-card:hover {
        transform: none;
    }
    
    /* Make buttons easier to tap */
    button,
    .action-button,
    .tab-button {
        min-height: 44px; /* Apple HIG recommendation */
        min-width: 44px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure images look sharp */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark mode support (optional, for future) */
@media (prefers-color-scheme: dark) {
    :root {
        /* Keep light mode for now, but structure is ready */
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-menu-btn,
    .action-button,
    .generate-button {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
    }
    
    .product-card,
    .settings-card {
        break-inside: avoid;
    }
}


/* ========== PROJECT SETTINGS MODAL (EXACT MESHMERCHANT) ========== */

/* Settings Modal Backdrop */
.settings-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

/* Settings Modal */
.settings-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 700px;
    width: 90%;
    max-height: auto;
    overflow: visible;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.settings-modal-backdrop.active .settings-modal {
    transform: scale(1);
}

/* Modal Header */
.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.settings-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    font-family: 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.settings-modal-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Modal Content */
.settings-modal-content {
    padding: 24px;
    max-height: none;
    overflow-y: visible;
    flex: 1;
}

/* Add User Container */
.add-user-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.add-user-text {
    font-size: 16px;
    color: #111827;
    margin: 0;
    font-weight: 500;
    font-family: 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Settings Modal Input Fields */
.settings-modal-content .input-field,
.add-user-container .input-field,
.change-project-container .input-field {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    background: transparent;
    transition: all 0.2s ease;
}

/* Add chevron for select dropdowns */
.change-project-container select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.settings-modal-content .input-field:hover,
.add-user-container .input-field:hover,
.change-project-container .input-field:hover {
    border-color: var(--primary-color);
}

.change-project-container select.input-field:hover {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.settings-modal-content .input-field:focus,
.add-user-container .input-field:focus,
.change-project-container .input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.change-project-container select.input-field:focus {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Role Select Dropdown */
.role-select {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.role-select:hover {
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.role-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23129ed9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Current Users Container */
.current-users-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 0 0 20px 0;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
}

.user-item i {
    margin-right: 8px;
    color: #6b7280;
}

.remove-user-btn {
    background: #ffffff;
    border: 1px solid #dc2626;
    color: #dc2626;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-user-btn:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Change Project Container */
.change-project-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 0 0 20px 0;
}

.change-project-container select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    transition: border-color 0.2s ease;
    margin-bottom: 16px;
}

.change-project-container select:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Delete Store Container */
.delete-store-container {
    margin-top: 20px;
}

/* Project Settings Button */
.project-settings-button {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.project-settings-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.project-settings-button i {
    font-size: 14px;
}

/* Role Badges in Settings Modal */
.role-badge.role-owner {
    background: #dcfce7;
    color: #166534;
}

/* Responsive Settings Modal */
@media (max-width: 768px) {
    .settings-modal {
        max-width: 95%;
        margin: 20px;
    }
    
    .settings-modal-header {
        padding: 16px 20px;
    }
    
    .settings-modal-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .settings-modal-header {
        padding: 12px 16px;
    }
    
    .settings-modal-content {
        padding: 16px;
    }
    
    .add-user-container,
    .current-users-container,
    .change-project-container {
        padding: 16px;
    }
}

/* ========== END PROJECT SETTINGS MODAL ========== */


/* ========== MESHAI CHAT STYLES (EXACT PORT FROM MESHMERCHANT) ========== */

/* Chat interface wrapper */
.chat-interface-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background-color: transparent;
}

/* Chat header */
.chat-header-3 {
    padding: 20px;
    background-color: transparent;
    border-bottom: 1px solid #e8e8e8;
}

.chat-header-3 h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* New chat button header */
.sidebar-header-newchat {
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px;
    background-color: transparent;
    border-bottom: 1px solid #e8e8e8;
    gap: 10px;
}

.menu-item-newchat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #6366f1;
    border-radius: 4px;
    background: transparent;
    color: #6366f1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item-newchat:hover {
    background: #6366f1;
    color: white;
}

.menu-item-newchat .icon-blue {
    color: inherit;
}

/* Chat window */
.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: transparent;
}

/* Chat messages */
.chat-message {
    margin-top: 16px;
    animation: fadeInMessage 0.2s ease-in-out;
}

.chat-message.assistant {
    background-color: #fff;
    align-self: flex-start;
    color: var(--text-color);
    width: fit-content;
    max-width: 90%;
    padding: 12px 16px;
    border-radius: 15px;
    border-bottom-left-radius: 0;
    font-size: 15px;
    font-family: var(--font-body);
    line-height: 1.6;
    letter-spacing: 0.3px;
    box-shadow: 0px 2px 6px rgba(122, 122, 122, 0.1);
    border-left: 3px solid rgba(102, 126, 234, 0.25);
    word-wrap: break-word;
    transition: all 0.3s ease-in-out;
}

.chat-message.user {
    background-color: rgb(227, 247, 255);
    align-self: flex-end;
    color: var(--text-color);
    text-align: right;
    margin-left: auto;
    width: fit-content;
    max-width: 85%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-body);
    border-radius: 15px;
    border-bottom-right-radius: 0;
    line-height: 1.6;
    letter-spacing: 0.3px;
    box-shadow: 0px 2px 6px rgba(122, 122, 122, 0.1);
    transition: all 0.3s ease-in-out;
}

/* Loading animation */
.chat-message.loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Chat loading dots - subtle gradient flow effect */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #a474eb 0%, #129ed9 100%);
    border-radius: 50%;
    animation: loading-flow 2s ease-in-out infinite both;
    opacity: 0.4;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.4s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loading-flow {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px) scale(1.1);
    }
}

/* Loading placeholder message glow effect */
.chat-message.assistant.placeholder {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.04) 0%, rgba(18, 158, 217, 0.04) 100%);
    border: 1px solid transparent;
    box-shadow: 0 0 0 1px rgba(164, 116, 235, 0.1);
    animation: messageGlow 2s ease-in-out infinite;
}

@keyframes messageGlow {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(164, 116, 235, 0.15),
                    0 2px 8px rgba(164, 116, 235, 0.08);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(18, 158, 217, 0.2),
                    0 4px 16px rgba(18, 158, 217, 0.12);
    }
}

/* Fade in animation */
@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat input container - Modern gradient style matching onboarding panels */
.chat-input-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.03) 0%, rgba(18, 158, 217, 0.03) 100%);
    border: 1px solid rgba(164, 116, 235, 0.1);
    border-radius: 16px;
    box-shadow: 0 -4px 16px rgba(164, 116, 235, 0.06);
    position: relative;
    transition: all 0.3s ease;
}

/* Loading state - subtle glow effect */
.chat-input-container.loading {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.08) 0%, rgba(18, 158, 217, 0.08) 100%);
    animation: chatInputGlow 2s ease-in-out infinite;
}

@keyframes chatInputGlow {
    0%, 100% {
        box-shadow: 0 -4px 16px rgba(164, 116, 235, 0.12),
                    0 0 20px rgba(164, 116, 235, 0.08);
    }
    50% {
        box-shadow: 0 -4px 20px rgba(18, 158, 217, 0.16),
                    0 0 30px rgba(18, 158, 217, 0.12);
    }
}

.chat-input-container .input-field {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--input-text);
    background: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-input-container .input-field:focus {
    border-color: transparent;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(164, 116, 235, 0.2),
                0 2px 8px rgba(164, 116, 235, 0.1);
}

.chat-input-container.loading .input-field {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.7);
    color: #94a3b8;
    cursor: not-allowed;
}

.chat-input-container .send-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.08) 0%, rgba(18, 158, 217, 0.08) 100%);
    color: #129ed9;
    border: 1px solid rgba(18, 158, 217, 0.2);
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.chat-input-container .send-btn:hover {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.15) 0%, rgba(18, 158, 217, 0.15) 100%);
    border-color: rgba(18, 158, 217, 0.3);
    box-shadow: 0 4px 12px rgba(18, 158, 217, 0.15);
}

.chat-input-container .send-btn:active {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.12) 0%, rgba(18, 158, 217, 0.12) 100%);
}

.chat-input-container.loading .send-btn {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Response formatting styles */
.response-list {
    margin: 12px 0;
    padding-left: 24px;
    list-style: none;
}

.response-bullet {
    position: relative;
    margin: 8px 0;
    padding-left: 8px;
    line-height: 1.6;
}

.response-bullet::before {
    content: "•";
    position: absolute;
    left: -16px;
    color: var(--primary-color);
    font-weight: bold;
}

.response-header {
    margin: 16px 0 8px 0;
    font-weight: 600;
    color: #1f2937;
}

.response-header:first-child {
    margin-top: 0;
}

.response-table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.response-table tbody {
    display: table;
    width: 100%;
}

.response-table tr {
    border-bottom: 1px solid #e5e7eb;
}

.response-table tr:last-child {
    border-bottom: none;
}

.response-table th,
.response-table td {
    padding: 10px 14px;
    text-align: left;
    border-right: 1px solid #e5e7eb;
}

.response-table th:last-child,
.response-table td:last-child {
    border-right: none;
}

.response-table th {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.08) 0%, rgba(18, 158, 217, 0.08) 100%);
    font-weight: 600;
    color: #374151;
}

.response-table td {
    background: #ffffff;
}

.response-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(18, 158, 217, 0.3);
    transition: all 0.2s ease;
}

.response-link:hover {
    border-bottom-color: var(--primary-color);
    color: #0f5c87;
}

.follow-up-question {
    margin: 12px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.06) 0%, rgba(18, 158, 217, 0.06) 100%);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-style: italic;
}

.follow-up-question:hover {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.12) 0%, rgba(18, 158, 217, 0.12) 100%);
    transform: translateX(4px);
}

/* Code styling in messages */
.chat-message code {
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Monaco", "Menlo", monospace;
    font-size: 13px;
    color: var(--primary-color);
}

.chat-message pre {
    background-color: #1e293b;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.chat-message pre code {
    background-color: transparent;
    color: #e2e8f0;
    padding: 0;
}

.chat-message strong {
    font-weight: 600;
    color: #374151;
}

/* Responsive chat styles */
@media (max-width: 768px) {
    .chat-header-3 h2 {
        font-size: 20px;
        max-width: 75%;
    }
    
    .chat-window {
        padding: 12px;
    }
    
    .chat-message.assistant,
    .chat-message.user {
        max-width: 95%;
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .chat-input-container {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .chat-input-container .input-field {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .chat-input-container .send-btn {
        padding: 12px 18px;
        font-size: 13px;
    }
    
    .sidebar-header-newchat {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .chat-interface-wrapper {
        height: calc(100vh - 110px);
    }
    
    .menu-item-newchat {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .chat-input-container {
        padding: 12px 14px;
    }
    
    .chat-input-container .input-field {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .chat-input-container .send-btn {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
    }
    
    .chat-input-container .send-btn i {
        font-size: 12px;
    }
}

/* ========== END MESHAI CHAT STYLES ========== */



/* ========== BILLING SECTION STYLES ========== */

/* Billing Card */
.billing-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.billing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Removed brand-specific border colors on hover - now using colored buttons instead */

.billing-card[data-tag]::before {
    content: attr(data-tag);
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--color-gradient);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.billing-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.billing-card > p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 16px;
}

.billing-card h4 {
    font-size: 40px;
    font-weight: 800;
    color: #111827;
    margin: 16px 0 4px 0;
}

.billing-card h4 + p {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 24px;
}

.billing-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    flex-grow: 1;
}

.billing-card ul li {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.billing-card ul li:last-child {
    border-bottom: none;
}

.billing-card ul li i {
    color: #10b981;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.billing-card ul li.not-included {
    opacity: 0.5;
}

.billing-card ul li.not-included i {
    color: #ef4444;
}

.billing-card ul li.not-included span {
    text-decoration: line-through;
}

/* Special feature highlights */
.autolist-feature i,
.ugc-video-feature i,
.meshfeed-bonus-feature i,
.competitor-tracking-feature i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Price per product */
.billing-card-price-per-product {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 20px;
}

/* Add Plan Button - High specificity to ensure it applies */
.billing-card .apply-rules-button,
.apply-rules-button {
    width: 100% !important;
    padding: 14px 24px !important;
    background: var(--color-gradient) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

.billing-card .apply-rules-button:hover,
.apply-rules-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4) !important;
}

.billing-card .apply-rules-button:active,
.apply-rules-button:active {
    transform: translateY(0) !important;
}

.billing-card .apply-rules-button i,
.apply-rules-button i {
    font-size: 14px !important;
    color: white !important;
}

/* Brand-specific button colors for each feature */
#product-lister-plans .billing-card .apply-rules-button {
    background: linear-gradient(135deg, #52d1a0 0%, #3ab88a 100%) !important;
}

#product-lister-plans .billing-card .apply-rules-button:hover {
    box-shadow: 0 8px 24px rgba(82, 209, 160, 0.4) !important;
}

#feed-management-plans .billing-card .apply-rules-button {
    background: linear-gradient(135deg, #419fec 0%, #2a8dd9 100%) !important;
}

#feed-management-plans .billing-card .apply-rules-button:hover {
    box-shadow: 0 8px 24px rgba(65, 159, 236, 0.4) !important;
}

#ad-campaigns-plans .billing-card .apply-rules-button {
    background: linear-gradient(135deg, #ff7547 0%, #ff5722 100%) !important;
}

#ad-campaigns-plans .billing-card .apply-rules-button:hover {
    box-shadow: 0 8px 24px rgba(255, 117, 71, 0.4) !important;
}

/* Billing content layout */
.billing-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Feature selector - Billing Section */
#billingSection .feature-selector {
    margin: 48px auto 40px;
    max-width: 1200px;
    padding: 0 20px;
}

#billingSection .feature-selector h3 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    text-align: center;
}

#billingSection .feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

#billingSection .feature-card {
    position: relative;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 120px;
}

#billingSection .feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 14px 14px 0 0;
    display: block !important;
}

#billingSection .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
}

#billingSection .feature-card.active {
    background: #ffffff !important;
    border-width: 2px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.06);
}

#billingSection .feature-card.active::before {
    opacity: 1;
}

/* Brand-specific styling for billing feature cards */
#billingSection .feature-card-meshlist.active {
    border-color: #52d1a0;
}

#billingSection .feature-card-meshlist.active::before {
    background: linear-gradient(90deg, #52d1a0 0%, #3ab88a 100%);
}

#billingSection .feature-card-meshlist:hover:not(.active) {
    border-color: rgba(82, 209, 160, 0.3);
}

#billingSection .feature-card-meshfeed.active {
    border-color: #419fec;
}

#billingSection .feature-card-meshfeed.active::before {
    background: linear-gradient(90deg, #419fec 0%, #2a8dd9 100%);
}

#billingSection .feature-card-meshfeed:hover:not(.active) {
    border-color: rgba(65, 159, 236, 0.3);
}

#billingSection .feature-card-meshads.active {
    border-color: #ff7547;
}

#billingSection .feature-card-meshads.active::before {
    background: linear-gradient(90deg, #ff7547 0%, #ff5722 100%);
}

#billingSection .feature-card-meshads:hover:not(.active) {
    border-color: rgba(255, 117, 71, 0.3);
}

#billingSection .feature-card-logo {
    height: 32px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 12px;
    display: block;
    transition: transform 0.3s ease;
    object-fit: contain;
    object-position: center;
}

#billingSection .feature-card:hover .feature-card-logo {
    transform: scale(1.05);
}

#billingSection .feature-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

#billingSection .feature-card h4 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

#billingSection .feature-card p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
    align-self: stretch;
}

#billingSection .feature-card.active p {
    color: #374151;
}

/* Current plan card */
/* Billing Header with Compact Info */
.billing-header-with-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 32px;
}

.billing-header-left {
    flex: 1;
}

.billing-header-right {
    flex-shrink: 0;
}

.billing-quick-info {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.billing-info-item {
    text-align: center;
}

.billing-info-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 6px;
}

.billing-info-value {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.billing-info-divider {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
}

/* Legacy billing-current-plan - hidden by default */
.billing-current-plan {
    display: none;
}

/* Discount section */
.discount-section {
    background: #f8fafb;
    border-radius: 12px;
    padding: 24px;
    margin: 24px auto;
    border: 1px solid #e1e6f0;
    max-width: 600px;
}

.discount-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}

.discount-input-group {
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.discount-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.discount-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.discount-message {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 14px;
}

.discount-success {
    margin-top: 12px;
    padding: 12px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    font-size: 14px;
}

/* Responsive billing cards */
@media (max-width: 768px) {
    .billing-content {
        grid-template-columns: 1fr;
    }
    
    .billing-card {
        padding: 24px;
    }
    
    /* Mobile: Stack billing header vertically */
    .billing-header-with-info {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .billing-header-right {
        width: 100%;
    }
    
    .billing-quick-info {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        gap: 16px;
    }
    
    .billing-info-label {
        font-size: 10px;
    }
    
    .billing-info-value {
        font-size: 16px;
    }
    
    .billing-info-divider {
        height: 32px;
    }
    
    #billingSection .feature-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    #billingSection .feature-card {
        padding: 24px 18px;
    }
    
    #billingSection .feature-card-logo {
        height: 28px;
    }
}
  
  /* ========== END BILLING SECTION STYLES ========== */
  
  /* ========== AI RESPONSE FORMATTING STYLES (defined in chat section above) ========== */

  /* ========== SUBSCRIPTION PLAN CARD SIDEBAR ========== */
  
  .sidebar-footer-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
  }
  
  .sidebar-footer-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
  }
  
  .sidebar-plan-row {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
  }
  
  .sidebar-plan-item {
    flex: 1;
    text-align: center;
  }
  
  .sidebar-plan-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    font-weight: 600;
    margin-bottom: 6px;
  }
  
  .sidebar-plan-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  
  .sidebar-plan-value img {
    width: 14px;
    height: 14px;
  }
  
  /* Billing page current plan icons - match sidebar size */
  #billingCurrentPlanLabel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  #billingCurrentPlanLabel img {
    width: 20px;
    height: 20px;
    object-fit: contain;
  }
  
  .sidebar-plan-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
    flex-shrink: 0;
  }
  
  /* ========== END SUBSCRIPTION PLAN CARD STYLES ========== */

  /* ========== STATUS ALERT BANNERS (SUBSCRIPTION & CONNECTION) ========== */
  
  .status-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    animation: slideInDown 0.3s ease;
  }
  
  @keyframes slideInDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .status-alert.warning {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%);
    border: 1px solid rgba(164, 116, 235, 0.2);
    box-shadow: 0 0 0 1px rgba(164, 116, 235, 0.1), 0 2px 8px rgba(164, 116, 235, 0.06);
    color: #111827;
  }
  
  .status-alert.warning .status-alert-icon {
    color: #8b5cf6;
  }
  
  .status-alert.warning .status-alert-btn {
    border-color: rgba(139, 92, 246, 0.4);
    color: #7c3aed;
  }
  
  .status-alert.warning .status-alert-btn:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
  }
  
  .status-alert.error {
    background: #f8fafc;
    border-color: #e5e7eb;
    color: #111827;
  }
  
  .status-alert.info {
    background: #f8fafc;
    border-color: #e5e7eb;
    color: #111827;
  }
  
  /* Credits/subscription needed - subtle purple like connection onboarding */
  .status-alert.credits-needed {
    background: linear-gradient(135deg, rgba(164, 116, 235, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%);
    border: 1px solid rgba(164, 116, 235, 0.2);
    box-shadow: 0 0 0 1px rgba(164, 116, 235, 0.1), 0 2px 8px rgba(164, 116, 235, 0.06);
    color: #111827;
  }
  
  .status-alert.credits-needed .status-alert-icon {
    color: #8b5cf6;
  }
  
  .status-alert.credits-needed .status-alert-btn {
    border-color: rgba(139, 92, 246, 0.4);
    color: #7c3aed;
  }
  
  .status-alert.credits-needed .status-alert-btn:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
  }
  
  .status-alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
  }
  
  .status-alert-content {
    flex: 1;
  }
  
  .status-alert-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 6px;
    color: #111827;
  }
  
  .status-alert-message {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.5;
  }
  
  .status-alert-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
  }
  
  .status-alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
  }
  
  .status-alert-btn:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
  }
  
  .status-alert-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
  }
  
  .status-alert-close:hover {
    opacity: 1;
  }
  
  /* ========== END STATUS ALERT BANNERS ========== */
  
  /* ========== LIBRARY ITEM STYLES ========== */
  
  .library-item {
      position: relative;
      border-radius: 12px;
      overflow: hidden;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      transition: all 0.3s ease;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  
  .library-item:hover {
      border-color: var(--primary-color);
      box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
      transform: translateY(-2px);
  }
  
  .library-item-media {
      aspect-ratio: 1;
      overflow: hidden;
      background: #f1f5f9;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
  }
  
  .library-item-preview {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
  }
  
  .library-item-info {
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
  }
  
  .library-item-type {
      font-weight: 600;
      font-size: 12px;
      color: var(--primary-color);
      text-transform: uppercase;
      letter-spacing: 0.5px;
  }
  
  .library-item-date {
      font-size: 12px;
      color: #94a3b8;
  }
  
  .library-item-prompt {
      font-size: 12px;
      color: #64748b;
      line-height: 1.3;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      margin-top: 4px;
  }
  
  .library-item-actions {
      display: flex;
      gap: 8px;
      padding: 8px 12px;
      border-top: 1px solid #f1f5f9;
      opacity: 0;
      transition: opacity 0.2s ease;
  }
  
  .library-item:hover .library-item-actions {
      opacity: 1;
  }
  
  .library-action-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 6px;
      border: none;
      background: #f1f5f9;
      color: #475569;
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;
  }
  
  .library-action-btn:hover {
      background: var(--primary-color);
      color: #fff;
  }
  
  .library-action-btn.delete:hover {
      background: #ef4444;
  }
  
  .library-action-btn svg {
      stroke-width: 2;
      width: 14px;
      height: 14px;
  }
  
  /* Grid layout for library */
  .library-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 16px;
      padding: 0;
  }
  
  @media (min-width: 1280px) {
      .library-grid {
          grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      }
  }
  
  @media (max-width: 768px) {
      .library-grid {
          grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
          gap: 12px;
      }
  }
  
  /* ========== END LIBRARY ITEM STYLES ========== */
  
  /* ========== RULE TEMPLATES STYLING ========== */
  
  /* Rule Templates Section - Clean Modern Style */
  .rule-templates-section {
      animation: slideInFromTop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      background: white;
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      padding: 0;
      margin-bottom: 24px;
      overflow: hidden;
  }
  
  .rules-templates-header {
      padding: 16px 20px;
      background: #f8fafc;
      border-bottom: 1px solid #e5e7eb;
  }
  
  #meshfeedTemplatesList,
  #adTemplatesList {
      padding: 20px;
  }
  
  @keyframes slideInFromTop {
      from {
          opacity: 0;
          transform: translateY(-10px);
      }
      to {
          opacity: 1;
          transform: translateY(0);
      }
  }
  
  .template-filter-btn {
      padding: 8px 14px;
      background: white;
      border: 1px solid #e2e8f0;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 600;
      color: #475569;
      cursor: pointer;
      transition: all 0.2s ease;
  }
  
  .template-filter-btn:hover {
      border-color: #cbd5e1;
      background: #f1f5f9;
  }
  
  .template-filter-btn.active {
      background: var(--primary-color);
      border-color: var(--primary-color);
      color: white;
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  }
  
  .templates-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
      margin-top: 12px;
  }
  
  .template-card {
      padding: 14px;
      background: white;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      cursor: pointer;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }
  
  .template-card:hover {
      border-color: #cbd5e1;
      transform: translateY(-2px);
      box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  }

  .template-card.ad-template-card:hover {
      border-color: #f97316;
      box-shadow: 0 10px 18px rgba(249, 115, 22, 0.16);
  }

  .template-card.meshfeed-template-card:hover {
      border-color: #3b82f6;
      box-shadow: 0 10px 18px rgba(59, 130, 246, 0.16);
  }
  
  .template-card-name {
      font-size: 13px;
      font-weight: 600;
      color: #1e293b;
      margin-bottom: 6px;
  }
  
  .template-card-description {
      font-size: 11px;
      color: #64748b;
      line-height: 1.4;
  }
  
  .template-card-category {
      display: inline-block;
      padding: 2px 8px;
      background: #f1f5f9;
      color: #475569;
      font-size: 10px;
      font-weight: 600;
      border-radius: 999px;
      margin-top: 8px;
  }
  
  /* ========== END RULE TEMPLATES STYLING ========== */
  
  /* ========== MODERN UI/UX IMPROVEMENTS ========== */
  
  /* Toast Notification System */
  .toast-container {
      position: fixed;
      top: 24px;
      right: 24px;
      z-index: 10000;
      display: flex;
      flex-direction: column;
      gap: 12px;
      pointer-events: none;
  }

  .toast {
      background: white;
      padding: 16px 20px;
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.15);
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 320px;
      animation: slideInRight 0.3s ease;
      pointer-events: auto;
  }

  .toast.success { 
      border-left: 4px solid #10b981;
  }

  .toast.error { 
      border-left: 4px solid #ef4444;
  }

  .toast.info { 
      border-left: 4px solid var(--primary-color);
  }
  
  .toast.warning { 
      border-left: 4px solid #f59e0b;
  }

  .toast-icon {
      font-size: 20px;
      font-weight: bold;
      flex-shrink: 0;
  }

  .toast.success .toast-icon { color: #10b981; }
  .toast.error .toast-icon { color: #ef4444; }
  .toast.info .toast-icon { color: var(--primary-color); }
  .toast.warning .toast-icon { color: #f59e0b; }

  .toast-message {
      font-size: 14px;
      color: var(--text-color);
      flex: 1;
  }

  @keyframes slideInRight {
      from {
          transform: translateX(400px);
          opacity: 0;
      }
      to {
          transform: translateX(0);
          opacity: 1;
      }
  }

  @keyframes slideOutRight {
      from {
          transform: translateX(0);
          opacity: 1;
      }
      to {
          transform: translateX(400px);
          opacity: 0;
      }
  }

  /* Skeleton Loaders */
  .skeleton {
      background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
      border-radius: 8px;
      height: 20px;
  }

  .skeleton.text {
      height: 20px;
      margin-bottom: 8px;
  }

  .skeleton.text.large {
      height: 32px;
      margin-bottom: 12px;
  }

  .skeleton.avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
  }

  .skeleton.card {
      height: 120px;
      border-radius: 12px;
  }

  @keyframes shimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
  }

  /* Button Loading States */
  .btn-primary.loading,
  .btn-secondary.loading,
  .action-button.loading {
      position: relative;
      color: transparent !important;
      pointer-events: none;
      opacity: 0.9;
  }

  .btn-primary.loading::after,
  .btn-secondary.loading::after,
  .action-button.loading::after {
      content: '';
      position: absolute;
      width: 16px;
      height: 16px;
      top: 50%;
      left: 50%;
      margin-left: -8px;
      margin-top: -8px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
  }

  .btn-secondary.loading::after,
  .action-button.secondary.loading::after {
      border: 2px solid rgba(79, 70, 229, 0.3);
      border-top-color: var(--primary-color);
  }

  @keyframes spin {
      to { transform: rotate(360deg); }
  }

  /* Empty States */
  .empty-state {
      text-align: center;
      padding: 60px 20px;
      background: linear-gradient(135deg, rgba(79, 70, 229, 0.02) 0%, rgba(16, 185, 129, 0.02) 100%);
      border-radius: 16px;
      margin: 20px 0;
  }

  .empty-state-icon {
      font-size: 64px;
      margin-bottom: 16px;
      display: inline-block;
  }

  .empty-state h3 {
      font-size: 20px;
      font-weight: 600;
      color: var(--text-color);
      margin-bottom: 8px;
  }

  .empty-state p {
      font-size: 14px;
      color: var(--text-secondary);
      margin-bottom: 24px;
      max-width: 400px;
      margin-left: auto;
      margin-right: auto;
  }

  .empty-state .btn-primary {
      margin: 0 auto;
  }

  /* Form Validation Feedback */
  .form-field.error input,
  .form-field.error textarea,
  .form-field.error select {
      border-color: #ef4444 !important;
      background-color: rgba(239, 68, 68, 0.02);
  }

  .form-field.success input,
  .form-field.success textarea,
  .form-field.success select {
      border-color: #10b981 !important;
      background-color: rgba(16, 185, 129, 0.02);
  }

  .form-error-message {
      color: #ef4444;
      font-size: 12px;
      margin-top: 4px;
      display: flex;
      align-items: center;
      gap: 4px;
  }

  .form-success-message {
      color: #10b981;
      font-size: 12px;
      margin-top: 4px;
      display: flex;
      align-items: center;
      gap: 4px;
  }

  .form-field input:focus,
  .form-field textarea:focus,
  .form-field select:focus {
      outline: none;
      border-color: var(--primary-color);
  }

  /* Character Counter */
  .char-counter {
      font-size: 12px;
      color: var(--text-secondary);
      text-align: right;
      margin-top: 4px;
  }

  .char-counter.warning {
      color: #f59e0b;
  }

  .char-counter.error {
      color: #ef4444;
  }

  /* Status Badges */
  .badge {
      display: inline-block;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
  }

  .badge.success {
      background-color: rgba(16, 185, 129, 0.1);
      color: #10b981;
  }

  .badge.warning {
      background-color: rgba(245, 158, 11, 0.1);
      color: #f59e0b;
  }

  .badge.error {
      background-color: rgba(239, 68, 68, 0.1);
      color: #ef4444;
  }

  .badge.info {
      background-color: rgba(79, 70, 229, 0.1);
      color: var(--primary-color);
  }

  /* Progress Indicators */
  .progress-bar {
      width: 100%;
      height: 8px;
      background-color: #e5e7eb;
      border-radius: 4px;
      overflow: hidden;
      margin: 12px 0;
  }

  .progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--primary-color), #6366f1);
      transition: width 0.3s ease;
      border-radius: 4px;
  }

  .progress-text {
      font-size: 12px;
      color: var(--text-secondary);
      display: flex;
      justify-content: space-between;
      margin-top: 4px;
  }

  /* Connection Status Indicator */
  .status-indicator {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
  }

  .status-indicator::before {
      content: '';
      width: 8px;
      height: 8px;
      border-radius: 50%;
      animation: pulse 2s ease-in-out infinite;
  }

  .status-indicator.connected {
      background-color: rgba(16, 185, 129, 0.1);
      color: #10b981;
  }

  .status-indicator.connected::before {
      background-color: #10b981;
  }

  .status-indicator.disconnected {
      background-color: rgba(239, 68, 68, 0.1);
      color: #ef4444;
  }

  .status-indicator.disconnected::before {
      background-color: #ef4444;
      animation: none;
  }

  .status-indicator.syncing {
      background-color: rgba(245, 158, 11, 0.1);
      color: #f59e0b;
  }

  .status-indicator.syncing::before {
      background-color: #f59e0b;
      animation: spin 1s linear infinite;
  }

  @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
  }

  /* Tooltip */
  .tooltip {
      position: relative;
      display: inline-block;
  }

  .tooltip .tooltiptext {
      visibility: hidden;
      width: 200px;
      background-color: #374151;
      color: #fff;
      text-align: center;
      border-radius: 6px;
      padding: 8px;
      position: absolute;
      z-index: 1000;
      bottom: 125%;
      left: 50%;
      margin-left: -100px;
      opacity: 0;
      transition: opacity 0.3s;
      font-size: 12px;
  }

  .tooltip .tooltiptext::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      margin-left: -5px;
      border-width: 5px;
      border-style: solid;
      border-color: #374151 transparent transparent transparent;
  }

  .tooltip:hover .tooltiptext {
      visibility: visible;
      opacity: 1;
  }

  /* Mobile optimizations */
  @media (max-width: 768px) {
      .toast {
          min-width: 280px;
          font-size: 13px;
      }

      .empty-state {
          padding: 40px 16px;
      }

      .empty-state-icon {
          font-size: 48px;
      }

      .empty-state h3 {
          font-size: 18px;
      }
  }

  /* ========== END MODERN UI/UX IMPROVEMENTS ========== */

  /* ========== BULK FIELD GENERATION MODAL ========== */
  
  #bulkFieldGenerationModal .modal-content {
      padding: 24px;
      max-width: 900px;
  }

  .bulk-gen-step.active {
      background: #f0f9ff !important;
      border-color: #129ed9 !important;
  }

  .bulk-gen-step.active div:first-child {
      color: #129ed9 !important;
  }

  .bulk-gen-field-checkbox {
      cursor: pointer;
      accent-color: #8b5cf6;
  }

  #bulkGenFieldsList label {
      transition: all 0.2s ease;
  }

  #bulkGenFieldsList label:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  #bulkGenFieldsList input:checked + div {
      color: #8b5cf6;
  }

  #bulkGenActivityLog {
      font-family: 'Courier New', Courier, monospace;
  }

  #bulkGenProgressBar {
      transition: width 0.5s ease;
  }

  /* Responsive adjustments for bulk gen modal */
  @media (max-width: 768px) {
      #bulkFieldGenerationModal .modal-content {
          max-width: 95%;
          padding: 16px;
      }

      .bulk-gen-steps {
          flex-direction: column;
          gap: 8px !important;
      }

      .bulk-gen-step {
          padding: 8px !important;
      }

      #bulkGenFieldsList {
          grid-template-columns: 1fr !important;
      }

      #bulkGenSummary {
          grid-template-columns: repeat(2, 1fr) !important;
      }

      .modal-footer {
          flex-direction: column;
          gap: 12px;
      }

      .modal-footer > div:first-child {
          width: 100%;
          text-align: center;
      }

      .modal-footer > div:last-child {
          width: 100%;
          flex-direction: column;
      }

      .modal-footer button {
          width: 100%;
      }
  }

  /* ========== END BULK FIELD GENERATION MODAL ========== */
  
  /* ========== CONNECTION REQUIREMENTS & ONBOARDING ========== */
  
  /* Connection Modal Styles */
  .connections-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
  }
  
  .connection-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      background: #f8f9fa;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      transition: all 0.2s;
  }
  
  .connection-item.connected {
      background: #f0fdf4;
      border-color: #10b981;
  }
  
  .connection-item.connected .connection-icon {
      color: #10b981;
  }
  
  .connection-item.connected .connection-status {
      color: #10b981;
  }
  
  .connections-list .connection-icon {
      font-size: 20px;
      color: #ef4444;
      min-width: 24px;
      text-align: center;
  }
  
  .connection-info {
      flex: 1;
  }
  
  .connection-name {
      font-weight: 600;
      font-size: 14px;
      color: #374151;
  }
  
  .connection-status {
      font-size: 12px;
      color: #ef4444;
      margin-top: 2px;
  }
  
  /* Onboarding Modal Styles */
  .onboarding-modal {
      max-height: 85vh;
      overflow-y: auto;
  }
  
  .steps-indicator {
      display: flex;
      gap: 8px;
      justify-content: center;
      margin-bottom: 24px;
      padding-bottom: 16px;
  }
  
  .step-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #e5e7eb;
      cursor: pointer;
      transition: all 0.2s;
  }
  
  .step-dot.active {
      background: var(--primary-color);
      width: 32px;
      border-radius: 6px;
  }
  
  .onboarding-body {
      min-height: 400px;
  }
  
  .onboarding-steps {
      display: flex;
      flex-direction: column;
  }
  
  .onboarding-step {
      display: none;
      animation: fadeIn 0.3s ease-in;
  }
  
  .onboarding-step:first-child {
      display: block;
  }
  
  @keyframes fadeIn {
      from {
          opacity: 0;
          transform: translateY(10px);
      }
      to {
          opacity: 1;
          transform: translateY(0);
      }
  }
  
  .step-number {
      display: inline-block;
      width: 32px;
      height: 32px;
      background: var(--primary-color);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      margin-bottom: 12px;
  }
  
  .step-content h3 {
      margin: 0 0 8px 0;
      font-size: 18px;
      color: #374151;
  }
  
  .step-content p {
      margin: 0 0 12px 0;
      color: #6b7280;
      line-height: 1.6;
  }
  
  .step-details {
      background: #f0f9ff;
      padding: 12px;
      border-radius: 6px;
      border-left: 3px solid var(--primary-color);
      font-size: 13px;
      color: #6b7280;
      margin: 12px 0;
  }
  
  .step-image {
      max-width: 100%;
      height: auto;
      border-radius: 8px;
      margin: 12px 0;
      max-height: 300px;
      object-fit: cover;
  }
  
  .step-actions {
      display: flex;
      gap: 8px;
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid #e5e7eb;
  }
  
  .step-actions .btn {
      flex: 1;
  }
  
  /* ========== END CONNECTION REQUIREMENTS & ONBOARDING ========== */
  
  

/* ========== BILLING PAGE RESPONSIVE STYLES ========== */

/* Make promo input responsive */
@media (max-width: 640px) {
    #meshlistDiscountCode {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Placeholder styling for discount code input */
#meshlistDiscountCode::placeholder {
    color: #9ca3af;
}


/* ========== ONBOARDING MODAL STYLES ========== */

.onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999998;
    animation: fadeIn 0.3s ease-out;
}

.onboarding-container {
    position: relative;
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    z-index: 999999;
}

.onboarding-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 10;
}

.onboarding-close:hover {
    background: transparent;
    color: #374151;
    transform: scale(1.1);
}

/* Progress Indicators */
.onboarding-progress {
    display: flex;
    gap: 8px;
    padding: 24px 32px 16px;
    justify-content: center;
}

.progress-step {
    height: 4px;
    flex: 1;
    background: #e5e7eb;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
}

.progress-step.completed {
    background: #10b981;
}

/* Content */
.onboarding-content {
    padding: 24px 32px 32px;
    flex: 1;
    overflow-y: auto;
}

.onboarding-step {
    text-align: center;
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-icon {
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
}

.onboarding-icon img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.onboarding-step h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    line-height: 1.2;
}

.onboarding-description {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Checklist */
.onboarding-checklist {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 32px auto 0;
}

.onboarding-checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 15px;
    color: #374151;
}

.onboarding-checklist li i {
    color: #10b981;
    font-size: 18px;
    flex-shrink: 0;
}

/* Feature List */
.onboarding-feature-list {
    list-style: none;
    text-align: left;
    max-width: 500px;
    margin: 32px auto 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.onboarding-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.onboarding-feature-list li:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.onboarding-feature-list li i {
    color: #129ed9;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.onboarding-feature-list li div {
    flex: 1;
}

.onboarding-feature-list li strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.onboarding-feature-list li span {
    display: block;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Visual Card */
.onboarding-visual {
    margin: 32px auto;
    max-width: 400px;
}

.visual-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #f3f4f6 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
}

.visual-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #129ed9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.visual-text {
    flex: 1;
    text-align: left;
}

.visual-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.visual-text span {
    display: block;
    font-size: 13px;
    color: #6b7280;
}

/* Onboarding Button */
.btn-onboarding {
    margin-top: 32px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Navigation */
.onboarding-navigation {
    padding: 24px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    background: #fafbfc;
    border-radius: 0 0 24px 24px;
}

.onboarding-nav-buttons {
    display: flex;
    gap: 12px;
}

.onboarding-navigation .btn-ghost {
    color: #6b7280;
    padding: 10px 16px;
    font-size: 14px;
}

.onboarding-navigation .btn-ghost:hover {
    color: #374151;
    background: #f3f4f6;
}

.onboarding-navigation .btn-primary,
.onboarding-navigation .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .onboarding-modal {
        padding: 0;
    }

    .onboarding-container {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .onboarding-close {
        top: 12px;
        right: 12px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        width: 32px;
        height: 32px;
    }

    .onboarding-progress {
        padding: 16px 12px 12px;
        flex-shrink: 0;
    }

    .onboarding-content {
        padding: 16px 12px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .onboarding-step h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .onboarding-description {
        font-size: 14px;
    }

    .onboarding-icon {
        margin-bottom: 16px;
    }

    .onboarding-icon img {
        width: 80px;
        height: 80px;
    }

    .onboarding-navigation {
        padding: 12px;
        flex-direction: column;
        gap: 10px;
        flex-shrink: 0;
        background: #fafbfc;
    }

    .onboarding-nav-buttons {
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .onboarding-navigation .btn-primary,
    .onboarding-navigation .btn-secondary,
    .onboarding-navigation .btn-ghost {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }

    .onboarding-feature-list {
        gap: 12px;
    }

    .onboarding-feature-list li {
        padding: 10px;
        font-size: 14px;
    }

    .btn-onboarding {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
    }

    .onboarding-visual {
        margin: 20px 0;
    }

    .visual-card {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .onboarding-step h2 {
        font-size: 22px;
    }

    .onboarding-description {
        font-size: 14px;
    }

    .onboarding-feature-list li i {
        font-size: 20px;
    }

    .onboarding-feature-list li strong {
        font-size: 14px;
    }

    .onboarding-feature-list li span {
        font-size: 13px;
    }
}

/* ========== END ONBOARDING MODAL STYLES ========== */

/* ========== SWEETALERT2 Z-INDEX OVERRIDE ========== */
/* Ensure SweetAlert modals appear above everything including settings modal (z-index: 10000) */
.swal-above-modal-container {
    z-index: 10100 !important;
}

.swal-above-modal {
    z-index: 10101 !important;
}

.swal2-container {
    z-index: 10100 !important;
}

/* Ensure backdrop appears above settings modal but below popup */
.swal2-container.swal2-backdrop-show {
    z-index: 10100 !important;
}

.swal2-popup {
    z-index: 10101 !important;
}
/* ========== END SWEETALERT2 Z-INDEX OVERRIDE ========== */

/* ========== SHOPIFY STEP WIZARD ========== */
.shopify-wizard-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 20px;
}

.wizard-step-indicator {
    display: flex;
    align-items: center;
    flex-direction: column;
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wizard-step-indicator:hover .wizard-step-number {
    transform: scale(1.1);
}

.wizard-step-indicator:hover .wizard-step-label {
    color: #0369a1;
}

.wizard-step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.wizard-step-indicator.completed:not(:last-child)::after {
    background: #10b981;
}

.wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    font-size: 16px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.wizard-step-indicator.active .wizard-step-number {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.wizard-step-indicator.completed .wizard-step-number {
    background: #10b981;
    color: white;
}

.wizard-step-indicator.completed .wizard-step-number {
    font-size: 0;
}

.wizard-step-indicator.completed .wizard-step-number::before {
    content: '✓';
    font-size: 20px;
}

.wizard-step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

.wizard-step-indicator.active .wizard-step-label {
    color: #0369a1;
    font-weight: 600;
}

.wizard-step-indicator.completed .wizard-step-label {
    color: #10b981;
}

.wizard-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-navigation {
    padding: 24px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.wizard-nav-buttons {
    display: flex;
    gap: 12px;
}

.wizard-navigation .btn-secondary,
.wizard-navigation .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wizard-step-info {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .shopify-wizard-progress {
        padding: 0 10px;
    }
    
    .wizard-step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .wizard-step-label {
        font-size: 11px;
        max-width: 60px;
    }
    
    .wizard-navigation {
        padding: 12px;
        flex-direction: column;
        gap: 10px;
        background: #fafbfc;
    }
    
    .wizard-nav-buttons {
        width: 100%;
        display: flex;
        gap: 10px;
    }
    
    .wizard-navigation .btn-primary,
    .wizard-navigation .btn-secondary {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .wizard-step-info {
        font-size: 13px;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wizard-step-label {
        display: none;
    }
}
/* ========== END SHOPIFY STEP WIZARD ========== */
