/* Order Details Visual Enhancements */

/* ===== CATEGORY BADGES ===== */
.category-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin: 3px;
    transition: all 0.3s ease;
    cursor: default;
    background: #ffffff;
    border: 2px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.category-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.6s ease;
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-color: #3ecf8e;
}

.category-badge:hover::before {
    left: 100%;
}

/* Context-specific category styles */
.category-badge.chain-category {
    border: 2px solid #2196F3;
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
    color: #1976D2;
}

.category-badge.standalone-category {
    border: 2px solid #4CAF50;
    background: linear-gradient(135deg, #ffffff 0%, #f8fff8 100%);
    color: #388E3C;
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.2);
}

.category-badge.parent-view {
    animation: pulse-blue 2s infinite;
}

.category-badge.child-view {
    animation: pulse-green 2s infinite;
}

/* ===== ITEM DISPLAY ===== */
.item-name {
    font-weight: 600;
    color: #2E2E2E;
    margin-bottom: 4px;
}

.item-name.chain-item {
    position: relative;
    padding-left: 20px;
}

.item-name.chain-item.parent-view::before {
    content: "👑";
    position: absolute;
    left: 0;
    top: 0;
}

.item-name.chain-item.child-view::before {
    content: "🏪";
    position: absolute;
    left: 0;
    top: 0;
}

.item-name.item-unavailable {
    color: #F44336;
    text-decoration: line-through;
    opacity: 0.7;
}

/* ===== INGREDIENT BADGES ===== */
.ingredient-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    margin: 2px 3px;
    border: 1.5px solid #e0e4e7;
    transition: all 0.25s ease;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: relative;
}

.ingredient-badge:hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    border-color: #3ecf8e;
}

.ingredient-badge.chain-ingredient {
    position: relative;
    background: linear-gradient(135deg, #fff 0%, #f0f8ff 100%);
    border-color: #bbdefb;
}

.ingredient-badge.data-source-fallback {
    border: 2px dashed #FF9800 !important;
    font-style: italic;
    animation: shimmer 1.5s infinite;
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.ingredient-badge.data-source-primary {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    color: #2e7d32;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.15);
}

.ingredient-badge.data-source-original {
    border-color: #757575;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    color: #424242;
    box-shadow: 0 1px 4px rgba(117, 117, 117, 0.1);
}

/* ===== INGREDIENTS CONTAINER ===== */
.ingredients-container {
    padding: 12px;
    border-radius: 12px;
    margin: 8px 0;
    transition: all 0.3s ease;
    background: #ffffff;
    border: 2px solid #f0f3f6;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    position: relative;
}

.ingredients-container:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-color: #e1e5e9;
}

.ingredients-container.has-fallback {
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
    border: 2px dashed #ffa726;
    position: relative;
    box-shadow: 0 3px 16px rgba(255, 152, 0, 0.15);
}

.ingredients-container.has-fallback::before {
    content: "🔄 Some ingredients from parent catalog";
    position: absolute;
    top: -12px;
    right: 12px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
    padding: 4px 8px;
    font-size: 10px;
    color: #f57c00;
    border-radius: 6px;
    border: 1px solid #ffa726;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.2);
}

.ingredients-container.chain-context {
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
    border: 2px solid #bbdefb;
    box-shadow: 0 3px 16px rgba(33, 150, 243, 0.1);
}

.ingredients-container.standalone-context {
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ===== ADDON DISPLAY ===== */
.addon-category {
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    border: 2px solid #f0f3f6;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.addon-category:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-color: #e1e5e9;
}

.addon-category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 8px 12px;
    font-weight: 700;
    font-size: 12px;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.addon-category-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30%;
    height: 2px;
    background: #3ecf8e;
}

.addon-item {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: #495057;
    border: 1.5px solid #e9ecef;
    margin: 3px;
    display: inline-block;
    background: #ffffff;
    transition: all 0.25s ease;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.addon-item:hover {
    transform: translateY(-1px);
    border-color: #3ecf8e;
    box-shadow: 0 3px 10px rgba(62, 207, 142, 0.15);
    color: #2c3e50;
}

.addon-item.chain-addon-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-color: #dee2e6;
    color: #495057;
}

.addon-item.standalone-addon-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-color: #e9ecef;
    color: #343a40;
}

/* ===== CHAIN INDICATORS ===== */
.chain-indicator {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin: 3px 5px;
    animation: fade-in 0.5s ease;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.chain-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.3;
}

.chain-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.chain-indicator.parent-view {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    color: #1976D2;
    border: 2px solid #90caf9;
    box-shadow: 0 3px 12px rgba(25, 118, 210, 0.2);
}

.chain-indicator.child-view {
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    color: #388E3C;
    border: 2px solid #a5d6a7;
    box-shadow: 0 3px 12px rgba(56, 142, 60, 0.2);
}

.chain-indicator.owner-view {
    background: linear-gradient(135deg, #f3e5f5 0%, #ffffff 100%);
    color: #7B1FA2;
    border: 2px solid #ce93d8;
    box-shadow: 0 3px 12px rgba(123, 31, 162, 0.2);
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.status-indicator.available {
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    color: #2e7d32;
    border-color: #81c784;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.status-indicator.not-available {
    background: linear-gradient(135deg, #ffebee 0%, #ffffff 100%);
    color: #c62828;
    border-color: #e57373;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

.status-indicator .icon {
    margin-right: 3px;
    font-size: 11px;
}

/* ===== DATA SOURCE INDICATORS ===== */
.data-source-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
    position: relative;
}

.data-source-indicator.primary {
    background-color: #4CAF50;
}

.data-source-indicator.fallback {
    background-color: #FF9800;
    animation: pulse-orange 1s infinite;
}

.data-source-indicator.original {
    background-color: #757575;
}

.data-source-indicator::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.data-source-indicator:hover::after {
    opacity: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse-blue {
    0%, 100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1); }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1); }
}

@keyframes pulse-orange {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .category-badge {
        font-size: 11px;
        padding: 3px 6px;
        margin: 1px;
    }
    
    .ingredient-badge {
        font-size: 10px;
        padding: 1px 4px;
        margin: 1px;
    }
    
    .chain-indicator {
        font-size: 10px;
        padding: 3px 6px;
        margin: 1px 2px;
    }
    
    .ingredients-container.has-fallback::before {
        font-size: 9px;
        padding: 1px 4px;
        top: -8px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .category-badge {
        background-color: rgba(255,255,255,0.1) !important;
        color: #E0E0E0 !important;
        border-color: rgba(255,255,255,0.2) !important;
    }
    
    .ingredient-badge {
        background-color: rgba(255,255,255,0.05) !important;
        color: #CCCCCC !important;
        border-color: rgba(255,255,255,0.1) !important;
    }
    
    .ingredients-container {
        background-color: rgba(255,255,255,0.02) !important;
        border-color: rgba(255,255,255,0.1) !important;
    }
    
    .chain-indicator {
        background-color: rgba(255,255,255,0.1) !important;
        color: #E0E0E0 !important;
        border-color: rgba(255,255,255,0.2) !important;
    }
    
    .item-name {
        color: #E0E0E0 !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .category-badge,
    .ingredient-badge,
    .chain-indicator {
        background-color: transparent !important;
        border: 1px solid #000 !important;
        color: #000 !important;
        box-shadow: none !important;
        animation: none !important;
    }
    
    .ingredients-container.has-fallback::before {
        display: none;
    }
    
    .status-indicator {
        background-color: transparent !important;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

/* ===== ACCESSIBILITY ===== */
.category-badge:focus,
.ingredient-badge:focus,
.chain-indicator:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .category-badge,
    .ingredient-badge,
    .chain-indicator {
        border-width: 2px !important;
        font-weight: 700 !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .category-badge,
    .ingredient-badge,
    .chain-indicator,
    .status-indicator,
    .ingredients-container {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== UTILITY CLASSES ===== */
.order-details-enhanced {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.visual-separator {
    border-bottom: 2px solid #f0f3f6;
    margin: 12px 0;
    padding-bottom: 12px;
    position: relative;
}

.visual-separator::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #3ecf8e, transparent);
}

.context-highlight {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.08) 0%, rgba(33, 150, 243, 0.02) 100%);
    border-left: 4px solid #2196F3;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
    position: relative;
}

.context-highlight::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #2196F3, #1976D2);
    border-radius: 0 2px 2px 0;
}

.fallback-notice {
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
    border: 2px solid #ffa726;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 8px 0;
    font-size: 12px;
    color: #ef6c00;
    box-shadow: 0 3px 12px rgba(255, 152, 0, 0.15);
    font-weight: 500;
    position: relative;
}

.fallback-notice::before {
    content: "ℹ️ ";
    margin-right: 6px;
    font-size: 14px;
}

.fallback-notice::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffa726, #ff8f00);
    border-radius: 8px 8px 0 0;
}

/* ===== ENHANCED BOX CONTAINERS ===== */
.enhanced-box {
    background: #ffffff;
    border: 2px solid #f0f3f6;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enhanced-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3ecf8e, #27b88a);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.enhanced-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    border-color: #e1e5e9;
}

.enhanced-box:hover::before {
    opacity: 1;
}

.enhanced-box.primary {
    border-color: #bbdefb;
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
}

.enhanced-box.success {
    border-color: #c8e6c9;
    background: linear-gradient(135deg, #ffffff 0%, #f8fff8 100%);
}

.enhanced-box.warning {
    border-color: #ffe0b2;
    background: linear-gradient(135deg, #ffffff 0%, #fffef8 100%);
}

.enhanced-box.error {
    border-color: #ffcdd2;
    background: linear-gradient(135deg, #ffffff 0%, #fff8f8 100%);
}