/* Base DayZ-like Styling - Reusing from Workshop Version */
body {
    font-family: 'Roboto Mono', monospace, sans-serif; /* Simulating DayZ's monospaced, utilitarian feel */
    background-color: #1a1a1a; /* Dark, gritty background */
    color: #d0d0d0; /* Off-white text */
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    overflow: hidden; /* Hide scrollbars if content doesn't exceed view */
    font-size: 0.9em;
}

.dayz-ui-container {
    width: 1050px; /* Wider for more features */
    height: 750px; /* Taller for more content */
    background-color: rgba(30, 30, 30, 0.95); /* Semi-transparent dark background */
    border: 1px solid #444;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px); /* Add blur effect for better readability */
    padding: 15px;
    box-sizing: border-box;
}

.header {
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
    margin-bottom: 15px;
    color: #e0e0e0;
    font-size: 1.6em; /* Slightly larger */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
}

.nav-tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-bottom: none;
    margin-right: 5px;
    transition: background-color 0.2s, border-color 0.2s;
    text-transform: uppercase;
    font-weight: bold;
    color: #b0b0b0;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.nav-tab:hover {
    background-color: #3a3a3a;
    color: #e0e0e0;
}

.nav-tab.active {
    background-color: #1e1e1e; /* Match container background */
    border-color: #555;
    color: #e0e0e0;
}

.tab-content {
    flex-grow: 1;
    background-color: #1e1e1e;
    padding: 20px;
    display: none;
    flex-direction: column;
}

/* Specific layout for browse tab */
#browse.tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#browse .current-currency {
    flex-shrink: 0; /* Prevent shrinking */
    margin-bottom: 15px;
}

#browse .search-filter-bar {
    flex-shrink: 0; /* Prevent shrinking */
    margin-bottom: 15px;
}

#browse .marketplace-list {
    flex-grow: 1; /* Take remaining space */
    overflow-y: auto; /* Only this area scrolls */
    min-height: 0; /* Required for flexbox to work properly */
}

/* Specific layout for my listings tab */
#myListings.tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#myListings .current-currency {
    flex-shrink: 0; /* Prevent shrinking */
    margin-bottom: 15px;
}

#myListings .my-listings-list {
    flex-grow: 1; /* Take remaining space */
    overflow-y: auto; /* Only this area scrolls */
    min-height: 0; /* Required for flexbox to work properly */
}

/* Specific layout for list item tab */
#list.tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#list .current-currency {
    flex-shrink: 0; /* Prevent shrinking */
    margin-bottom: 15px;
}

#list .listing-details-area {
    flex-grow: 1; /* Take remaining space */
    overflow-y: auto; /* Only this area scrolls */
    min-height: 0; /* Required for flexbox to work properly */
}

/* Specific layout for mailbox tab */
#mailbox.tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#mailbox .mailbox-list {
    flex-grow: 1; /* Take remaining space */
    overflow-y: auto; /* Only this area scrolls */
    min-height: 0; /* Required for flexbox to work properly */
    margin-bottom: 15px;
}

/* Specific layout for admin tab */
#admin.tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Webkit scrollbar styling for scrollable areas */
#browse .marketplace-list::-webkit-scrollbar,
#myListings .my-listings-list::-webkit-scrollbar,
#list .listing-details-area::-webkit-scrollbar,
#mailbox .mailbox-list::-webkit-scrollbar {
    width: 8px;
}

#browse .marketplace-list::-webkit-scrollbar-track,
#myListings .my-listings-list::-webkit-scrollbar-track,
#list .listing-details-area::-webkit-scrollbar-track,
#mailbox .mailbox-list::-webkit-scrollbar-track {
    background: #333;
}

#browse .marketplace-list::-webkit-scrollbar-thumb,
#myListings .my-listings-list::-webkit-scrollbar-thumb,
#list .listing-details-area::-webkit-scrollbar-thumb,
#mailbox .mailbox-list::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}

#browse .marketplace-list::-webkit-scrollbar-thumb:hover,
#myListings .my-listings-list::-webkit-scrollbar-thumb:hover,
#list .listing-details-area::-webkit-scrollbar-thumb:hover,
#mailbox .mailbox-list::-webkit-scrollbar-thumb:hover {
    background-color: #888;
}

.tab-content.active {
    display: block;
}

/* Form elements */
label {
    display: block;
    margin-bottom: 5px;
    color: #b0b0b0;
    font-size: 0.9em;
}

select, input[type="text"], input[type="number"] {
    width: calc(100% - 10px);
    padding: 8px;
    margin-bottom: 10px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #d0d0d0;
    border-radius: 2px;
    box-sizing: border-box;
}
input[type="checkbox"] {
    margin-right: 5px;
}

button {
    background-color: #4CAF50; /* Greenish for action */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

button.cancel-btn {
    background-color: #f44336; /* Red for cancel */
}

button.collect-btn {
    background-color: #008CBA; /* Blue for collect */
}
button.adjust-btn {
    background-color: #FFA500; /* Orange for adjustment */
}
button.relist-btn {
    background-color: #6A5ACD; /* Slate blue for relist */
}
button.barter-btn {
    background-color: #8A2BE2; /* Purple for barter */
}

button:hover:not(:disabled) {
    opacity: 0.8;
}

button:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Marketplace List Styling */
.marketplace-list, .my-listings-list, .mailbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.listing-item {
    background-color: #252525;
    border: 1px solid #3a3a3a;
    padding: 10px 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 3px;
}

.listing-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.listing-image {
    flex-shrink: 0;
}

.listing-details {
    flex-grow: 1;
}

.listing-info .name {
    color: #e0e0e0;
    font-weight: bold;
    margin-bottom: 3px;
}

.listing-info .details {
    color: #b0b0b0;
    font-size: 0.8em;
}
.listing-info .details span {
    margin-right: 10px;
}
.listing-info .attachments {
    font-style: italic;
    color: #909090;
    font-size: 0.75em;
    margin-top: 3px;
}

.listing-actions {
    margin-left: 15px;
    display: flex;
    gap: 8px; /* Space between buttons */
    align-items: center;
    min-width: 150px; /* Give actions some consistent width */
}
.listing-actions .price {
     color: #9acd32; /* Lime green for currency */
    font-weight: bold;
    font-size: 1.0em;
     white-space: nowrap; /* Prevent price from wrapping */
}

.current-currency {
    text-align: right;
    margin-bottom: 10px;
    color: #9acd32; /* Lime green for currency */
    font-weight: bold;
    font-size: 1.1em;
    padding-right: 5px;
}

.form-group {
    margin-bottom: 15px;
    border-bottom: 1px dashed #3a3a3a;
    padding-bottom: 15px;
}

.message {
    color: #FFD700; /* Gold for messages */
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}

/* Advanced Search/Filter Section */
.search-filter-bar {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
}
.search-filter-bar > div {
    flex: 1; /* Distribute space */
    min-width: 150px; /* Minimum width for each filter */
}
.search-filter-bar label {
    margin-bottom: 3px;
}
.search-filter-bar input, .search-filter-bar select {
    width: 100%;
    margin-bottom: 0; /* Override default margin */
}

.listing-details-area {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 15px;
}
.listing-item-preview {
    flex: 1;
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 3px;
}
.listing-item-preview h4 {
    margin-top: 0;
    color: #e0e0e0;
    border-bottom: 1px dashed #444;
    padding-bottom: 5px;
    margin-bottom: 10px;
}
.listing-item-preview p {
    margin: 5px 0;
    font-size: 0.85em;
}
.listing-item-preview ul {
    list-style: none;
    padding-left: 15px;
    margin: 5px 0;
    font-size: 0.8em;
    color: #b0b0b0;
}
.listing-item-preview ul li {
    margin-bottom: 2px;
}

.listing-options {
    flex: 2;
}
.listing-method {
    margin-bottom: 10px;
}
.listing-method input[type="radio"] {
    margin-right: 5px;
}
.listing-method label {
    display: inline-block;
    margin-right: 15px;
}
.trade-for-item-input {
    margin-top: 10px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    margin-bottom: 5px;
    border-radius: 2px;
}
.item-row.selected {
    border-color: #4CAF50; /* Highlight selected item */
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}
.item-row-info {
    flex-grow: 1;
}
.item-row-actions {
    margin-left: 10px;
}
.item-row-info .name {
    font-weight: bold;
    color: #e0e0e0;
}
.item-row-info .details {
    font-size: 0.8em;
    color: #b0b0b0;
}
.item-selection-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
    padding: 5px;
    background-color: #222;
}

.inventory-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-item:hover {
    background-color: #3a3a3a;
    border-color: #9acd32;
}

.inventory-item.selected {
    background-color: #2a3a2a;
    border-color: #9acd32;
}

.inventory-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inventory-item-image {
    flex-shrink: 0;
}

.inventory-item-details {
    flex-grow: 1;
}

.inventory-item-name {
    font-weight: bold;
    color: #e0e0e0;
    font-size: 0.9em;
}

.inventory-item-info {
    color: #b0b0b0;
    font-size: 0.8em;
}

/* Admin Tab Specific Styling */
.admin-section {
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 3px;
}
.admin-section h3 {
    margin-top: 0;
    border-bottom: 1px dashed #555;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #FFD700; /* Gold for admin titles */
}
.admin-section button {
    background-color: #8B0000; /* Dark Red for admin actions */
    border-color: #B22222;
}
.admin-section button:hover:not(:disabled) {
     background-color: #A52A2A;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: #1e1e1e;
    border: 2px solid #444;
    border-radius: 5px;
    padding: 20px;
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

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

.modal-title {
    color: #e0e0e0;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
}

.modal-close {
    background: none;
    border: none;
    color: #f44336;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-body {
    color: #d0d0d0;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #444;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Trade Proposal Modal */
.trade-proposal-item {
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 3px;
}

.trade-proposal-item h4 {
    margin: 0 0 10px 0;
    color: #9acd32;
}

/* Confirmation Modal */
.confirmation-modal .modal-body {
    text-align: center;
    padding: 20px 0;
}

.confirmation-modal .warning-icon {
    font-size: 3em;
    color: #FFA500;
    margin-bottom: 15px;
}

/* Item Details Modal */
.item-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.item-detail-label {
    color: #b0b0b0;
    font-weight: bold;
}

.item-detail-value {
    color: #e0e0e0;
}

/* Login Screen Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-container {
    background-color: rgba(42, 42, 42, 0.95);
    border: 2px solid #444;
    border-radius: 8px;
    padding: 30px;
    min-width: 450px;
    max-width: 500px;
    backdrop-filter: blur(5px); /* Add blur effect for better readability */
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-header h2 {
    color: #e0e0e0;
    margin: 0 0 10px 0;
    font-size: 1.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-header p {
    color: #b0b0b0;
    margin: 0;
    font-size: 0.9em;
}

.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
}

.login-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-weight: bold;
    border-bottom: 2px solid transparent;
}

.login-tab:hover {
    color: #e0e0e0;
    background-color: #333;
}

.login-tab.active {
    color: #9acd32;
    border-bottom-color: #9acd32;
}

.login-tab-content {
    margin-bottom: 20px;
}

.login-form .form-group {
    margin-bottom: 15px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    color: #b0b0b0;
    font-weight: bold;
}

.login-form input {
    width: 100%;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1em;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: #9acd32;
    box-shadow: 0 0 5px rgba(154, 205, 50, 0.3);
}

.quick-players {
    margin: 20px 0;
    padding: 15px;
    background-color: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #333;
}

.quick-players p {
    margin: 0 0 10px 0;
    color: #9acd32;
    font-size: 0.9em;
    font-weight: bold;
}

.quick-player-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-player-buttons button {
    padding: 8px 12px;
    background-color: #444;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
}

.quick-player-buttons button:hover {
background-color: #555;
border-color: #9acd32;
color: #9acd32;
}

.quick-player-buttons button:body {
background-color: #1a1a1a;
color: #e0e0e0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background-image: url('background.png');
background-size: cover;
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
}

.admin-notice {
margin: 15px 0;
padding: 15px;
background-color: #2a1a1a;
border: 1px solid #8B0000;
border-radius: 4px;
}

.admin-notice p {
margin: 5px 0;
color: #e0e0e0;
font-size: 0.9em;
    margin: 5px 0;
    color: #e0e0e0;
    font-size: 0.9em;
}

.admin-notice p:first-child {
    color: #FFD700;
    font-weight: bold;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background-color: #4CAF50;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.admin-login-btn {
    background-color: #8B0000;
}

.admin-login-btn:hover {
    background-color: #A52A2A;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info span {
    color: #9acd32;
    font-weight: bold;
}

/* Product Cards Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 5px;
    border: 1px solid #333;
}

.product-card {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-color: #9acd32;
}

.product-card.selected {
    border-color: #9acd32;
    background-color: #2a3a2a;
    box-shadow: 0 0 10px rgba(154, 205, 50, 0.3);
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 10px;
    border-radius: 4px;
    background-color: #1a1a1a;
    padding: 5px;
}

.product-name {
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.product-type {
    color: #9acd32;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.product-condition {
    color: #b0b0b0;
    font-size: 0.8em;
    margin-bottom: 8px;
}

.product-price {
    color: #FFD700;
    font-weight: bold;
    font-size: 1em;
    margin-bottom: 10px;
}

.product-category {
    background-color: #444;
    color: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-actions button {
    padding: 6px 10px;
    font-size: 0.8em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.list-item-btn {
    background-color: #4CAF50;
    color: white;
}

.list-item-btn:hover {
    background-color: #45a049;
}

.list-item-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.view-details-btn {
    background-color: #2196F3;
    color: white;
}

.view-details-btn:hover {
    background-color: #1976D2;
}

/* Category Colors */
.product-card[data-category="weapon"] { border-left: 4px solid #f44336; }
.product-card[data-category="melee"] { border-left: 4px solid #FF9800; }
.product-card[data-category="ammo"] { border-left: 4px solid #FFC107; }
.product-card[data-category="clothing"] { border-left: 4px solid #9C27B0; }
.product-card[data-category="attachment"] { border-left: 4px solid #3F51B5; }
.product-card[data-category="food"] { border-left: 4px solid #8BC34A; }
.product-card[data-category="medical"] { border-left: 4px solid #00BCD4; }
.product-card[data-category="explosive"] { border-left: 4px solid #795548; }

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        min-width: 90%;
        margin: 20px;
        padding: 20px;
    }
    
    .quick-player-buttons {
        grid-template-columns: 1fr;
    }
    
    .dayz-ui-container {
        width: 95%;
        height: 90vh;
    }
    
    .search-filter-bar {
        flex-direction: column;
    }
    
    .listing-details-area {
        flex-direction: column;
    }
    
    .modal-content {
        min-width: 90%;
        margin: 20px;
    }
}
