* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MedievalSharp', 'Georgia', serif;
    background: linear-gradient(rgba(20, 15, 10, 0.85), rgba(20, 15, 10, 0.85));
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #3a2c1c;
    display: block;
    align-items: center;
}

a {
    text-decoration: none;
    color: #3a2c1c;
}

.container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    text-align: center;
    color: #d4af37;
    margin-bottom: 20px;
    padding: 15px;
    width: 100%;
    border-bottom: 3px solid #8b4513;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(rgba(60, 40, 20, 0.8), rgba(40, 25, 10, 0.8));
    background-size: cover;
    border-radius: 10px;
    border: 5px solid #5d4037;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
    color: #f5deb3;
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
    color: #d4af37;
}

.card {
    background: linear-gradient(rgba(250, 240, 220, 0.95), rgba(240, 230, 210, 0.95));
    background-size: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 3px solid #8b4513;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.table-container {
    overflow-x: auto;
    width: 100%;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    width: 100%;
    min-width: 1200px;
}

thead {
    background: 
        linear-gradient(to bottom, #5d4037, #3e2723);
    background-size: cover;
    color: #f5deb3;
    border-bottom: 2px solid #d4af37;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s;
    border-right: 1px solid #795548;
    font-family: 'MedievalSharp', cursive;
}

th:last-child {
    border-right: none;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
}

.sortable:hover {
    background: linear-gradient(to bottom, #6d4c41, #4e342e);
}

.sort-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    opacity: 0.6;
    flex-shrink: 0;
}

.sort-arrow.asc {
    border-bottom: 6px solid #d4af37;
    border-top: none;
    opacity: 1;
}

.sort-arrow.desc {
    border-top: 6px solid #d4af37;
    border-bottom: none;
    opacity: 1;
}

tbody tr {
    border-bottom: 1px solid #d4af37;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: rgba(139, 69, 19, 0.1);
}

tbody tr:nth-child(even) {
    background-color: rgba(245, 222, 179, 0.2);
}

tbody tr:nth-child(even):hover {
    background-color: rgba(139, 69, 19, 0.15);
}

/* Stil für Items ohne Marktdaten */
tbody tr.no-market-data {
    background-color: rgba(139, 0, 0, 0.1);
}

tbody tr.no-market-data:hover {
    background-color: rgba(139, 0, 0, 0.15);
}

tbody tr.no-market-data:nth-child(even) {
    background-color: rgba(139, 0, 0, 0.2);
}

tbody tr.no-market-data:nth-child(even):hover {
    background-color: rgba(139, 0, 0, 0.25);
}

/* Stil für meine Angebote */
tbody tr.my-offer {
    background-color: rgba(0, 100, 0, 0.1);
}

tbody tr.my-offer:hover {
    background-color: rgba(0, 100, 0, 0.15);
}

tbody tr.my-offer:nth-child(even) {
    background-color: rgba(0, 100, 0, 0.2);
}

tbody tr.my-offer:nth-child(even):hover {
    background-color: rgba(0, 100, 0, 0.25);
}

td {
    padding: 10px 15px;
    color: #3a2c1c;
    white-space: nowrap;
    font-size: 0.95rem;
    border-right: 1px solid rgba(139, 69, 19, 0.2);
}

td:last-child {
    border-right: none;
}

.item-name-container {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
}

.item-name {
    font-weight: 600;
    color: #3a2c1c;
    white-space: nowrap;
    font-size: 0.95rem;
    font-family: 'MedievalSharp', Georgia, serif;
}

/* Items ohne Marktdaten grau darstellen */
.no-market-data .item-name {
    color: #8b7355;
    font-style: italic;
}

.no-market-data .price,
.no-market-data .quantity,
.no-market-data .percentage {
    color: #8b7355;
    font-style: italic;
}

/* Preis Container für Gold-Icon */
.price-container {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    white-space: nowrap;
}

.price {
    font-family: 'MedievalSharp', 'Courier New', monospace;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.95rem;
}

.gold-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(1.1) drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
}

.min-price {
    color: #2e7d32;
}

.max-price {
    color: #c62828;
}

.weighted-price {
    color: #6a1b9a;
    font-weight: 600;
}

.quantity {
    color: #1565c0;
    font-weight: 600;
}

.my-quantity {
    color: #7b1fa2;
    font-weight: 600;
}

.percentage {
    color: #ef6c00;
    font-weight: 600;
}

.my-price {
    color: #00695c;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #d4af37;
    font-size: 1.2rem;
    background: rgba(40, 25, 10, 0.9);
    border-radius: 8px;
    border: 3px solid #5d4037;
    margin: 20px;
}

.error {
    text-align: center;
    padding: 40px;
    color: #d32f2f;
    background: 
        linear-gradient(rgba(250, 240, 220, 0.95), rgba(240, 230, 210, 0.95));
    background-size: cover;
    border-radius: 8px;
    margin: 20px;
    font-size: 1rem;
    border: 3px solid #8b4513;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.error p {
    margin-bottom: 15px;
}

.controls {
    background: 
        linear-gradient(rgba(60, 40, 20, 0.9), rgba(40, 25, 10, 0.9));
    background-size: cover;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    width: 100%;
    border: 3px solid #5d4037;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-box {
    padding: 12px 15px;
    border: 2px solid #8b4513;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
    flex: 1;
    min-width: 0;
    background: rgba(245, 222, 179, 0.9);
    color: #3a2c1c;
    font-family: 'MedievalSharp', Georgia, serif;
}

.search-box:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background: rgba(255, 248, 225, 0.95);
}

.search-box::placeholder {
    color: #8b7355;
}

.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    width: 100%;
}

.stat-box {
    background: 
        linear-gradient(rgba(250, 240, 220, 0.95), rgba(240, 230, 210, 0.95));
    background-size: cover;
    padding: 15px 25px;
    border-radius: 8px;
    text-align: center;
    min-width: 160px;
    border: 3px solid #8b4513;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3a2c1c;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.85rem;
    color: #8b4513;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

#myStats {
    margin-top: 15px;
}

/* Dekorative Elemente */
.header::before,
.header::after {
    content: "⚔️";
    margin: 0 15px;
    font-size: 1.5rem;
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar {
    height: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(139, 69, 19, 0.2);
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, #8b4513, #5d4037);
    border-radius: 6px;
    border: 2px solid rgba(245, 222, 179, 0.5);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to right, #a0522d, #6d4c41);
}

/* Formular-Stile */
.form {
    background: 
        linear-gradient(rgba(250, 240, 220, 0.95), rgba(240, 230, 210, 0.95));
    background-size: cover;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    border: 5px solid #8b4513;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

/* Form-Elemente */
.form form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.form label {
    font-family: 'MedievalSharp', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 5px;
    display: block;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
}

.form input[type="text"],
.form select {
    padding: 14px 18px;
    border: 3px solid #8b4513;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'MedievalSharp', Georgia, serif;
    background: rgba(245, 222, 179, 0.9);
    color: #3a2c1c;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form input[type="text"]:focus,
.form select:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(255, 248, 225, 0.95);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3),
                inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Placeholder Styling */
.form input::placeholder {
    color: #8b7355;
    font-style: italic;
}

/* Select Pfeil Styling */
.form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b4513' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    padding-right: 50px;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(to bottom, #8b4513, #5d4037);
    color: #f5deb3;
    padding: 16px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'MedievalSharp', Georgia, serif;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.submit-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #a0522d, #6d4c41);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.submit-btn:hover::before {
    opacity: 1;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: #f5deb3;
    color: #fff;
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.submit-btn::after {
    content: "🏰";
    margin-left: 10px;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form {
        padding: 20px;
        margin: 10px;
    }
    
    .form input[type="text"],
    .form select {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 14px 20px;
        font-size: 1.1rem;
    }
}

/* Dekorative Ornamente */
.form .ornament {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.3;
}

.form .ornament.top-left {
    top: 15px;
    left: 15px;
    border-top: 2px solid #8b4513;
    border-left: 2px solid #8b4513;
}

.form .ornament.top-right {
    top: 15px;
    right: 15px;
    border-top: 2px solid #8b4513;
    border-right: 2px solid #8b4513;
}

.form .ornament.bottom-left {
    bottom: 15px;
    left: 15px;
    border-bottom: 2px solid #8b4513;
    border-left: 2px solid #8b4513;
}

.form .ornament.bottom-right {
    bottom: 15px;
    right: 15px;
    border-bottom: 2px solid #8b4513;
    border-right: 2px solid #8b4513;
}

/* Formular-Gruppen für bessere Struktur */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label::before {
    content: "•";
    color: #d4af37;
    font-size: 1.5rem;
}