:root {
    --bg-color: #2c3e50;
    --panel-color: #34495e;
    --text-color: #ecf0f1;
    --accent-color: #f1c40fe8;
    --border-color: #4a627a;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --btn-hover-color: #4a627a;
}

/* --- General Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.modal-open {
    overflow: hidden;
}

h1 {
    text-align: center;
    color: var(--accent-color);
    text-shadow: 1px 1px 2px var(--shadow-color);
}

/* --- Header and Navigation --- */
header {
    background-color: #34495e;
    padding: 1rem;
    border-bottom: 1px solid #4a627a;
}

.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #f1c40f;
}

.hamburger-menu {
    display: none;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-menu .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: 0.4s;
}

/* --- Main Content --- */
main {
    padding: 2rem;
}

.main-container {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
    flex: 1;
}

.page-description {
    background-color: var(--panel-color);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.page-description p {
    margin: 0;
    line-height: 1.6;
}

.dev-notice {
    background-color: var(--accent-color);
    color: var(--bg-color);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9em;
    font-weight: bold;
}

.dev-notice > p {
    margin: 0;
}

/* --- Filters --- */
.filters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    margin-bottom: 25px;
    background-color: var(--panel-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group-label {
    font-weight: bold;
    color: #bdc3c7;
    flex-shrink: 0;
    width: 80px;
    text-align: right;
}

.filter-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-btn {
    background-color: var(--bg-color);
    color: #bdc3c7;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    flex-grow: 1;
    flex-basis: 120px;
}

.filter-btn:hover {
    border-color: #7f8c8d;
    background-color: var(--btn-hover-color);
    color: var(--text-color);
}

.filter-btn.active {
    color: var(--text-color);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.3);
    background-color: #2980b9; 
    border-color: #3498db;
}

.filter-btn[data-filter="mythic"].active { background-color: #794b45; border-color: #9d6f68;}
.filter-btn[data-filter="legendary"].active { background-color: #805d24; border-color: #a4814c;}
.filter-btn[data-filter="epic"].active { background-color: #58304e; border-color: #7c526f;}

/* --- Lists and Tables --- */
.list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    width: 100%;
}

.sets-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.challenges-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.challenges-table th, .challenges-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
    font-size: 0.9em;
}

.challenges-table th {
    background-color: var(--panel-color);
    color: var(--accent-color);
    cursor: pointer;
    position: relative;
}

.challenges-table th::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
}

.challenges-table th.sort-asc::after {
    border-bottom-color: var(--accent-color);
}

.challenges-table th.sort-desc::after {
    border-top-color: var(--accent-color);
}

.challenges-table td:last-child {
    text-align: center;
}

.challenges-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.challenges-table tbody tr:hover {
    background-color: var(--btn-hover-color);
    cursor: pointer;
}

/* --- Artifacts --- */
.artifact-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid transparent;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.artifact-item img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
}

.artifact-item:hover { 
    transform: scale(1.08); 
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); 
}

.artifact-item.rarity-epic   { background-image: url('./img/epic.png'); }
.artifact-item.rarity-legendary { background-image: url('./img/legend.png'); }
.artifact-item.rarity-mythic    { background-image: url('./img/myth.png'); }

/* --- Sets --- */
.set-item {
    background-color: var(--panel-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
}

.set-icon-wrapper {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.set-icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
}

.set-details {
    text-align: left;
}

.set-details h3 {
    margin-top: 0;
}

/* --- Modal --- */
.modal-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: 1000;
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s ease-in-out;
}

.modal-overlay.visible { 
    opacity: 1; 
    pointer-events: auto; 
}

.modal-content {
    background-color: var(--panel-color); 
    padding: 30px; 
    border-radius: 10px; 
    max-width: 800px;
    width: 90%; 
    max-height: 90vh; 
    overflow-y: auto; 
    position: relative; 
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 25px var(--shadow-color); 
    transform: scale(0.95); 
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.visible .modal-content { 
    transform: scale(1); 
}

.modal-close-btn {
    position: absolute; 
    top: 10px; 
    right: 15px; 
    background: none; 
    border: none; 
    font-size: 2.5em;
    color: #bdc3c7; 
    cursor: pointer; 
    line-height: 1; 
    padding: 0;
}

.modal-close-btn:hover { 
    color: var(--text-color); 
}

#modal-body .detail-header { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 15px; 
    margin-bottom: 15px; 
}

#modal-body .detail-icon-wrapper { 
    width: 100px; 
    height: 100px; 
    flex-shrink: 0; 
}

#modal-body .detail-name { 
    margin: 0; 
    font-size: 2em; 
    color: var(--text-color); 
}

#modal-body .detail-rarity {
    text-transform: capitalize; 
    font-weight: bold; 
    padding: 5px 10px; 
    border-radius: 5px;
    display: inline-block; 
    margin-top: 5px; 
    font-size: 0.9em; 
    color: white; 
    text-shadow: 1px 1px 2px var(--shadow-color);
}

.detail-rarity.rarity-epic { background-color: #58304e; }
.detail-rarity.rarity-legendary { background-color: #805d24; }
.detail-rarity.rarity-mythic { background-color: #794b45; }

#modal-body .detail-section h3 { 
    color: var(--accent-color); 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 5px; 
    margin-top: 25px; 
}

#modal-body .detail-stats ul { 
    list-style-type: none; 
    padding: 0; 
}

#modal-body .detail-stats li { 
    background-color: var(--bg-color); 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 8px; 
    font-size: 1.1em; 
}

#modal-body .detail-effect p { 
    line-height: 1.6; 
    white-space: pre-wrap; 
    background-color: var(--bg-color); 
    padding: 15px; 
    border-radius: 4px; 
}

/* --- Buttons --- */
.donate-btn {
    width: 140px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #f59e0b;
    color: white;
}

.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- Footer --- */
footer {
    background-color: #34495e;
    color: #bdc3c7;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.9em;
    border-top: 1px solid #4a627a;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { 
    width: 10px; 
}

::-webkit-scrollbar-track { 
    background: var(--panel-color); 
    border-radius: 8px; 
}

::-webkit-scrollbar-thumb { 
    background: #7f8c8d; 
    border-radius: 8px; 
}

::-webkit-scrollbar-thumb:hover { 
    background: #95a5a6; 
}

/* --- Media Queries --- */
@media (max-width: 800px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        background-color: var(--panel-color);
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        z-index: 1;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 1rem 0;
    }

    .hamburger-menu {
        display: block;
    }
}

@media (min-width: 800px) {
    .sets-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .sets-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
