/* Listing System Styles */

/* Create Listing Button */
.create-listing-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.create-listing-button:hover {
    background-color: var(--secondary-color);
}

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

.modal-content {
    background-color: var(--card-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.listing-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
}

.listing-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.listing-item-selection {
    background-color: var(--background-color);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.listing-item-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-listing-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background-color: var(--card-color);
    border-radius: 4px;
}

.item-listing-details .form-group {
    margin-bottom: 0;
}

.item-listing-details label {
    font-size: 0.9em;
    color: var(--text-color);
    margin-bottom: 4px;
}

.item-listing-details select,
.item-listing-details input {
    font-size: 0.9em;
    padding: 8px;
}

.price-section,
.buyout-section {
    margin-top: 8px;
}

.listing-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.item-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1em;
}

.item-price-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Listing Viewer Styles */
.listing-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.listing-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.listing-item {
    background-color: var(--card-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-price,
.item-buyout {
    font-size: 0.9em;
    color: var(--primary-color);
    font-weight: 500;
}

.item-buyout {
    color: var(--secondary-color);
}

.item-description {
    font-size: 0.9em;
    color: #666;
    margin-top: 4px;
}

/* Offer Section Styles */
.offer-section {
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.offer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.current-offers {
    margin-top: 20px;
}

#offerList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offer-item {
    background-color: var(--card-color);
    padding: 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.offer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.offer-amount {
    font-weight: 600;
    color: var(--primary-color);
}

.offer-type {
    font-size: 0.9em;
    color: var(--text-color);
}

.offer-username {
    font-size: 0.9em;
    color: #666;
}

/* Input and Select Styles */
input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Button Styles */
.btn, .btn-small {
    min-width: 90px;
    text-align: center;
    box-sizing: border-box;
    vertical-align: middle;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    line-height: 1;
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
    height: 32px;
}

.btn:hover {
    opacity: 0.9;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.status-active {
    background-color: #2ecc71;
    color: white;
}

.status-sold {
    background-color: #e74c3c;
    color: white;
}

.status-holding {
    background-color: #f39c12;
    color: white;
}

/* My Listings Section */
.my-listings {
    margin-top: 20px;
}

.my-listings-bubble {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: bold;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  pointer-events: none;
}

.listing-card-sold-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) rotate(-10deg);
  background: #e74c3c;
  color: #fff;
  font-size: 1.1em;
  font-weight: bold;
  padding: 4px 24px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  letter-spacing: 2px;
  z-index: 3;
  opacity: 0.92;
  pointer-events: none;
}

.listing-card {
  position: relative;
}

.listing-card-imgwrap {
  position: relative !important;
}

.listing-card-info {
    flex: 1;
}

.listing-card-title {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.listing-card-date {
    font-size: 0.8rem;
    color: #777;
}

.listing-card-actions {
    display: flex;
    gap: 5px;
}

.item-current-offer {
    font-size: 0.9em;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 4px;
}

.make-offer-btn {
    margin-top: 8px;
    align-self: flex-start;
    position: relative;
    bottom: -2px;
}

.offer-history {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.offer-history-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.offer-history-item {
    background-color: var(--background-color);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.offer-history-amount {
    font-weight: 600;
    color: var(--primary-color);
}

.offer-history-type {
    color: var(--text-color);
    margin-left: 8px;
}

.offer-history-username {
    color: #666;
    margin-left: 8px;
}

.offer-history-time {
    color: #999;
    font-size: 0.8em;
    margin-top: 4px;
}

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

.modal-content {
    background-color: var(--card-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Current Offer Styles */
.current-offer-info {
    background-color: var(--background-color);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.current-offer-label {
    font-size: 0.9em;
    color: var(--text-color);
    font-weight: 500;
}

.current-offer-amount {
    font-size: 1.1em;
    color: var(--primary-color);
    font-weight: 600;
    margin: 4px 0;
}

.current-offer-by {
    font-size: 0.9em;
    color: #666;
}

/* Listing Link Card Styles */
.listing-link-card {
    background-color: var(--card-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.listing-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.listing-link-info {
    flex: 1;
}

.listing-link-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.listing-link-date {
    font-size: 0.9em;
    color: #666;
}

/* Listing List Styles */
.listing-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
}

.listing-card {
    background-color: var(--card-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.listing-card .thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.listing-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.listing-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.make-offer-btn,
.buyout-btn,
.view-item-btn {
    margin: 0;
    position: static;
    bottom: 0;
}

/* Listings Container Styles */
.listings-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.header .stats {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 40px;
}

.header .stats .btn,
.header .stats .btn-small {
    height: 36px;
    line-height: 1;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 16px;
}

.header .stats > div {
    display: flex;
    align-items: center;
    height: 36px;
    line-height: 1;
    margin: 0 4px;
}

.altered-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #e74c3c;
  border-radius: 50%;
  z-index: 4;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  pointer-events: none;
  border: 2px solid #fff;
}