* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Neue Haas Grotesk', 'Arial', sans-serif;
    background: #0a0a0a;
    color: #c4c4c4;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 500;
}

/* Animated particle background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
}

.header-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

h1 {
    text-align: center;
    font-size: 2.2em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

/* Settings icon link */
/* Legacy settings-link retained for reference; new square button is #settings-button */
#settings-button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Setup Panel */
.setup-panel {
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 40px;
    margin: 40px auto;
    max-width: 700px;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}

.setup-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.setup-content h2 {
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.setup-content p {
    color: #999;
    margin-bottom: 15px;
    line-height: 1.6;
}

.setup-info {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.setup-status {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: #888;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
}

.status-value {
    color: #666;
    font-weight: 500;
}

.status-value.ready {
    color: #4a9d5f;
}

.status-value.downloading {
    color: #d4af37;
}

.status-value.error {
    color: #c85050;
}

.setup-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

/* Allow Braytech button to stretch full width when needed */
.button.full {
    max-width: none;
    width: 100%;
}

.primary-button {
    flex: 1;
    padding: 16px 32px;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.6);
    color: #d4af37;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.primary-button:hover {
    background: rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-button {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.secondary-button:hover {
    border-color: rgba(200, 80, 80, 0.4);
    color: #c85050;
}

.progress-container {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f0d070);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
}

/* Restore original tab styles */
.tab {
    padding: 14px 28px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.tab:hover {
    background: rgba(40, 40, 40, 0.9);
    border-color: rgba(212, 175, 55, 0.3);
    color: #c4c4c4;
}

.tab.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.6);
    color: #d4af37;
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.1);
}

.tab-content {
    display: none;
    background: rgba(15, 15, 15, 0.85);
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.tab-content.active {
    display: block;
}

.search-section {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

input[type="text"] {
    flex: 1;
    min-width: 300px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.95em;
    transition: all 0.2s ease;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

input[type="text"]:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.1);
}

input[type="text"]::placeholder {
    color: #666;
}

/* Keep generic button tag styles minimal to avoid clashing with Braytech .button */
button { font: inherit; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: #999;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    border-color: rgba(212, 175, 55, 0.3);
    color: #c4c4c4;
}

input[type="checkbox"] {
    cursor: pointer;
    accent-color: #d4af37;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    padding: 20px;
}

.item-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.item-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(20, 20, 20, 0.7);
    box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.05);
}

.item-card.selected {
    border-color: rgba(212, 175, 55, 0.8);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: inset 0 0 40px rgba(212, 175, 55, 0.1), 0 0 20px rgba(212, 175, 55, 0.15);
}

.item-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.item-icon {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.item-name {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 6px;
    color: #e8e8e8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-type {
    color: #777;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perk-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 6px;
    padding: 20px;
}

.perk-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.perk-item:hover {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(20, 20, 20, 0.6);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.05);
}

.perk-item.hidden-perk {
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

.perk-item.hidden-perk .perk-name {
    color: #888;
    font-style: italic;
}

.perk-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.perk-info {
    flex: 1;
    min-width: 0;
}

.perk-name {
    font-weight: 700;
    margin-bottom: 5px;
    color: #d4af37;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perk-index {
    color: #888;
    font-size: 0.9em;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
}

/* Admin quick edit gear */
.perk-gear {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #d4af37;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.85;
    transition: all 0.15s ease;
    z-index: 2;
}
.perk-gear:hover {
    background: rgba(20,20,20,0.6);
    border-color: rgba(212, 175, 55, 0.65);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}
.perk-gear span {
    font-size: 14px;
    line-height: 1;
}

/* Quick editor floating panel */
.quick-editor-panel {
    position: fixed;
    min-width: 340px;
    max-width: 420px;
    background: rgba(10,10,10,0.98);
    border: 1px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    padding: 14px;
    z-index: 2000;
    backdrop-filter: blur(8px);
}
.quick-editor-panel h4 {
    margin-bottom: 10px;
    color: #d4af37;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.quick-editor-panel textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    background: rgba(255,255,255,0.06);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: 6px;
    box-sizing: border-box;
}
.quick-editor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}
.quick-editor-actions {
    display: flex;
    gap: 8px;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: rgba(5, 5, 5, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 18px;
    max-width: 380px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(212, 175, 55, 0.05);
    backdrop-filter: blur(10px);
    display: none;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.tooltip.show {
    display: block;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tooltip-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tooltip-title {
    flex: 1;
}

.tooltip-name {
    font-weight: 700;
    font-size: 1.3em;
    color: #d4af37;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip-index {
    color: #666;
    font-size: 0.85em;
    font-family: monospace;
}

.tooltip-description {
    color: #aaa;
    line-height: 1.8;
    font-size: 1.05em;
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.status {
    text-align: center;
    padding: 12px;
    margin: 0;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-left: 3px solid rgba(212, 175, 55, 0.5);
    color: #999;
    font-size: 0.9em;
}

.error {
    background: rgba(200, 80, 80, 0.1);
    border-color: rgba(200, 80, 80, 0.3);
    border-left-color: rgba(200, 80, 80, 0.6);
    color: #c85050;
}

.results-count {
    padding: 12px 20px;
    color: #666;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-card, .perk-item {
    animation: fadeIn 0.3s ease;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(212, 175, 55, 0.95);
    color: #0a0a0a;
    padding: 16px 32px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Make perk index clickable styling */
.perk-index:hover,
.tooltip-index:hover {
    color: #d4af37;
    text-decoration: underline;
}

/* Seasonal iframe */
.seasonal-iframe {
    width: 100%;
    height: calc(100vh - 250px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(0, 0, 0, 0.3);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
