/* Mask Parts Styling */

:root {
    /* Mask Class Colors */
    --mask-common: #FFFF00; /* Yellow */
    --mask-rare: #008000; /* Green */
    --mask-epic: #0000FF; /* Blue */
    --mask-legendary: #A020F0; /* Purple */
    
    /* Mask Class Background Colors (with opacity) */
    --mask-common-bg: rgba(255, 255, 0, 0.15);
    --mask-rare-bg: rgba(0, 128, 0, 0.15);
    --mask-epic-bg: rgba(0, 0, 255, 0.15);
    --mask-legendary-bg: rgba(160, 32, 240, 0.15);
    
    /* Mask Class Border Colors */
    --mask-common-border: rgba(255, 255, 0, 0.5);
    --mask-rare-border: rgba(0, 128, 0, 0.5);
    --mask-epic-border: rgba(0, 0, 255, 0.5);
    --mask-legendary-border: rgba(160, 32, 240, 0.5);
}

/* Masks Grid Layout */
.masks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* Mask Card Styling */
.mask-card {
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    border: 1px solid #333;
}

/* Add mask class color lines at the top of cards */
.mask-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px; /* Reduced from 6px to be more subtle */
    background-color: transparent;
    z-index: 5;
}

/* Set color for each mask class */
.mask-card[data-mask-class="common"]::before {
    background-color: var(--mask-common);
}

.mask-card[data-mask-class="rare"]::before {
    background-color: var(--mask-rare);
}

.mask-card[data-mask-class="epic"]::before {
    background-color: var(--mask-epic);
}

.mask-card[data-mask-class="legendary"]::before {
    background-color: var(--mask-legendary);
}

/* Card hover effect */
.mask-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Selected card styling */
.mask-card.selected {
    border: 2px solid #555; /* Changed from gold to a more subtle gray */
    box-shadow: 0 0 15px rgba(85, 85, 85, 0.5);
}

/* Mask image container */
.mask-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background-color: #111;
}

/* Mask image */
.mask-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

/* Zoom effect on hover */
.mask-card:hover .mask-image img {
    transform: scale(1.05);
}

/* Mask details section */
.mask-details {
    padding: 15px;
}

/* Mask name */
.mask-name {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mask stars */
.mask-stars {
    font-size: 0.9rem;
    color: #FFD700;
    margin-left: 8px;
}

/* Mask part name */
.mask-part-name {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 8px;
    font-style: italic;
}

/* Mask ID */
.mask-id {
    font-size: 0.8rem;
    color: #999;
    margin-top: 8px;
}

/* Mask class indicator */
.mask-class-indicator {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #ccc;
}

/* Transparent indicator (for consistent spacing) */
.transparent-indicator {
    height: 1.5rem;
    visibility: hidden;
}

/* Mask class label with tooltip */
.mask-class.has-tooltip {
    position: relative;
    cursor: pointer;
    display: inline-block;
    border-bottom: 1px dotted #888; /* Add a dotted underline to indicate it's clickable */
    padding-bottom: 1px;
}

/* Mask class label */
.mask-class {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: capitalize;
}

/* Specific class styles */
.mask-class.common {
    color: #000;
    background-color: var(--mask-common-bg);
    border: 1px solid var(--mask-common-border);
}

.mask-class.rare {
    color: #fff;
    background-color: var(--mask-rare-bg);
    border: 1px solid var(--mask-rare-border);
}

.mask-class.epic {
    color: #fff;
    background-color: var(--mask-epic-bg);
    border: 1px solid var(--mask-epic-border);
}

.mask-class.legendary {
    color: #fff;
    background-color: var(--mask-legendary-bg);
    border: 1px solid var(--mask-legendary-border);
}

/* Mask actions section */
.mask-actions {
    padding: 0 15px 15px;
    display: flex;
    justify-content: center;
}

/* Action button */
.action-btn {
    background-color: #d4af37;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    width: 100%;
}

.action-btn:hover {
    background-color: #c19b2e;
}

/* Filter controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.filter-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #ccc;
    font-weight: 500;
}

.filter-input {
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    outline: none;
}

.filter-select {
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    outline: none;
}

.filter-input:focus, .filter-select:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
    outline: none;
}

/* Add a visual indicator that filters are being applied automatically */
.filter-input, .filter-select {
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filter-input:hover, .filter-select:hover {
    border-color: #d4af37;
}

/* Filter actions */
.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
    flex-basis: 100%;
}

.filter-button {
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #d4af37;
    color: #000;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.filter-button:hover {
    background-color: #c19b2e;
}

/* Style for star emojis in filter dropdown */
#maskStarsFilter option {
    font-size: 1.1rem;
    line-height: 1.5;
    padding: 4px;
}

/* Add a subtle pulsing effect to indicate active filtering */
.filter-input.active, .filter-select.active {
    border-color: #d4af37;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .masks-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-actions {
        justify-content: center;
    }
}

/* Sell button styles */
.sell-mask-btn {
    background-color: #d4af37;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.sell-mask-btn:hover {
    background-color: #c19b2e;
    transform: translateY(-2px);
}

.sell-mask-btn:active {
    transform: translateY(0);
}

/* Listed items styling */
.mask-card.listed {
    position: relative;
    border: 1px solid #d4af37;
}

.listed-overlay {
    position: absolute;
    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: 5;
    border-radius: inherit;
}

.price-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #d4af37;
    color: #000;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10;
}

.listing-price {
    color: #d4af37;
    font-weight: bold;
    margin-top: 5px;
}

.cancel-listing-btn {
    background-color: #ff4d4d;
}

.cancel-listing-btn:hover {
    background-color: #ff3333;
}

/* Filter checkbox styling */
.filter-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.filter-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Add CSS for mask components */
.mask-badge {
    background-color: #d4af37;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: bold;
    vertical-align: middle;
}

.complete-mask {
    /* Make sure it has the same border as other cards */
    border: 1px solid #333 !important;
}

/* Override the !important for listed complete masks */
.mask-card.complete-mask.listed {
    border: 1px solid #d4af37 !important;
}

.mask-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.mask-type.complete {
    background-color: #d4af37;
    color: #000;
}

.components-title {
    font-weight: bold;
    margin: 10px 0 5px 0;
    font-size: 14px;
}

.components-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

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

.component-item:last-child {
    border-bottom: none;
}

.component-name {
    flex: 1;
    font-size: 0.85rem; /* Slightly smaller font */
    color: #ddd; /* Brighter text color */
}

.component-class {
    font-size: 0.75rem; /* Smaller font */
    padding: 1px 4px; /* Reduced padding */
    border-radius: 3px; /* Smaller border radius */
    margin: 0 6px;
    text-transform: capitalize;
}

.component-class.common {
    background-color: rgba(255, 255, 0, 0.2);
    color: #FFFF00;
}

.component-class.rare {
    background-color: rgba(0, 128, 0, 0.2);
    color: #008000;
}

.component-class.epic {
    background-color: rgba(0, 0, 255, 0.2);
    color: #0000FF;
}

.component-class.legendary {
    background-color: rgba(160, 32, 240, 0.2);
    color: #A020F0;
}

.component-stars {
    font-size: 0.75rem; /* Smaller font */
    color: #FFD700;
    min-width: 40px; /* Ensure consistent width */
    text-align: right;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #d4af37;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

.error-message {
    color: #ff6b6b;
    font-size: 12px;
    margin: 5px 0;
}

/* Info and note message styles */
.info-message {
    color: #4CAF50;
    font-size: 12px;
    margin: 5px 0;
    font-weight: bold;
}

.note-message {
    color: #aaa;
    font-size: 11px;
    margin: 2px 0 8px 0;
    font-style: italic;
}

/* Tooltip styling */
.tooltip {
    position: fixed; /* Changed from absolute to fixed for better positioning */
    z-index: 1000;
    background-color: rgba(38, 38, 38, 0.85);
    border: 1px solid rgba(68, 68, 68, 0.7);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, transform 0.2s ease-in-out;
    width: 250px; /* Will be set dynamically */
    left: 50%;
    transform: translate(-50%, -50%); /* Center both horizontally and vertically */
    top: 50%; /* Center vertically */
    pointer-events: none;
    text-align: left;
    backdrop-filter: blur(3px);
}

/* Remove the arrow since it's now centered */
.tooltip:before {
    display: none;
}

/* Make sure the tooltip is visible on hover */
.has-tooltip:hover .tooltip {
    opacity: 1;
    visibility: visible;
    display: block;
}

/* Make sure the tooltip is above other elements */
.mask-class-indicator {
    position: relative;
}

.hover-hint {
    font-size: 10px;
    color: #888;
    font-style: italic;
    margin-top: 2px;
    text-align: center;
}

/* Card tooltip styling */
.card-tooltip {
    position: absolute;
    z-index: 1000;
    background-color: rgba(38, 38, 38, 0.85);
    border: 1px solid rgba(68, 68, 68, 0.7);
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    width: 90%;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    text-align: left;
    backdrop-filter: blur(3px);
}

/* Make the entire card a tooltip trigger */
.mask-card.has-tooltip {
    position: relative;
    cursor: pointer;
}

/* Show tooltip on card hover */
.mask-card.has-tooltip:hover .card-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Special component positioning for mask components - with class selectors */
img.mask-front-element {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    z-index: 99 !important;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
}

img.mask-top-element {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    z-index: 90 !important;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
}

/* Mask composite container */
.mask-image > div {
    position: relative !important;
    width: 110px !important;
    height: 110px !important;
    border: 2px solid #2a4b8d !important;
    border-radius: 5px !important;
    background-color: #1a1a1a !important;
    overflow: visible !important;
    margin: 0 auto !important;
} 