/**
 * CSS Berlin - Negotiation System Styles
 * Professional price negotiation UI like Vinted, Depop, Poshmark
 */

/* ==================== MODAL OVERLAY ==================== */
.negotiation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* ==================== MODAL CONTAINER ==================== */
.negotiation-modal {
    background: white;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s ease;
}

.negotiation-modal-overlay.active .negotiation-modal {
    transform: translateY(0) scale(1);
}

/* ==================== MODAL HEADER ==================== */
.negotiation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
    background: linear-gradient(135deg, #2D5016 0%, #3d6a1e 100%);
    border-radius: 20px 20px 0 0;
}

.negotiation-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: white;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ==================== PRODUCT PREVIEW ==================== */
.negotiation-modal-product {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
}

.negotiation-modal-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.negotiation-modal-product .product-info {
    flex: 1;
    min-width: 0;
}

.negotiation-modal-product .product-brand {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #757575;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.negotiation-modal-product .product-name {
    font-size: 15px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.negotiation-modal-product .product-size {
    font-size: 13px;
    color: #757575;
    margin-bottom: 8px;
}

.negotiation-modal-product .product-price {
    font-size: 18px;
    font-weight: 800;
    color: #2D5016;
}

.negotiation-modal-product .product-price.original {
    color: #757575;
    text-decoration: line-through;
}

/* ==================== MODAL BODY ==================== */
.negotiation-modal-body {
    padding: 24px;
}

/* Offer Input Section */
.offer-input-section {
    margin-bottom: 20px;
}

.offer-input-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 8px;
}

.offer-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 16px;
    font-size: 20px;
    font-weight: 700;
    color: #2D5016;
}

.offer-input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 40px;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    color: #212121;
    transition: all 0.2s;
}

.offer-input-wrapper input:focus {
    outline: none;
    border-color: #2D5016;
    box-shadow: 0 0 0 4px rgba(45, 80, 22, 0.1);
}

.offer-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    background: #fff8e1;
    border-radius: 8px;
    font-size: 13px;
    color: #f57c00;
}

.hint-icon {
    font-size: 16px;
}

.offer-discount {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: #f5f5f5;
    border-radius: 8px;
}

.offer-discount.recommended {
    background: #e8f5e9;
}

.offer-discount.too-low {
    background: #ffebee;
}

.discount-percent {
    font-size: 18px;
    font-weight: 800;
    color: #2D5016;
}

.offer-discount.too-low .discount-percent {
    color: #c62828;
}

.discount-text {
    font-size: 13px;
    color: #757575;
}

/* Quick Offers */
.quick-offers {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 13px;
    color: #757575;
    margin-right: 4px;
}

.quick-offer-btn {
    padding: 8px 14px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #424242;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-offer-btn:hover {
    background: #e8f5e9;
    border-color: #2D5016;
    color: #2D5016;
}

.quick-offer-btn.active {
    background: #2D5016;
    color: white;
    border-color: #2D5016;
}

/* Message Section */
.offer-message-section {
    margin-bottom: 20px;
}

.offer-message-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 8px;
}

.offer-message-section textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    transition: all 0.2s;
}

.offer-message-section textarea:focus {
    outline: none;
    border-color: #2D5016;
}

/* Info Box */
.offer-info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #e3f2fd;
    border-radius: 12px;
    border-left: 4px solid #1976d2;
}

.info-icon {
    font-size: 20px;
    color: #1976d2;
}

.info-text {
    font-size: 13px;
    color: #0d47a1;
}

.info-text strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-text ul {
    margin: 0;
    padding-left: 16px;
}

.info-text li {
    margin-bottom: 4px;
}

/* ==================== MODAL FOOTER ==================== */
.negotiation-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    border-top: 1px solid #e8e8e8;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #424242;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-send-offer {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2D5016 0%, #3d6a1e 100%);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send-offer:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 80, 22, 0.35);
}

/* ==================== SELLER RESPONSE MODAL ==================== */
.seller-modal .negotiation-modal-header {
    background: linear-gradient(135deg, #FF8C42 0%, #e67a35 100%);
}

.offer-received-box {
    padding: 20px 24px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    border-bottom: 1px solid #ffe082;
}

.offer-from {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.buyer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8C42 0%, #2D5016 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.buyer-info {
    display: flex;
    flex-direction: column;
}

.buyer-name {
    font-weight: 600;
    color: #212121;
}

.offer-time {
    font-size: 12px;
    color: #757575;
}

.offer-price-box {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.offer-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #757575;
    margin-bottom: 4px;
}

.offer-amount {
    font-size: 32px;
    font-weight: 900;
    color: #FF8C42;
}

.offer-price-box .offer-discount {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f5e9;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #2D5016;
    margin-top: 8px;
}

.offer-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    font-size: 14px;
    font-style: italic;
    color: #424242;
    border-left: 4px solid #FF8C42;
}

/* Response Actions */
.response-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.btn-accept,
.btn-decline,
.btn-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-accept {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

.btn-accept:hover {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
}

.btn-decline {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}

.btn-decline:hover {
    background: #c62828;
    color: white;
    border-color: #c62828;
}

.btn-counter {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.btn-counter:hover {
    background: #1565c0;
    color: white;
    border-color: #1565c0;
}

/* Counter Offer Form */
.counter-offer-form {
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-top: 16px;
}

.counter-offer-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.counter-offer-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 12px;
    resize: none;
    font-family: inherit;
}

.btn-send-counter {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: #1565c0;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send-counter:hover {
    background: #0d47a1;
}

/* Offer Expires */
.offer-expires {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #fff3e0;
    font-size: 13px;
    color: #e65100;
    border-radius: 0 0 20px 20px;
}

/* ==================== VERHANDELN BUTTON STYLES ==================== */
.btn-verhandeln {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FF8C42 0%, #e67a35 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-verhandeln:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 140, 66, 0.35);
}

.btn-verhandeln svg {
    width: 18px;
    height: 18px;
}

/* Product Card Verhandeln Button */
.product-card .btn-verhandeln-small {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    background: rgba(255, 140, 66, 0.9);
    backdrop-filter: blur(4px);
}

/* ==================== NEGOTIATIONS LIST PAGE ==================== */
.negotiations-page {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 20px;
}

.negotiations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.negotiations-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #212121;
}

.negotiations-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 10px;
}

.negotiations-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #757575;
    cursor: pointer;
    transition: all 0.2s;
}

.negotiations-tab.active {
    background: white;
    color: #2D5016;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.negotiations-tab:hover:not(.active) {
    color: #424242;
}

/* Negotiation Card */
.negotiation-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

.negotiation-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.negotiation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
}

.negotiation-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.negotiation-status.pending {
    background: #fff3e0;
    color: #e65100;
}

.negotiation-status.accepted {
    background: #e8f5e9;
    color: #2e7d32;
}

.negotiation-status.declined {
    background: #ffebee;
    color: #c62828;
}

.negotiation-status.counter {
    background: #e3f2fd;
    color: #1565c0;
}

.negotiation-status.expired {
    background: #f5f5f5;
    color: #757575;
}

.negotiation-card-body {
    display: flex;
    gap: 16px;
    padding: 20px;
}

.negotiation-product-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.negotiation-details {
    flex: 1;
    min-width: 0;
}

.negotiation-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 8px;
}

.negotiation-prices {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.negotiation-offer-price {
    font-size: 20px;
    font-weight: 800;
    color: #FF8C42;
}

.negotiation-original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.negotiation-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #757575;
}

.negotiation-card-actions {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
}

.negotiation-card-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

/* Empty State */
.negotiations-empty {
    text-align: center;
    padding: 60px 20px;
}

.negotiations-empty svg {
    width: 80px;
    height: 80px;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.negotiations-empty h3 {
    font-size: 20px;
    color: #424242;
    margin-bottom: 8px;
}

.negotiations-empty p {
    color: #757575;
    margin-bottom: 24px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
    .negotiation-modal {
        max-width: 100%;
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
    }

    .negotiation-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .response-actions {
        grid-template-columns: 1fr;
    }

    .btn-accept,
    .btn-decline,
    .btn-counter {
        flex-direction: row;
        padding: 14px 16px;
    }

    .negotiations-tabs {
        overflow-x: auto;
    }

    .negotiation-card-body {
        flex-direction: column;
    }

    .negotiation-product-img {
        width: 100%;
        height: 200px;
    }
}