/**
 * Breadcrumb Component Styles
 * Provides styling for breadcrumb navigation
 */

.breadcrumb-container {
    display: flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    overflow: hidden;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap;
    overflow: hidden;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
}

.breadcrumb-item:last-child {
    max-width: none;
}

.breadcrumb-link {
    display: flex;
    align-items: center;
    color: #666;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-link:hover {
    color: #1890ff;
    background-color: #f0f8ff;
}

.breadcrumb-link:focus {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

.breadcrumb-link-focused {
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.breadcrumb-text {
    display: flex;
    align-items: center;
    color: #333;
    font-weight: 500;
    padding: 4px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-icon {
    margin-right: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.breadcrumb-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    margin: 0 8px;
    color: #ccc;
    font-size: 12px;
    flex-shrink: 0;
}

.breadcrumb-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: bold;
    user-select: none;
}

.breadcrumb-ellipsis:hover {
    color: #1890ff;
    background-color: #f0f8ff;
}

.breadcrumb-ellipsis:focus {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

/* Home item styling */
.breadcrumb-home {
    flex-shrink: 0;
}

.breadcrumb-home-link {
    padding: 4px 6px;
    min-width: 32px;
    justify-content: center;
}

.breadcrumb-home-link .breadcrumb-icon {
    margin-right: 0;
    font-size: 16px;
}

/* Active item styling */
.breadcrumb-item-active .breadcrumb-text,
.breadcrumb-item-active .breadcrumb-link {
    color: #1890ff;
    font-weight: 600;
}

/* Disabled item styling */
.breadcrumb-item-disabled .breadcrumb-text,
.breadcrumb-item-disabled .breadcrumb-link {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.breadcrumb-item-disabled .breadcrumb-link:hover {
    color: #ccc;
    background-color: transparent;
}

/* Size variations */
.breadcrumb-small {
    font-size: 12px;
}

.breadcrumb-small .breadcrumb-link,
.breadcrumb-small .breadcrumb-text {
    padding: 2px 6px;
}

.breadcrumb-small .breadcrumb-icon {
    font-size: 12px;
}

.breadcrumb-small .breadcrumb-separator {
    margin: 0 6px;
    font-size: 10px;
}

.breadcrumb-large {
    font-size: 16px;
}

.breadcrumb-large .breadcrumb-link,
.breadcrumb-large .breadcrumb-text {
    padding: 6px 12px;
}

.breadcrumb-large .breadcrumb-icon {
    font-size: 18px;
}

.breadcrumb-large .breadcrumb-separator {
    margin: 0 12px;
    font-size: 14px;
}

/* Variant styles */

/* Outlined variant */
.breadcrumb-outlined .breadcrumb-link {
    border: 1px solid #d9d9d9;
    background-color: #fff;
}

.breadcrumb-outlined .breadcrumb-link:hover {
    border-color: #1890ff;
    background-color: #f0f8ff;
}

.breadcrumb-outlined .breadcrumb-item-active .breadcrumb-text,
.breadcrumb-outlined .breadcrumb-item-active .breadcrumb-link {
    border-color: #1890ff;
    background-color: #e6f7ff;
}

/* Ghost variant */
.breadcrumb-ghost .breadcrumb-link {
    background-color: transparent;
    border: 1px solid transparent;
}

.breadcrumb-ghost .breadcrumb-link:hover {
    background-color: rgba(24, 144, 255, 0.1);
    border-color: rgba(24, 144, 255, 0.3);
}

.breadcrumb-ghost .breadcrumb-item-active .breadcrumb-text,
.breadcrumb-ghost .breadcrumb-item-active .breadcrumb-link {
    background-color: rgba(24, 144, 255, 0.1);
}

/* Separator styles */
.breadcrumb-separator-arrow .breadcrumb-separator {
    font-size: 14px;
    color: #999;
}

.breadcrumb-separator-slash .breadcrumb-separator {
    font-size: 16px;
    color: #ccc;
    font-weight: 300;
}

.breadcrumb-separator-dot .breadcrumb-separator {
    font-size: 18px;
    color: #ddd;
    font-weight: bold;
}

.breadcrumb-separator-custom .breadcrumb-separator {
    color: #999;
}

/* Responsive design */
.breadcrumb-responsive {
    min-width: 0;
    flex: 1;
}

.breadcrumb-responsive .breadcrumb-list {
    min-width: 0;
}

.breadcrumb-responsive .breadcrumb-item {
    min-width: 0;
    flex-shrink: 1;
}

.breadcrumb-responsive .breadcrumb-item:last-child {
    flex-shrink: 0;
}

.breadcrumb-truncated .breadcrumb-item:not(:first-child):not(:last-child):not(.breadcrumb-item-ellipsis) {
    display: none;
}

@media (max-width: 768px) {
    .breadcrumb-container {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .breadcrumb-container::-webkit-scrollbar {
        display: none;
    }
    
    .breadcrumb-list {
        flex-wrap: nowrap;
        min-width: max-content;
    }
    
    .breadcrumb-item {
        max-width: 150px;
    }
    
    .breadcrumb-separator {
        margin: 0 4px;
    }
    
    .breadcrumb-link,
    .breadcrumb-text {
        padding: 4px 6px;
    }
}

@media (max-width: 480px) {
    .breadcrumb-item {
        max-width: 100px;
    }
    
    .breadcrumb-separator {
        margin: 0 2px;
    }
    
    .breadcrumb-link,
    .breadcrumb-text {
        padding: 2px 4px;
        font-size: 12px;
    }
    
    .breadcrumb-icon {
        font-size: 12px;
    }
    
    /* Auto-truncate on very small screens */
    .breadcrumb-item:not(:first-child):not(:last-child) {
        display: none;
    }
    
    .breadcrumb-item:nth-last-child(2) {
        display: flex;
    }
    
    .breadcrumb-item:nth-last-child(2)::before {
        content: '...';
        color: #999;
        margin-right: 4px;
    }
}

/* Dark theme */
.breadcrumb-dark {
    color: rgba(255, 255, 255, 0.65);
}

.breadcrumb-dark .breadcrumb-link {
    color: rgba(255, 255, 255, 0.65);
}

.breadcrumb-dark .breadcrumb-link:hover {
    color: #1890ff;
    background-color: rgba(255, 255, 255, 0.1);
}

.breadcrumb-dark .breadcrumb-text {
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumb-dark .breadcrumb-separator {
    color: rgba(255, 255, 255, 0.3);
}

.breadcrumb-dark .breadcrumb-ellipsis {
    color: rgba(255, 255, 255, 0.45);
}

.breadcrumb-dark .breadcrumb-ellipsis:hover {
    color: #1890ff;
    background-color: rgba(255, 255, 255, 0.1);
}

.breadcrumb-dark .breadcrumb-item-active .breadcrumb-text,
.breadcrumb-dark .breadcrumb-item-active .breadcrumb-link {
    color: #1890ff;
}

/* Loading state */
.breadcrumb-loading {
    opacity: 0.6;
    pointer-events: none;
}

.breadcrumb-loading .breadcrumb-item::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 4px;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    border: 1px solid #1890ff;
    border-top: 1px solid transparent;
    border-radius: 50%;
    animation: breadcrumb-spin 1s linear infinite;
}

@keyframes breadcrumb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.breadcrumb-link:focus-visible {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

.breadcrumb-ellipsis:focus-visible {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .breadcrumb-link {
        border: 1px solid;
    }
    
    .breadcrumb-separator {
        border: 1px solid;
        padding: 2px 4px;
    }
    
    .breadcrumb-item-active .breadcrumb-text,
    .breadcrumb-item-active .breadcrumb-link {
        background-color: ButtonFace;
        border-color: ButtonText;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .breadcrumb-link,
    .breadcrumb-ellipsis {
        transition: none;
    }
    
    .breadcrumb-loading .breadcrumb-item::after {
        animation: none;
    }
}

/* Print styles */
@media print {
    .breadcrumb-container {
        display: none;
    }
}

/* RTL support */
.breadcrumb-container[dir="rtl"] .breadcrumb-icon {
    margin-right: 0;
    margin-left: 4px;
}

.breadcrumb-container[dir="rtl"] .breadcrumb-separator {
    transform: scaleX(-1);
}

.breadcrumb-container[dir="rtl"] .breadcrumb-home-link .breadcrumb-icon {
    margin-left: 0;
}

/* Hover effects for better UX */
.breadcrumb-item:hover .breadcrumb-separator {
    color: #999;
}

.breadcrumb-item:hover + .breadcrumb-item .breadcrumb-separator {
    color: #999;
}

/* Focus management */
.breadcrumb-container:focus-within .breadcrumb-separator {
    color: #1890ff;
}

/* Smooth scrolling for responsive */
.breadcrumb-responsive {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
.breadcrumb-container::-webkit-scrollbar {
    height: 4px;
}

.breadcrumb-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.breadcrumb-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.breadcrumb-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}