/* Advanced List Block Frontend Styles */
.advanced-list-container {
    margin: 20px 0;
    padding: 0;
}

.advanced-list-item {
    opacity: 0;
    animation-fill-mode: forwards;
    animation-duration: 0.6s;
    padding: 8px 0;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    line-height: 1.6;
    /* Ensure proper touch handling */
    touch-action: manipulation;
}

/* Bullet points based on style and indent level */
.advanced-list-item::before {
    flex-shrink: 0;
    margin-top: 2px;
    font-weight: bold;
    margin-right: var(--bullet-spacing, 12px);
}

/* Bullet content based on data attributes */
.advanced-list-container[data-bullet-style="dot"] .advanced-list-item::before {
    content: "•";
}

.advanced-list-container[data-bullet-style="circle"] .advanced-list-item::before {
    content: "◦";
}

.advanced-list-container[data-bullet-style="square"] .advanced-list-item::before {
    content: "▪";
}

.advanced-list-container[data-bullet-style="arrow"] .advanced-list-item::before {
    content: "→";
}

.advanced-list-container[data-bullet-style="chevron"] .advanced-list-item::before {
    content: "›";
}

.advanced-list-container[data-bullet-style="check"] .advanced-list-item::before {
    content: "✓";
}

.advanced-list-container[data-bullet-style="star"] .advanced-list-item::before {
    content: "★";
}

.advanced-list-container[data-bullet-style="heart"] .advanced-list-item::before {
    content: "♥";
}

.advanced-list-container[data-bullet-style="diamond"] .advanced-list-item::before {
    content: "♦";
}

.advanced-list-container[data-bullet-style="none"] .advanced-list-item::before {
    content: "";
    margin-right: 0;
}

/* Numbers style is handled by JavaScript */
.advanced-list-container[data-bullet-style="numbers"] .advanced-list-item::before {
    content: attr(data-number);
}

/* Indent level variations for dot style only */
.advanced-list-container[data-bullet-style="dot"] .advanced-list-item[data-indent="1"]::before {
    content: "◦";
}

.advanced-list-container[data-bullet-style="dot"] .advanced-list-item[data-indent="2"]::before {
    content: "▪";
}

.advanced-list-container[data-bullet-style="dot"] .advanced-list-item[data-indent="3"]::before {
    content: "▫";
}

.advanced-list-container[data-bullet-style="dot"] .advanced-list-item[data-indent="4"]::before {
    content: "‣";
}

.advanced-list-container[data-bullet-style="dot"] .advanced-list-item[data-indent="5"]::before {
    content: "⁃";
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations based on container class */
.advanced-list-container.fadeIn .advanced-list-item {
    animation-name: fadeIn;
}

.advanced-list-container.slideInLeft .advanced-list-item {
    animation-name: slideInLeft;
}

.advanced-list-container.slideInRight .advanced-list-item {
    animation-name: slideInRight;
}

.advanced-list-container.bounceIn .advanced-list-item {
    animation-name: bounceIn;
}

.advanced-list-container.zoomIn .advanced-list-item {
    animation-name: zoomIn;
}

/* Hover effects - only on non-touch devices */
@media (hover: hover) {
    .advanced-list-container[data-enable-hover="true"] .advanced-list-item:hover {
        transform: translateX(8px);
        border-radius: 4px;
        transition: all 0.3s ease;
    }
    
    /* Dynamic hover colors set by JavaScript */
    .advanced-list-container[data-enable-hover="true"] .advanced-list-item.hover-active {
        transform: translateX(8px);
        border-radius: 4px;
    }
}

/* Animation trigger class */
.advanced-list-container.animate .advanced-list-item {
    animation-play-state: running;
}

/* Initially pause animations until triggered */
.advanced-list-container .advanced-list-item {
    animation-play-state: paused;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .advanced-list-item {
        padding: 6px 0;
        /* Remove transforms on mobile to prevent touch issues */
        transform: none !important;
        transition: none !important;
    }
    
    .advanced-list-item::before {
        margin-right: 8px;
    }
    
    /* Disable hover effects on mobile */
    .advanced-list-container[data-enable-hover="true"] .advanced-list-item:hover {
        transform: none !important;
        background-color: transparent !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    .advanced-list-container[data-enable-hover="true"] .advanced-list-item.hover-active {
        transform: none !important;
        background-color: transparent !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .advanced-list-item {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Link styling in frontend */
.advanced-list-item a {
    color: inherit;
    text-decoration: inherit;
    transition: opacity 0.2s ease;
    /* Ensure links are clickable on touch devices */
    pointer-events: auto;
    touch-action: manipulation;
    position: relative;
    z-index: 1;
    /* Minimum touch target size for iOS */
    min-height: 44px;
    min-width: 44px;
    display: inline-block;
}

.advanced-list-item a:hover {
    opacity: 0.8;
}

.advanced-list-item a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Override default link underlines when text decoration is set to none */
.advanced-list-item[style*="text-decoration: none"] a,
.advanced-list-item[style*="text-decoration:none"] a {
    text-decoration: none !important;
}

/* Ensure other text decorations are preserved for links */
.advanced-list-item[style*="text-decoration: underline"] a,
.advanced-list-item[style*="text-decoration:underline"] a {
    text-decoration: underline;
}

.advanced-list-item[style*="text-decoration: overline"] a,
.advanced-list-item[style*="text-decoration:overline"] a {
    text-decoration: overline;
}

.advanced-list-item[style*="text-decoration: line-through"] a,
.advanced-list-item[style*="text-decoration:line-through"] a {
    text-decoration: line-through;
}

/* Rich text formatting support */
.advanced-list-item strong {
    font-weight: bold;
}

.advanced-list-item em {
    font-style: italic;
}

.advanced-list-item s {
    text-decoration: line-through;
}

.advanced-list-item u {
    text-decoration: underline;
}