/* ----------------------
   Grundlayout
----------------------- */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #1a202c;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ----------------------
   Header
----------------------- */
header {
    width: 100%;
    max-width: 1200px;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    font-size: 2rem;
    text-align: center;
    color: #3b82f6;
    text-shadow: 0 0 10px #3b82f6;
}

/* Rainbow & Glow */
.glow-efsun {
    position: relative;
    z-index: 0;
    border-radius: 0.375rem;
}
.glow-efsun::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        270deg,#ff0000 0%,#ff7f00 14%,#ffff00 28%,
        #00ff00 42%,#00ffff 57%,#0000ff 71%,#8b00ff 85%,#ff0000 100%
    );
    background-size: 800% 800%;
    animation: rainbowFlow 1s linear infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 1px;
    background-clip: border-box;
}
@keyframes rainbowFlow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

.rainbow-text {
    background: linear-gradient(90deg,#ff0000,#ff7f00,#ffff00,#00ff00,#00ffff,#0000ff,#8b00ff,#ff0000);
    background-size: 800% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbowMove 15s linear infinite;
}
@keyframes rainbowMove { 0% { background-position: 0% center; } 100% { background-position: -800% center; } }

/* ----------------------
   Top Buttons
----------------------- */
.top-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.top-buttons a, .top-buttons button {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #10b981;
    color: #fff;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(16,185,129,0.7);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.top-buttons a:hover, .top-buttons button:hover {
    background-color: #059669;
    box-shadow: 0 0 12px #10b981,0 0 20px #059669;
}

/* ----------------------
   Such- & Filterzeile
----------------------- */
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-top: 15px;
}
.search-form input, .search-form select, .search-form button {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #3b82f6;
    background-color: #111827;
    color: #f3f4f6;
    font-size: 0.95rem;
    box-shadow: 0 0 8px rgba(59,130,246,0.5);
    transition: all 0.2s ease-in-out;
}
.search-form input:focus, .search-form select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 12px #3b82f6;
    outline: none;
}
.search-form button {
    background-color: #3b82f6;
    color: #fff;
    border: none;
    font-weight: bold;
}
.search-form button:hover {
    background-color: #2563eb;
    box-shadow: 0 0 15px #3b82f6,0 0 25px #2563eb;
}

/* ----------------------
   Items Table
----------------------- */
.item-table {
    width: 90%;
    max-width: 1200px;
    border-collapse: separate;
    border-spacing: 0 2px;
    margin: 20px auto;
    table-layout: fixed;
}

.item-table th, .item-table td {
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Feste Spaltenbreiten */
.item-table th:nth-child(1), .item-table td:nth-child(1) { width: 60px; }  /* Icon */
.item-table th:nth-child(2), .item-table td:nth-child(2) { width: 550px; } /* Name & Attribute */
.item-table th:nth-child(3), .item-table td:nth-child(3) { width: 60px; }  /* Anzahl */
.item-table th:nth-child(4), .item-table td:nth-child(4) { width: 100px; } /* Yang */
.item-table th:nth-child(5), .item-table td:nth-child(5) { width: 80px; }  /* Won */
.item-table th:nth-child(6), .item-table td:nth-child(6) { width: 120px; } /* Verkäufer */
.item-table th:nth-child(7), .item-table td:nth-child(7) { width: 150px; } /* Kategorie */

.item-table th {
    background-color: #1e293b;
    color: #3b82f6;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(59,130,246,0.7);
    border-radius: 6px;
}
.item-table tbody tr {
    background-color: #111827;
    transition: 0.2s;
}
.item-table tbody tr:hover {
    background-color: #1f2937;
}

/* ----------------------
   Item Details & Icons
----------------------- */
.item-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.item-icon {
    width: auto;   /* Originalbreite beibehalten */
    height: auto;  /* Originalhöhe beibehalten */
    max-width: 100%;  
    max-height: 100%;
}

.item-name {
    font-weight: normal;
    text-align: left;
    margin-bottom: 5px;
    word-wrap: break-word;
}
.item-attrs span {
    display: inline-block;
    font-size: 11px;
    margin: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    word-wrap: break-word;
}

/* Farben */
.color-normal { color: #c4c4c4 !important; }
.color-special-positive { color: #b0dfb4 !important; }
.highlight { box-shadow: 0 0 8px #fffa8c; background-color: #fffa8c; font-weight: bold; color: #111827; }
.color-price { color: #ffd700 !important; }
.color-rare { color: #93c5fd !important; }

/* Sockets */
.stone-container { display: flex; justify-content: flex-start; margin-top: 5px; }
.stone-icon-wrapper { width: 32px; height: 32px; margin-right: 4px; }
.stone-icon { width: 28px; height: 28px; }

/* ----------------------
   Tooltip
----------------------- */
.item-tooltip {
    position: absolute;
    z-index: 9999;
    width: max-content;
    max-width: 450px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    color: #f1f5f9;
    font-size: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid rgba(71,85,105,0.5);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.group:hover .item-tooltip { opacity: 1; transform: translateX(0); }

/* ----------------------
   Pagination
----------------------- */
.pagination {
    text-align: center;
    margin: 20px 0;
}
.pagination a {
    padding: 6px 10px;
    margin: 2px;
    background-color: #1f2937;
    color: #f3f4f6;
    border-radius: 6px;
    transition: 0.2s;
}
.pagination a:hover {
    background-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59,130,246,0.7);
}
.pagination a.active {
    background-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 12px rgba(59,130,246,0.9);
}

/* ----------------------
   Footer
----------------------- */
footer {
    width: 100%;
    text-align: center;
    padding: 15px;
    background-color: #1e293b;
    color: #9ca3af;
    box-shadow: 0 0 8px rgba(59,130,246,0.5);
}

/* ----------------------
   Responsive
----------------------- */
@media (max-width: 768px) {
    .item-table, .item-table th, .item-table td { font-size: 0.75rem; }
    .item-table td { padding: 6px 4px; }
}

/* ----------------------
   Tabellen-Inhalte zentrieren
----------------------- */
/* Name & Attribute bleibt linksbündig */
.item-table td:nth-child(2),
.item-table th:nth-child(2) {
    text-align: left;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Andere Spalten mittig */
.item-table td:nth-child(1),
.item-table th:nth-child(1),
.item-table td:nth-child(3),
.item-table th:nth-child(3),
.item-table td:nth-child(4),
.item-table th:nth-child(4),
.item-table td:nth-child(5),
.item-table th:nth-child(5),
.item-table td:nth-child(6),
.item-table th:nth-child(6),
.item-table td:nth-child(7),
.item-table th:nth-child(7)
{
    text-align: center;
    vertical-align: middle;
}
