.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 16px;
    width: fit-content;
    margin: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header Links */
.header-links {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.my-orders-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.my-orders-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.order-count {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.order-count:empty,
.order-count[data-count="0"] {
    display: none;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

/* Orders List */
.orders-modal-content {
    max-height: 70vh;
}

.orders-list {
    padding: 16px;
    overflow-y: auto;
    max-height: 50vh;
}

/* Order Item Redesign */
.order-item {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item:last-child {
    margin-bottom: 0;
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 12px;
    margin-bottom: 0;
}

.order-item-info {
    flex: 1;
}

.order-item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    line-height: 1.4;
}

.order-item-seller {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-item-status {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Status Colors */
.order-item-status.pending {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.order-item-status.confirmed {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #d1fae5;
}

.order-item-status.pending_agreement {
    background: #fefce8;
    color: #a16207;
    border: 1px solid #fef08a;
}

.order-item-status.pending_payment {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

/* Price Section */
.order-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.order-main-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.order-time {
    font-size: 12px;
    color: #9ca3af;
}

/* Action Footer */
.order-footer {
    padding-top: 12px;
    display: flex;
    gap: 8px;
}

.chat-seller-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--text-primary);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.chat-seller-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Bid Info Box */
.buyer-bid-box {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.bid-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bid-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.bid-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.bid-stat.agreed .bid-stat-value {
    color: #059669;
}

.bid-stat.your-bid .bid-stat-value {
    color: #d97706;
}

.bid-stat.original .bid-stat-value {
    color: #6b7280;
    text-decoration: line-through;
}

/* Order Payment Selection */
.order-payment-selection {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.payment-prompt {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: #059669;
}

.payment-buttons {
    display: flex;
    gap: 8px;
}

.payment-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-btn.qris {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.payment-btn.cash {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.payment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.payment-selected {
    font-size: 12px;
    color: #059669;
    background: #ecfdf5;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
}

.empty-orders {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-orders-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Chat Modal */
.chat-modal-content {
    max-height: 80vh;
    height: 500px;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9fafb;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.buyer {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.seller {
    align-self: flex-start;
    background: white;
    color: var(--text-primary);
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.chat-message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* Feedback Prompt */
.feedback-prompt {
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.feedback-prompt p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.feedback-link-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.feedback-link-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Feedback Modal */
.feedback-modal-content {
    max-width: 420px;
}

.feedback-intro {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.feedback-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.feedback-type {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-type:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.feedback-type input[type="radio"] {
    display: none;
}

.feedback-type input[type="radio"]:checked+.type-icon,
.feedback-type input[type="radio"]:checked~.type-label {
    color: var(--primary);
}

.feedback-type:has(input:checked) {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.type-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.type-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
}

.feedback-search-context {
    background: #fef3c7;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.feedback-search-context label {
    color: #92400e;
    font-weight: 500;
}

.feedback-search-context span {
    color: #78350f;
    font-weight: 600;
    margin-left: 4px;
}

.feedback-textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}

.feedback-textarea:focus {
    border-color: var(--primary);
}

.feedback-prompt-msg {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.feedback-prompt-msg p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.feedback-context {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.feedback-context strong {
    color: var(--primary);
}

.modal-body textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-body textarea:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
}

.cancel-btn {
    padding: 10px 20px;
    background: #f3f4f6;
    color: var(--text-primary);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: #e5e7eb;
}

.confirm-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

