body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 16px;
    color: var(--tg-theme-text-color, #000);
    background-color: var(--tg-theme-bg-color, #000);
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: var(--tg-theme-hint-color, #999);
}

.btn-primary {
    background-color: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #fff);
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin: 10px 0;
}

.btn-secondary {
    background-color: transparent;
    color: var(--tg-theme-button-color, #2481cc);
    border: 1px solid var(--tg-theme-button-color, #2481cc);
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
}

.btn-secondary:hover {
    background-color: rgba(36, 129, 204, 0.1);
}

.dropdown {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid var(--tg-theme-hint-color, #999);
    background-color: var(--tg-theme-bg-color, #fff);
    color: var(--tg-theme-text-color, #000);
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.character-card {
    border: 1px solid var(--tg-theme-hint-color, #999);
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.character-card:hover, .character-card.selected {
    background-color: var(--tg-theme-secondary-bg-color, #f0f0f0);
    border-color: var(--tg-theme-button-color, #2481cc);
}

.character-avatar {
    width: 100%;
    max-width: 120px;
    margin: 0 auto;
}

.character-avatar img {
    width: 100%;
    border-radius: 50%;
}

.character-info {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.character-details {
    margin-left: 20px;
}

.gear-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.gear-slot-container {
    margin-bottom: 12px;
    position: relative;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    background: transparent;
}

.slot-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999);
    margin-bottom: 4px;
    text-align: center;
}

.gear-item-placeholder {
    height: auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

.gear-item {
    border: none;
    border-radius: 4px;
    padding: 0;
    width: 56px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.gear-item-icon {
    width: 56px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-color: rgba(0, 0, 0, 0.1);
}

.gear-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.gear-item-level {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
    margin: 2px;
}

.gear-item-name {
    display: none;
}

.gear-item:hover .gear-item-name {
    display: block;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 100;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #ffffff);
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: opacity 0.5s;
}

.notification.fade-out {
    opacity: 0;
}

.character-class-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: bold;
    height: 100%;
    width: 100%;
}

.armory-layout {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    gap: 10px;
}

.gear-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 30%;
}

.character-avatar-container {
    width: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
}

.character-model-container {
    height: 450px;
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.character-model {
    height: 100%;
    width: 100%;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
}

.character-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    position: absolute;
    top: -30px;
    z-index: 10;
}

/* Add a subtle platform shadow beneath the character */
.character-model:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
}

.character-summary {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.weapon-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.weapon-row .gear-slot-container {
    flex: 1;
}

/* Improve mobile layout */
@media (max-width: 768px) {
    .armory-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .gear-column {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .character-avatar-container {
        width: 100%;
        margin: 10px 0;
        order: -1; /* Move character to top on mobile */
    }
    
    .weapon-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .weapon-row .gear-slot-container {
        flex: 0 0 30%;
        max-width: 30%;
    }
    
    .character-model-container {
        height: 200px;
    }
    
    .character-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .gear-item {
        width: 48px;
    }
    
    .gear-item-icon {
        width: 48px;
        height: 48px;
    }
    
    .gear-item-level {
        font-size: 9px;
    }
    
    .slot-label {
        font-size: 10px;
    }
}

/* Ultra small screens (iPhone SE, etc) */
@media (max-width: 375px) {
    .gear-column {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gear-item {
        width: 40px;
    }
    
    .gear-item-icon {
        width: 40px;
        height: 40px;
    }
    
    .character-model-container {
        height: 180px;
    }
}

/* WoW-style tooltip */
.wow-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #4a4a4a;
    border-radius: 4px;
    padding: 12px;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    pointer-events: auto;
    font-family: 'Arial', sans-serif;
    min-width: 280px;
    line-height: 1.4;
    border: 2px solid #575757;
    cursor: pointer;
}

.wow-tooltip .item-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
}

.wow-tooltip .item-slot {
    color: #9d9d9d;
    font-size: 12px;
    margin-bottom: 6px;
}

.wow-tooltip .item-stats {
    color: #ffffff;
    margin-bottom: 8px;
}

.wow-tooltip .item-bonus {
    color: #1eff00; /* green for bonus stats */
}

.wow-tooltip .item-ilvl {
    color: #ffff00; /* yellow for item level */
    margin-bottom: 6px;
}

.wow-tooltip .item-bind {
    color: #9d9d9d;
    font-size: 12px;
    margin-bottom: 6px;
}

/* Quality colors matching WoW item qualities */
.wow-tooltip.quality-1 .item-name { color: #ffffff; } /* Common */
.wow-tooltip.quality-2 .item-name { color: #1eff00; } /* Uncommon */
.wow-tooltip.quality-3 .item-name { color: #0070dd; } /* Rare */
.wow-tooltip.quality-4 .item-name { color: #a335ee; } /* Epic */
.wow-tooltip.quality-5 .item-name { color: #ff8000; } /* Legendary */

/* Additional tooltip styles */
.wow-tooltip .item-mythic {
    color: #00ff96;
    font-weight: bold;
    margin-bottom: 4px;
}

.wow-tooltip .item-armor {
    color: #ffffff;
    margin-bottom: 4px;
}

.wow-tooltip .item-upgrade {
    color: #ffff00;
    margin-bottom: 4px;
}

.wow-tooltip .item-durability {
    color: #9d9d9d;
    font-size: 12px;
    margin-top: 8px;
}

.wow-tooltip .item-req {
    color: #9d9d9d;
    font-size: 12px;
    margin-top: 2px;
}

.wow-tooltip .item-price {
    color: #9d9d9d;
    font-size: 12px;
    margin-top: 4px;
}

.wow-tooltip .item-source {
    color: #9d9d9d;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

.wow-tooltip .gold {
    color: #ffcc00;
}

.wow-tooltip .silver {
    color: #c0c0c0;
}

.wow-tooltip .copper {
    color: #cc9966;
}

/* Additional tooltip styles to match WoW UI more closely */
.wow-tooltip .heroic-text {
    color: #00ff00;
    font-size: 12px;
    margin-bottom: 4px;
}

/* Color for mythic items */
.wow-tooltip .mythic-text {
    color: #00ccff;
    font-size: 12px;
    margin-bottom: 4px;
}

/* Transmog info */
.wow-tooltip .transmog-text {
    color: #9d9d9d;
    font-style: italic;
    font-size: 11px;
    margin-top: 4px;
}

/* Set item styling */
.wow-tooltip .set-info {
    color: #9d9d9d;
    margin-top: 10px;
    border-top: 1px solid #444;
    padding-top: 5px;
    font-size: 12px;
}

.wow-tooltip .set-name {
    color: #ffff00;
    font-size: 13px;
}

.wow-tooltip .set-piece-equipped {
    color: #1eff00;
}

.wow-tooltip .set-piece-not-equipped {
    color: #9d9d9d;
}

.wow-tooltip .set-bonus {
    color: #1eff00;
    margin-top: 5px;
}

.wow-tooltip .set-bonus-inactive {
    color: #9d9d9d;
}

.wow-tooltip .item-stats div {
    margin-bottom: 2px;
}

.wow-tooltip .item-primary-stat {
    color: #ffffff;
}

.wow-tooltip .item-secondary-stat {
    color: #1eff00;
}

.wow-tooltip .item-socket {
    color: #ffff00;
    display: flex;
    align-items: center;
    margin-top: 4px;
}

.wow-tooltip .socket-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    display: inline-block;
}

/* Additional tooltip styles for sockets and enchants */
.wow-tooltip .item-unique {
    color: #ff8000;
    margin-bottom: 4px;
}

.wow-tooltip .item-sockets {
    margin-top: 6px;
}

.wow-tooltip .item-socket {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.wow-tooltip .item-socket-filled {
    color: #1eff00;
}

.wow-tooltip .item-socket-empty {
    color: #ffff00;
}

.wow-tooltip .item-enchants {
    margin-top: 6px;
}

.wow-tooltip .item-enchant {
    color: #1eff00;
    margin-bottom: 2px;
}

.wow-tooltip .item-description {
    color: #ffd100;
    font-style: italic;
    margin-top: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

/* Improved set bonus styling */
.wow-tooltip .set-bonus,
.wow-tooltip .set-bonus-inactive {
    margin-top: 5px;
    padding-left: 10px;
}

.wow-tooltip .set-piece-equipped,
.wow-tooltip .set-piece-not-equipped {
    padding-left: 10px;
}

.wow-tooltip .set-name {
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

.fallback-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 40px;
    background-color: #333;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
}

/* Loading Spinner */
.loading-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #444;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--tg-theme-button-color, #2481cc);
    animation: spin 1s ease-in-out infinite;
}

.loading-message {
    margin-top: 16px;
    color: var(--tg-theme-text-color, #fff);
    font-size: 16px;
}

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

/* Mobile tooltip modal overlay */
.mobile-tooltip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.mobile-tooltip-container {
    position: relative;
    width: 90%;
    max-width: 350px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.mobile-tooltip {
    position: relative;
    max-height: calc(80vh - 40px);
    overflow-y: auto;
    border: 2px solid #575757;
    margin: 0;
    width: 100%;
    transform: none;
    top: auto;
    left: auto;
    border-radius: 8px;
}

.mobile-tooltip-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: #333;
    border: 2px solid #666;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10001;
    padding: 0;
}

/* Smooth scroll for mobile tooltip */
.mobile-tooltip::-webkit-scrollbar {
    width: 4px;
}

.mobile-tooltip::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.mobile-tooltip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Make sure the mobile tooltip content is properly formatted */
.mobile-tooltip .item-name {
    padding-right: 20px; /* Space for close button */
}

/* Wishlist button for gear slots */
.wishlist-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #666;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s;
}

.wishlist-button:hover {
    background-color: rgba(30, 255, 0, 0.3);
    transform: scale(1.1);
}

.wishlist-icon {
    color: #ccc;
    font-style: normal;
    font-size: 14px;
    font-weight: bold;
}

/* Wishlist item in gear slot */
.wishlist-item {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    z-index: 5;
}

.wishlist-item-icon {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
}

.wishlist-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wishlist-item-level {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #1eff00;
    font-size: 7px;
    padding: 1px 2px;
    line-height: 1;
}

/* Wishlist modal */
.wishlist-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.wishlist-modal-content {
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #444;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.wishlist-modal-content.mobile {
    width: 95%;
    max-height: 90vh;
}

.wishlist-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #333;
}

.wishlist-modal-header h3 {
    margin: 0;
    color: #fff;
}

.wishlist-modal-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
}

.wishlist-modal-body {
    padding: 15px;
}

.wishlist-search {
    display: flex;
    margin-bottom: 20px;
}

.wishlist-search input {
    flex: 1;
    padding: 10px;
    background-color: rgba(30, 30, 30, 0.9);
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px 0 0 4px;
}

.wishlist-search button {
    padding: 10px 15px;
    background-color: var(--tg-theme-button-color, #2481cc);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.wishlist-results {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: rgba(30, 30, 30, 0.5);
    border-radius: 4px;
}

.wishlist-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.wishlist-result-item {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.wishlist-result-item:hover {
    background-color: rgba(50, 50, 50, 0.5);
    border-color: #555;
}

.wishlist-result-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    border: 2px solid #555;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wishlist-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wishlist-result-name {
    text-align: center;
    font-size: 12px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wishlist-result-ilvl {
    text-align: center;
    font-size: 10px;
    color: #ffff00;
}

.wishlist-current {
    padding: 10px;
    background-color: rgba(30, 30, 30, 0.5);
    border-radius: 4px;
}

.wishlist-current h4 {
    margin-top: 0;
    color: #fff;
}

.current-wishlist-display {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.current-wishlist-display .wishlist-item-icon {
    width: 48px;
    height: 48px;
    margin-right: 15px;
    border: 2px solid #555;
    border-radius: 4px;
}

.wishlist-item-details {
    flex: 1;
}

.wishlist-item-name {
    font-size: 16px;
    margin-bottom: 5px;
}

.wishlist-item-ilvl {
    font-size: 12px;
    color: #ffff00;
}

#remove-wishlist-item {
    background-color: rgba(200, 50, 50, 0.5);
    color: #fff;
    border: 1px solid #700;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s;
}

#remove-wishlist-item:hover {
    background-color: rgba(200, 50, 50, 0.8);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .wishlist-modal-content {
        width: 95%;
    }
    
    .wishlist-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .wishlist-button {
        width: 18px;
        height: 18px;
    }
    
    .wishlist-icon {
        font-size: 12px;
    }
    
    .wishlist-item {
        width: 20px;
        height: 20px;
    }
} 