/* Enhanced Inventory Tooltips Styles */
/* Using InventoryService data for rich, detailed tooltips */

.enhanced-tooltip {
    min-width: 380px;
    max-width: 450px;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #0f4c75;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Enhanced Header */
.tooltip-header-enhanced {
    background: linear-gradient(135deg, #0f3460 0%, #0e4b99 100%);
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-and-name {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.tooltip-icon {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Grade-based icon borders */
.tooltip-icon.normal {
    border: 2px solid #8c8c8c;
    box-shadow: 0 0 8px rgba(140, 140, 140, 0.3);
}

.tooltip-icon.rare {
    border: 2px solid #1e90ff;
    box-shadow: 0 0 12px rgba(30, 144, 255, 0.4);
}

.tooltip-icon.epic {
    border: 2px solid #9966cc;
    box-shadow: 0 0 12px rgba(153, 102, 204, 0.4);
}

.tooltip-icon.legendary {
    border: 2px solid #ff6b35;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

.item-icon-tooltip {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

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

.opt-level-overlay {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.item-name-section {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Grade-based name colors */
.item-name.normal { color: #e0e0e0; }
.item-name.rare { color: #1e90ff; }
.item-name.epic { color: #9966cc; }
.item-name.legendary { color: #ff6b35; }

.item-name .opt-level {
    color: #f7931e;
    font-size: 14px;
    margin-left: 6px;
}

.item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.rarity-badge,
.item-type-badge,
.race-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Rarity badge colors */
.rarity-badge.normal {
    background: rgba(140, 140, 140, 0.2);
    color: #b0b0b0;
    border: 1px solid rgba(140, 140, 140, 0.3);
}

.rarity-badge.rare {
    background: rgba(30, 144, 255, 0.2);
    color: #1e90ff;
    border: 1px solid rgba(30, 144, 255, 0.4);
}

.rarity-badge.epic {
    background: rgba(153, 102, 204, 0.2);
    color: #9966cc;
    border: 1px solid rgba(153, 102, 204, 0.4);
}

.rarity-badge.legendary {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    border: 1px solid rgba(255, 107, 53, 0.4);
}

.item-type-badge {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.race-badge {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* SOX Information */
.sox-info {
    margin-top: 12px;
    text-align: center;
}

.sox-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sox-badge.rare {
    background: linear-gradient(45deg, #1e90ff, #00bfff);
    color: white;
    box-shadow: 0 0 10px rgba(30, 144, 255, 0.4);
}

.sox-badge.epic {
    background: linear-gradient(45deg, #9966cc, #ba68c8);
    color: white;
    box-shadow: 0 0 10px rgba(153, 102, 204, 0.4);
}

.sox-badge.legendary {
    background: linear-gradient(45deg, #ff6b35, #ff8a50);
    color: white;
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.5);
}

/* Enhanced Body */
.tooltip-body-enhanced {
    padding: 16px;
    max-height: 60vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.1);
}

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

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

.tooltip-body-enhanced::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-body-enhanced::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4fc3f7;
    margin: 16px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
}

.section-title:first-child {
    margin-top: 0;
}

.section-title i {
    color: #29b6f6;
    font-size: 12px;
}

/* Blue Stats (Magic Options) */
.blue-stats-section .stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-item.blue-stat {
    background: rgba(30, 144, 255, 0.1);
    border: 1px solid rgba(30, 144, 255, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
}

.stat-item.blue-stat .stat-name {
    font-size: 13px;
    font-weight: 500;
}

/* White Stats (Enhancement) */
.white-stats-section .stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-item.white-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item.white-stat .stat-name {
    font-size: 12px;
    color: #b0b0b0;
}

.stat-item.white-stat .stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #e0e0e0;
}

/* Requirements */
.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.requirement-item {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.requirement-item i {
    color: #ffc107;
    font-size: 11px;
    width: 12px;
    text-align: center;
}

.req-type {
    color: #ffc107;
    font-weight: 500;
}

.req-value {
    color: #e0e0e0;
    font-weight: 600;
    margin-left: auto;
}

/* Pet Information */
.pet-info-section {
    background: rgba(156, 39, 176, 0.1);
    border: 1px solid rgba(156, 39, 176, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.pet-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pet-name,
.pet-level,
.pet-type {
    font-size: 12px;
    color: #e1bee7;
}

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

.property {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.property.allowed {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.property.forbidden {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
    color: #e57373;
}

.property i {
    font-size: 11px;
    width: 12px;
    text-align: center;
}

/* Price Section */
.price-section {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.price-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.gold-amount {
    color: #ffc107;
    font-size: 16px;
}

.currency {
    color: #ffecb3;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Debug Information */
.debug-info {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-info details {
    cursor: pointer;
}

.debug-info summary {
    font-size: 11px;
    color: #757575;
    margin-bottom: 6px;
    user-select: none;
}

.debug-details {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #9e9e9e;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 4px;
}

/* Separator */
.tooltip-separator {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 12px 0 0 0;
}

/* Magic Options Styling */
.tooltip-magic-options {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(160, 82, 45, 0.1));
    border-left: 3px solid #CD853F;
}

.magic-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.magic-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.magic-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.option-name {
    color: #E6E6FA;
    font-size: 12px;
    font-weight: 500;
}

.option-value {
    color: #98FB98;
    font-weight: bold;
    font-size: 12px;
}

/* Magic Option Type Colors */
.mag-opt-damage { border-left-color: #FF6B6B; }
.mag-opt-damage .option-value { color: #FF6B6B; }

.mag-opt-defense { border-left-color: #4ECDC4; }
.mag-opt-defense .option-value { color: #4ECDC4; }

.mag-opt-accuracy, .mag-opt-evasion { border-left-color: #FFE66D; }
.mag-opt-accuracy .option-value, .mag-opt-evasion .option-value { color: #FFE66D; }

.mag-opt-critical { border-left-color: #FF8E53; }
.mag-opt-critical .option-value { color: #FF8E53; }

.mag-opt-hp { border-left-color: #E74C3C; }
.mag-opt-hp .option-value { color: #E74C3C; }

.mag-opt-mp { border-left-color: #3498DB; }
.mag-opt-mp .option-value { color: #3498DB; }

.mag-opt-str { border-left-color: #E67E22; }
.mag-opt-str .option-value { color: #E67E22; }

.mag-opt-int { border-left-color: #9B59B6; }
.mag-opt-int .option-value { color: #9B59B6; }

.mag-opt-resistance { border-left-color: #8E44AD; }
.mag-opt-resistance .option-value { color: #8E44AD; }

.mag-opt-absorb, .mag-opt-damage-boost { border-left-color: #F39C12; }
.mag-opt-absorb .option-value, .mag-opt-damage-boost .option-value { color: #F39C12; }

/* Special Attributes Styling */
.tooltip-special-attributes {
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.2), rgba(138, 43, 226, 0.1));
    border-left: 3px solid #9370DB;
}

.special-attribute {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.special-attribute:last-child {
    border-bottom: none;
}

.attr-name {
    color: #E6E6FA;
    font-size: 12px;
    font-weight: 500;
}

.attr-value {
    font-weight: bold;
    font-size: 12px;
}

.enhancement-level {
    color: #FFD700;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.5);
    font-size: 14px;
}

.durability-high { color: #00FF00; }
.durability-medium { color: #FFA500; }
.durability-low { color: #FF4500; }

.special-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.special-flag {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: #FFE4B5;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #CD853F;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

/* Enhanced section titles */
.tooltip-section .section-title i {
    margin-right: 5px;
    width: 12px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .item-tooltip.inventory-tooltip {
        max-width: 300px !important;
        font-size: 13px;
    }

    .tooltip-header-new .item-name {
        font-size: 16px;
    }

    .tooltip-section {
        padding: 8px;
    }

    .magic-option, .special-attribute {
        padding: 3px 6px;
    }

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

/* Animation */
.enhanced-tooltip {
    animation: tooltipFadeIn 0.2s ease-out;
}

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

/* Loading and Error States */
.tooltip-loading .loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4fc3f7;
    font-size: 12px;
    margin-top: 4px;
}

.tooltip-loading .loading-indicator i {
    animation: spin 1s linear infinite;
}

.tooltip-error .error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
}

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