/* ===== Enhanced Inventory Tooltip System ===== */

/* Main Tooltip Container */
.inventory-tooltip-container {
    position: fixed;
    z-index: 9999;
    pointer-events: auto;
    user-select: none;
}

/* Prevent tooltip container from interfering with scrolling */
.inventory-tooltip-container * {
    box-sizing: border-box;
}

/* Main Tooltip Styles */
.inventory-tooltip {
    position: fixed;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 2px solid #475569;
    border-radius: 12px;
    padding: 16px;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.3),
        0 10px 10px -5px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 50;
    min-width: 320px;
    max-width: min(450px, 90vw);
    max-height: min(600px, 85vh);
    color: #f8fafc;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    animation: tooltipFadeIn 0.2s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

/* Enhanced Tooltip Body with Scrolling */
.tooltip-body-enhanced {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    margin-right: -4px;
    max-height: min(500px, 70vh);
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Tooltip Body */
.tooltip-body-enhanced::-webkit-scrollbar {
    width: 6px;
}

.tooltip-body-enhanced::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.tooltip-body-enhanced::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.tooltip-body-enhanced::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Firefox Scrollbar */
.tooltip-body-enhanced {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

/* Enhanced Tooltip Content */
.enhanced-tooltip {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.item-tooltip.enhanced-tooltip .tooltip-body-enhanced {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tooltip Sections */
.tooltip-body-enhanced > * {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}

.tooltip-body-enhanced > *:last-child {
    margin-bottom: 0;
}

/* Loading and Error States */
.tooltip-loading,
.tooltip-error {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-indicator,
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.loading-indicator i {
    color: #3b82f6;
    animation: spin 1s linear infinite;
}

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

/* Tooltip Header Styles */
.tooltip-header,
.tooltip-header-enhanced {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #475569;
    flex-shrink: 0;
}

.tooltip-icon {
    flex-shrink: 0;
    position: relative;
}

.item-icon-tooltip {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.item-icon-tooltip:hover {
    transform: scale(1.05);
}

/* Item Grade Colors */
.item-icon-tooltip.normal {
    border-color: #94a3b8;
}
.item-icon-tooltip.rare {
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.item-icon-tooltip.epic {
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}
.item-icon-tooltip.legendary {
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.item-icon-tooltip.mythic {
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.tooltip-title {
    flex: 1;
}

.item-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
    word-break: break-word;
}

/* Item Name Colors */
.item-name.normal { color: #f8fafc; }
.item-name.rare {
    color: #60a5fa;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.3);
}
.item-name.epic {
    color: #a78bfa;
    text-shadow: 0 0 5px rgba(167, 139, 250, 0.3);
}
.item-name.legendary {
    color: #fbbf24;
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
}
.item-name.mythic {
    color: #f87171;
    text-shadow: 0 0 5px rgba(248, 113, 113, 0.3);
}

.opt-level {
    background: linear-gradient(45deg, #16a34a, #22c55e);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-shadow: none;
    white-space: nowrap;
}

/* Item Details & Badges */
.item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.rarity-badge,
.sort-of-item-badge,
.degree-badge,
.item-type-badge,
.race-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid;
}

/* Rarity Badge Styles */
.rarity-badge.normal {
    background: linear-gradient(45deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.1));
    border-color: #94a3b8;
    color: #cbd5e1;
}

.rarity-badge.rare {
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border-color: #3b82f6;
    color: #60a5fa;
}

.rarity-badge.epic {
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    border-color: #8b5cf6;
    color: #a78bfa;
}

.rarity-badge.legendary {
    background: linear-gradient(45deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    border-color: #f59e0b;
    color: #fbbf24;
}

.rarity-badge.mythic {
    background: linear-gradient(45deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-color: #ef4444;
    color: #f87171;
}

/* Sort of Item Badge */
.sort-of-item-badge {
    background: linear-gradient(45deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-color: #22c55e;
    color: #4ade80;
}

/* Degree Badge */
.degree-badge {
    background: linear-gradient(45deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
    border-color: #a855f7;
    color: #c084fc;
    font-weight: 700;
}

/* Item Type Badge */
.item-type-badge {
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.1));
    border-color: #6366f1;
    color: #818cf8;
}

/* Race Badge */
.race-badge {
    background: linear-gradient(45deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.1));
    border-color: #ec4899;
    color: #f472b6;
}

/* Advanced Badge (Binding Options) */
.advanced-badge {
    background: linear-gradient(45deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
    border-color: #a855f7;
    color: #c084fc;
    font-weight: 700;
    text-shadow: 0 0 3px rgba(168, 85, 247, 0.3);
}

.advanced-badge.binding-glow-1 {
    background: linear-gradient(45deg, rgba(96, 165, 250, 0.3), rgba(96, 165, 250, 0.15));
    border-color: #60a5fa;
    color: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

.advanced-badge.binding-glow-2 {
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.15));
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.advanced-badge.binding-glow-3 {
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.15));
    border-color: #8b5cf6;
    color: #a78bfa;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.advanced-badge.binding-glow-4 {
    background: linear-gradient(45deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.15));
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.7);
    animation: advancedPulse 2s ease-in-out infinite;
}

@keyframes advancedPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.9);
    }
}

/* Enhanced White Stats Simple List */
.white-stats-container.simple-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.white-stats-container.simple-list .white-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(71, 85, 105, 0.1);
    border: 1px solid rgba(71, 85, 105, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.white-stats-container.simple-list .white-stat-item:hover {
    background: rgba(71, 85, 105, 0.2);
    border-color: rgba(71, 85, 105, 0.4);
}

.white-stats-container.simple-list .stat-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.white-stats-container.simple-list .stat-content {
    flex: 1;
    min-width: 0;
}

.white-stats-container.simple-list .stat-text {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    line-height: 1.2;
    word-break: break-word;
}

/* Different icon colors for different stat types */
.white-stat-item[data-type*="attack"] .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.white-stat-item[data-type*="defense"] .stat-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.white-stat-item[data-type="durability"] .stat-icon {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
}

.white-stat-item[data-type*="absorption"] .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.white-stat-item[data-type*="reinforce"] .stat-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #22d3ee;
}

/* ===== Enhanced Magic Options Styling ===== */
.tooltip-magic-options {
    position: relative;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    overflow: hidden;
}

.tooltip-magic-options::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: magicShimmer 3s infinite;
}

@keyframes magicShimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.magic-title {
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.magic-title i {
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

.magic-options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.magic-option {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease forwards;
}

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

.magic-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(2px);
}

.option-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.option-details {
    flex: 1;
}

.option-name {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.option-description {
    font-size: 11px;
    color: #94a3b8;
}

.option-value {
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 4px;
}

.option-value.positive-effect {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.option-value.negative-effect {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Magic Option Type Colors */
.mag-opt-str .option-icon {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
}
.mag-opt-int .option-icon {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
}
.mag-opt-hp .option-icon {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
}
.mag-opt-mp .option-icon {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
}
.mag-opt-durability .option-icon {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: white;
}
.mag-opt-physical-attack .option-icon {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
}
.mag-opt-magical-attack .option-icon {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
}
.mag-opt-physical-defense .option-icon {
    background: linear-gradient(135deg, #475569, #334155);
    color: white;
}
.mag-opt-magical-defense .option-icon {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
}
.mag-opt-hit-rate .option-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}
.mag-opt-evasion .option-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}
.mag-opt-default .option-icon {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

/* ===== Enhanced White Stats & Blue Stats Styling ===== */

/* Enhanced Stats Container */
.enhanced-stats {
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.enhanced-stats .section-title {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.enhanced-stats .section-title i {
    color: #60a5fa;
}

/* Stats Container */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Blue Stats Specific Styling */
.blue-stats-section {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.blue-stats-section .blue-title {
    color: #3b82f6;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blue-stats-section .blue-title i {
    color: #3b82f6;
}

.blue-stats-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blue-stats-category {
    margin-bottom: 12px;
}

.blue-stats-category .category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 6px;
}

.blue-stats-category .category-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 8px;
}

.blue-stat-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    animation: statsFadeIn 0.3s ease forwards;
}

.blue-stat-item:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(2px);
}

.blue-stat-item .stat-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 8px;
    font-size: 12px;
}

.blue-stat-item .stat-content {
    flex: 1;
}

.blue-stat-item .stat-name {
    color: #3b82f6;
    font-weight: 500;
}

/* White Stats Specific Styling */
.white-stats-section {
    background: rgba(107, 114, 128, 0.05);
    border: 1px solid rgba(107, 114, 128, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.white-stats-section .white-title {
    color: #6b7280;
    border-bottom: 2px solid rgba(107, 114, 128, 0.3);
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.white-stats-section .white-title i {
    color: #6b7280;
}

.white-stats-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.white-stats-category {
    margin-bottom: 12px;
}

.white-stats-category .category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 6px;
}

.white-stats-category .category-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 8px;
}

.white-stat-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(107, 114, 128, 0.08);
    border: 1px solid rgba(107, 114, 128, 0.2);
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    animation: statsFadeIn 0.3s ease forwards;
}

.white-stat-item:hover {
    background: rgba(107, 114, 128, 0.12);
    border-color: rgba(107, 114, 128, 0.3);
    transform: translateX(2px);
}

.white-stat-item .stat-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 8px;
    font-size: 12px;
}

.white-stat-item .stat-content {
    flex: 1;
}

.white-stat-item .stat-name {
    color: #6b7280;
    font-weight: 500;
}

/* Stat Icon Colors */
.white-stat.combat .stat-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.white-stat.defense .stat-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.white-stat.utility .stat-icon {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Trading Properties */
.trading-properties {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.trading-properties .section-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.property {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.property.allowed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.property.forbidden {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Requirements Section */
.requirements-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.requirements-section .section-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.requirements-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
}

.requirement-item i {
    color: #f59e0b;
    width: 16px;
    text-align: center;
}

.req-type {
    color: #94a3b8;
}

.req-value {
    color: #e2e8f0;
    font-weight: 500;
    margin-left: auto;
}

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

.blue-stat-item:nth-child(1) { animation-delay: 0.1s; }
.blue-stat-item:nth-child(2) { animation-delay: 0.15s; }
.blue-stat-item:nth-child(3) { animation-delay: 0.2s; }
.blue-stat-item:nth-child(4) { animation-delay: 0.25s; }
.blue-stat-item:nth-child(5) { animation-delay: 0.3s; }
.blue-stat-item:nth-child(n+6) { animation-delay: 0.35s; }

.white-stat-item:nth-child(1) { animation-delay: 0.1s; }
.white-stat-item:nth-child(2) { animation-delay: 0.15s; }
.white-stat-item:nth-child(3) { animation-delay: 0.2s; }
.white-stat-item:nth-child(4) { animation-delay: 0.25s; }
.white-stat-item:nth-child(5) { animation-delay: 0.3s; }
.white-stat-item:nth-child(n+6) { animation-delay: 0.35s; }

/* ===== Responsive Design ===== */

/* Tablet Styles */
@media (max-width: 768px) {
    .inventory-tooltip {
        max-width: 95vw;
        max-height: 80vh;
        padding: 12px;
        border-radius: 8px;
    }

    .tooltip-body-enhanced {
        max-height: 60vh;
    }

    .item-name {
        font-size: 14px;
    }

    .item-icon-tooltip {
        width: 40px;
        height: 40px;
    }

    .properties-grid {
        grid-template-columns: 1fr;
    }

    .magic-option {
        padding: 8px;
    }

    .option-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Mobile Styles */
@media (max-width: 480px) {
    .inventory-tooltip {
        max-width: 98vw;
        max-height: 90vh;
        padding: 10px;
        border-radius: 6px;
        min-width: 280px;
    }

    .tooltip-body-enhanced {
        max-height: 70vh;
    }

    .tooltip-header,
    .tooltip-header-enhanced {
        gap: 8px;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .item-icon-tooltip {
        width: 36px;
        height: 36px;
    }

    .item-name {
        font-size: 13px;
    }

    .opt-level {
        font-size: 10px;
        padding: 1px 4px;
    }

    .enhanced-stats,
    .blue-stats-section,
    .white-stats-section,
    .trading-properties,
    .requirements-section {
        padding: 8px;
        margin: 8px 0;
    }

    .section-title,
    .blue-title,
    .white-title {
        font-size: 12px;
    }

    .blue-stat-item,
    .white-stat-item {
        padding: 6px 8px;
        font-size: 11px;
    }

    .magic-option {
        padding: 6px;
    }

    .option-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
        margin-right: 8px;
    }

    .option-name {
        font-size: 11px;
    }

    .option-description {
        font-size: 9px;
    }

    .option-value {
        font-size: 12px;
        padding: 2px 6px;
    }

    .tooltip-body-enhanced::-webkit-scrollbar {
        width: 4px;
    }
}

/* Large Screen Optimization */
@media (min-width: 1200px) {
    .inventory-tooltip {
        max-width: 500px;
        max-height: 700px;
    }

    .tooltip-body-enhanced {
        max-height: 600px;
    }
}

/* Touch Device Enhancements */
@media (hover: none) and (pointer: coarse) {
    .blue-stat-item:hover,
    .white-stat-item:hover,
    .magic-option:hover {
        transform: none;
    }

    .tooltip-body-enhanced::-webkit-scrollbar {
        width: 8px;
    }

    .tooltip-body-enhanced::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.5);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .inventory-tooltip {
        border-width: 3px;
        background: #000;
        color: #fff;
    }

    .blue-stat-item,
    .white-stat-item {
        border-width: 2px;
    }

    .option-icon {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .inventory-tooltip,
    .blue-stat-item,
    .white-stat-item,
    .magic-option {
        animation: none;
        transition: none;
    }

    .magic-title i {
        animation: none;
    }

    .tooltip-magic-options::before {
        animation: none;
    }
}

/* ===== Binding Option Glow Effects ===== */

/* Base glow classes for different nOptValue levels */
.binding-glow-1 {
    position: relative;
    box-shadow:
        0 0 10px rgba(96, 165, 250, 0.3),
        0 0 20px rgba(96, 165, 250, 0.1),
        inset 0 0 10px rgba(96, 165, 250, 0.05);
    border-color: rgba(96, 165, 250, 0.4) !important;
}

.binding-glow-1::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(96, 165, 250, 0.2), transparent);
    border-radius: inherit;
    z-index: -1;
    animation: gentleGlow 3s ease-in-out infinite;
}

.binding-glow-2 {
    position: relative;
    box-shadow:
        0 0 15px rgba(59, 130, 246, 0.4),
        0 0 30px rgba(59, 130, 246, 0.2),
        inset 0 0 15px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.6) !important;
}

.binding-glow-2::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg,
        transparent,
        rgba(59, 130, 246, 0.3),
        rgba(96, 165, 250, 0.2),
        transparent);
    border-radius: inherit;
    z-index: -1;
    animation: moderateGlow 2.5s ease-in-out infinite;
}

.binding-glow-3 {
    position: relative;
    box-shadow:
        0 0 20px rgba(139, 92, 246, 0.5),
        0 0 40px rgba(139, 92, 246, 0.3),
        0 0 60px rgba(139, 92, 246, 0.1),
        inset 0 0 20px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.7) !important;
}

.binding-glow-3::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg,
        transparent,
        rgba(139, 92, 246, 0.4),
        rgba(167, 139, 250, 0.3),
        rgba(196, 181, 253, 0.2),
        transparent);
    border-radius: inherit;
    z-index: -1;
    animation: strongGlow 2s ease-in-out infinite;
}

.binding-glow-4 {
    position: relative;
    box-shadow:
        0 0 25px rgba(245, 158, 11, 0.6),
        0 0 50px rgba(245, 158, 11, 0.4),
        0 0 75px rgba(245, 158, 11, 0.2),
        0 0 100px rgba(245, 158, 11, 0.1),
        inset 0 0 25px rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.8) !important;
}

.binding-glow-4::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg,
        transparent,
        rgba(245, 158, 11, 0.5),
        rgba(251, 191, 36, 0.4),
        rgba(254, 240, 138, 0.3),
        rgba(253, 230, 138, 0.2),
        transparent);
    border-radius: inherit;
    z-index: -1;
    animation: intenseGlow 1.5s ease-in-out infinite;
}

/* Glow animations */
@keyframes gentleGlow {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes moderateGlow {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

@keyframes strongGlow {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.04);
    }
}

@keyframes intenseGlow {
    0%, 100% {
        opacity: 0.95;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Binding Glow Indicator Badge */
.binding-glow-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.binding-glow-indicator.glow-level-1 {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.binding-glow-indicator.glow-level-2 {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

.binding-glow-indicator.glow-level-3 {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.7);
}

.binding-glow-indicator.glow-level-4 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
    animation: pulseIntense 1s ease-in-out infinite;
}

@keyframes pulseIntense {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 25px rgba(245, 158, 11, 1);
    }
}

/* Enhanced Tooltip Header with Glow Effects */
.tooltip-header-enhanced.binding-glow-1,
.tooltip-header-enhanced.binding-glow-2,
.tooltip-header-enhanced.binding-glow-3,
.tooltip-header-enhanced.binding-glow-4 {
    background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.95),
        rgba(51, 65, 85, 0.95));
    backdrop-filter: blur(10px);
    border-radius: 8px;
    margin: -8px -8px 12px -8px;
    padding: 16px;
}

/* Icon specific glow effects */
.tooltip-icon.binding-glow-1 .item-icon-tooltip,
.tooltip-icon.binding-glow-2 .item-icon-tooltip,
.tooltip-icon.binding-glow-3 .item-icon-tooltip,
.tooltip-icon.binding-glow-4 .item-icon-tooltip {
    transition: all 0.3s ease;
}

.tooltip-icon.binding-glow-1 .item-icon-tooltip:hover {
    transform: scale(1.1) !important;
}

.tooltip-icon.binding-glow-2 .item-icon-tooltip:hover {
    transform: scale(1.12) !important;
}

.tooltip-icon.binding-glow-3 .item-icon-tooltip:hover {
    transform: scale(1.15) !important;
}

.tooltip-icon.binding-glow-4 .item-icon-tooltip:hover {
    transform: scale(1.18) !important;
}

/* Responsive adjustments for glow effects */
@media (max-width: 768px) {
    .binding-glow-1::before,
    .binding-glow-2::before,
    .binding-glow-3::before,
    .binding-glow-4::before {
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
    }

    .binding-glow-indicator {
        width: 16px;
        height: 16px;
        font-size: 8px;
        top: -2px;
        right: -2px;
    }
}

/* ===== Binding Options Section Styling ===== */

.binding-options-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    overflow: hidden;
    position: relative;
}

.binding-options-section.binding-glow-1 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(96, 165, 250, 0.05));
    border-color: rgba(96, 165, 250, 0.3);
}

.binding-options-section.binding-glow-2 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(96, 165, 250, 0.08));
    border-color: rgba(59, 130, 246, 0.4);
}

.binding-options-section.binding-glow-3 {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(167, 139, 250, 0.1));
    border-color: rgba(139, 92, 246, 0.5);
}

.binding-options-section.binding-glow-4 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(251, 191, 36, 0.12));
    border-color: rgba(245, 158, 11, 0.6);
}

.binding-title {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.binding-title i {
    color: #94a3b8;
}

.binding-summary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.glow-level-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.glow-level-badge.level-1 {
    background: linear-gradient(45deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.1));
    border-color: #60a5fa;
    color: #60a5fa;
}

.glow-level-badge.level-2 {
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border-color: #3b82f6;
    color: #3b82f6;
}

.glow-level-badge.level-3 {
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    border-color: #8b5cf6;
    color: #a78bfa;
}

.glow-level-badge.level-4 {
    background: linear-gradient(45deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    border-color: #f59e0b;
    color: #fbbf24;
    animation: levelPulse 2s ease-in-out infinite;
}

@keyframes levelPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    }
}

.binding-count {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

.binding-options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.binding-option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.binding-option-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.option-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    flex-shrink: 0;
}

.option-badge.binding-glow-1 {
    background: rgba(96, 165, 250, 0.15);
    border-color: #60a5fa;
    color: #60a5fa;
}

.option-badge.binding-glow-2 {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
}

.option-badge.binding-glow-3 {
    background: rgba(139, 92, 246, 0.15);
    border-color: #8b5cf6;
    color: #a78bfa;
}

.option-badge.binding-glow-4 {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #fbbf24;
}

.option-badge i {
    font-size: 10px;
}

.option-details {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
}

.option-slot,
.option-level {
    color: #94a3b8;
    font-weight: 500;
}

.option-value {
    margin-left: auto;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid;
}

.option-value.binding-glow-1 {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
}

.option-value.binding-glow-2 {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.option-value.binding-glow-3 {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}

.option-value.binding-glow-4 {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.binding-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.binding-placeholder.binding-glow-1 {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

.binding-placeholder.binding-glow-2 {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.binding-placeholder.binding-glow-3 {
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.3);
}

.binding-placeholder.binding-glow-4 {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.binding-placeholder i {
    animation: rotate 3s linear infinite;
}

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

/* Reduced motion support for glow effects */
@media (prefers-reduced-motion: reduce) {
    .binding-glow-1::before,
    .binding-glow-2::before,
    .binding-glow-3::before,
    .binding-glow-4::before,
    .binding-glow-indicator.glow-level-4,
    .glow-level-badge.level-4,
    .binding-placeholder i {
        animation: none;
    }

    .binding-glow-1,
    .binding-glow-2,
    .binding-glow-3,
    .binding-glow-4 {
        box-shadow: none;
        border-color: rgba(96, 165, 250, 0.3) !important;
    }
}

/* Print Styles */
@media print {
    .inventory-tooltip-container {
        display: none;
    }
}
