/**
 * Schwarzmarkt (Blackmarket) CSS
 * Modern styling for the blackmarket pages
 */

/* Main container */
.blackmarket-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    padding: 20px;
    color: #fff;
}

/* Header styles */
.blackmarket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.blackmarket-title {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

.blackmarket-subtitle {
    font-size: 16px;
    color: #aaa;
    margin: 5px 0 0 0;
}

/* Navigation tabs */
.blackmarket-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.blackmarket-tab {
    padding: 10px 20px;
    background-color: #444;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.blackmarket-tab:hover {
    background-color: #555;
    text-decoration: none;
    color: #fff;
}

.blackmarket-tab.active {
    background-color: #24BC06;
    color: #fff;
    font-weight: bold;
}

/* Table styles */
.blackmarket-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.blackmarket-table th {
    background-color: #444;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.blackmarket-table td {
    padding: 10px;
    border-bottom: 1px solid #444;
    vertical-align: middle;
}

.blackmarket-table tr:hover {
    background-color: #333;
}

/* Item styles */
.item-name {
    font-weight: bold;
    cursor: pointer;
    color: #24BC06;
}

.item-name:hover {
    text-decoration: underline;
}

.item-stock {
    font-weight: bold;
}

.item-rate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.item-action {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Price styles */
.price-up {
    color: #24BC06;
    font-weight: bold;
}

.price-down {
    color: #ff4444;
    font-weight: bold;
}

.price-neutral {
    color: #fff;
    font-weight: bold;
}

.price-change {
    animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
    0% { background-color: transparent; }
    50% { background-color: rgba(36, 188, 6, 0.3); }
    100% { background-color: transparent; }
}

/* Input styles */
.blackmarket-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    text-align: center;
}

.blackmarket-input:focus {
    outline: none;
    border-color: #24BC06;
    box-shadow: 0 0 0 2px rgba(36, 188, 6, 0.3);
}

.blackmarket-input.focused {
    border-color: #24BC06;
}

/* Total row styles */
.blackmarket-total {
    background-color: #333;
    font-weight: bold;
}

.blackmarket-total-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.blackmarket-total-value {
    font-size: 18px;
    color: #24BC06;
    font-weight: bold;
}

/* Button styles */
.blackmarket-button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    color: #fff;
    background-color: #444;
    transition: background-color 0.2s;
}

.blackmarket-button:hover {
    background-color: #555;
    text-decoration: none;
    color: #fff;
}

.blackmarket-button-primary {
    background-color: #24BC06;
    color: #fff;
}

.blackmarket-button-primary:hover {
    background-color: #1d9a05;
}

.blackmarket-button-secondary {
    background-color: #666;
    color: #fff;
}

.blackmarket-button-secondary:hover {
    background-color: #777;
}

/* Message styles */
.blackmarket-messages {
    margin-bottom: 20px;
}

.blackmarket-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: opacity 0.5s;
}

.blackmarket-message-success {
    background-color: rgba(36, 188, 6, 0.2);
    border-left: 4px solid #24BC06;
}

.blackmarket-message-error {
    background-color: rgba(255, 68, 68, 0.2);
    border-left: 4px solid #ff4444;
}

/* Tooltip styles */
.blackmarket-tooltip {
    position: absolute;
    display: none;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 300px;
}

.blackmarket-tooltip-header {
    font-weight: bold;
    color: #24BC06;
    margin-bottom: 5px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.blackmarket-tooltip-content {
    color: #fff;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.cursor-pointer {
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blackmarket-container {
        padding: 10px;
        border-radius: 4px;
    }
    
    .blackmarket-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .blackmarket-title {
        font-size: 1.5rem;
    }

    .blackmarket-subtitle {
        font-size: 0.875rem;
    }

    .blackmarket-tabs {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .blackmarket-tab {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }
    
    /* Responsive table for mobile */
    .blackmarket-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .blackmarket-table thead {
        display: none;
    }

    .blackmarket-table tbody,
    .blackmarket-table tr,
    .blackmarket-table td {
        display: block;
        width: 100%;
    }

    .blackmarket-table tr {
        margin-bottom: 1rem;
        padding: 0.75rem;
        border: 2px solid #444;
        border-radius: 4px;
        background-color: #333;
    }

    .blackmarket-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0 !important;
        border: none !important;
        text-align: left !important;
    }

    .blackmarket-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #aaa;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .blackmarket-table td:last-child {
        border-bottom: none;
    }
    
    .blackmarket-input {
        width: 80px;
        font-size: 1rem;
    }

    .blackmarket-button {
        padding: 0.75rem 1rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    .blackmarket-total {
        padding: 1rem !important;
    }

    .blackmarket-total-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .blackmarket-total-value {
        font-size: 1.5rem;
    }

    /* Mobile item styles */
    .item-name,
    .item-stock,
    .item-rate,
    .item-price,
    .item-action {
        justify-content: flex-start;
    }

    /* Tooltip mobile adjustments */
    .blackmarket-tooltip {
        max-width: 90vw;
        left: 5vw !important;
        right: 5vw !important;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .blackmarket-container {
        padding: 5px;
        margin-bottom: 10px;
    }

    .blackmarket-title {
        font-size: 1.25rem;
    }

    .blackmarket-subtitle {
        font-size: 0.75rem;
    }

    .blackmarket-tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.875rem;
    }

    .blackmarket-input {
        width: 70px;
        font-size: 0.9rem;
    }

    .blackmarket-button {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }

    .blackmarket-message {
        padding: 10px;
        font-size: 0.875rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 991px) {
    .blackmarket-container {
        padding: 15px;
    }

    .blackmarket-table th,
    .blackmarket-table td {
        padding: 8px;
        font-size: 0.9rem;
    }

    .blackmarket-input {
        width: 55px;
    }

    .blackmarket-tabs {
        flex-wrap: wrap;
    }
}

/* Desktop enhancements */
@media (min-width: 992px) {
    .blackmarket-table tr:hover {
        transform: scale(1.01);
        transition: transform 0.2s, background-color 0.2s;
    }

    .blackmarket-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .blackmarket-tab:hover {
        transform: translateY(-2px);
    }
}

/* Landscape mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .blackmarket-container {
        padding: 0.5rem;
    }

    .blackmarket-title {
        font-size: 1.25rem;
    }

    .blackmarket-tab {
        padding: 0.5rem 1rem;
    }
}

/* Print styles */
@media print {
    .blackmarket-tabs,
    .blackmarket-button,
    .blackmarket-input {
        display: none !important;
    }

    .blackmarket-container {
        background-color: #fff;
        color: #000;
        box-shadow: none;
    }

    .blackmarket-table th,
    .blackmarket-table td {
        color: #000;
        background-color: #fff;
        border: 1px solid #000;
    }
}
