/* Deal Negotiation Tab Styles */
.deal-negotiation-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Search Section */
.deal-search-area {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.deal-search-area h2 {
    color: #2196F3;
    margin-bottom: 20px;
    border-bottom: 3px solid #2196F3;
    padding-bottom: 10px;
}

.deal-search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#deal-search-query {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

#deal-search-query:focus {
    outline: none;
    border-color: #2196F3;
}

.deal-search-controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

#deal-search-btn {
    background: #2196F3;
    color: white;
}

#deal-search-btn:hover {
    background: #1976D2;
}

#clear-search-btn {
    background: #666;
    color: white;
}

#clear-search-btn:hover {
    background: #555;
}

.deal-status {
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-weight: 500;
}

.deal-status.loading {
    background: #e3f2fd;
    color: #1976D2;
}

.deal-status.success {
    background: #d4edda;
    color: #155724;
}

.deal-status.error {
    background: #f8d7da;
    color: #721c24;
}

.deal-status.warning {
    background: #fff3cd;
    color: #856404;
}

/* Search Results Section */
#deal-search-section {
    margin-top: 20px;
    display: none;
}

#deal-search-section h3 {
    color: #666;
    margin-bottom: 15px;
}

.deal-search-filter {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
}

.deal-search-filter:focus {
    outline: none;
    border-color: #2196F3;
}

#deal-search-results {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #f9f9f9;
    margin-bottom: 15px;
}

.deal-add-buttons {
    display: flex;
    gap: 10px;
}

.deal-add-buttons button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

#add-to-your-side-btn {
    background: #4CAF50;
    color: white;
}

#add-to-your-side-btn:hover {
    background: #45a049;
}

#add-to-their-side-btn {
    background: #FF9800;
    color: white;
}

#add-to-their-side-btn:hover {
    background: #e68900;
}

/* Deal Sides Layout */
.deal-sides-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.deal-side {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.deal-side.your-side h2 {
    color: #4CAF50;
    border-bottom: 3px solid #4CAF50;
}

.deal-side.their-side h2 {
    color: #FF9800;
    border-bottom: 3px solid #FF9800;
}

.deal-side h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.deal-side-total {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.deal-side-cards {
    min-height: 200px;
}

.empty-side {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* Deal Card Item */
.deal-card-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.deal-card-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.deal-card-image {
    flex-shrink: 0;
}

.deal-card-image img {
    width: 60px;
    height: 84px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.deal-card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.deal-card-name {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.deal-card-price {
    font-size: 18px;
    font-weight: bold;
}

.price-loading {
    color: #1976D2;
}

.price-error {
    color: #d32f2f;
}

.price-no-data {
    color: #666;
}

.price-success {
    color: #4CAF50;
}

.price-pending {
    color: #999;
}

/* Clickable prices - make them interactive */
.price-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.price-clickable:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.price-success.price-clickable:hover {
    background: rgba(76, 175, 80, 0.1);
}

.price-error.price-clickable:hover {
    background: rgba(211, 47, 47, 0.1);
}

.setup-price-link {
    color: #2196F3;
    text-decoration: none;
    font-size: 14px;
}

.setup-price-link:hover {
    text-decoration: underline;
}

.deal-card-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s;
}

.deal-card-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Deal Balance Indicator */
.deal-balance-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.balance-loading {
    text-align: center;
    color: #1976D2;
    font-size: 18px;
    padding: 20px;
}

.balance-cash-deal {
    text-align: center;
    padding: 20px;
}

.balance-cash-deal .balance-label {
    font-size: 24px;
    font-weight: bold;
    color: #666;
    margin-bottom: 10px;
}

.balance-cash-deal .balance-value {
    font-size: 28px;
    font-weight: bold;
    color: #4CAF50;
}

.balance-indicator {
    text-align: center;
    padding: 20px;
}

.balance-label {
    font-size: 18px;
    font-weight: 500;
    color: #666;
    margin-bottom: 10px;
}

.balance-percentage {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.balance-difference {
    font-size: 16px;
    color: #666;
}

.balance-even {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
}

.balance-even .balance-percentage {
    color: #4CAF50;
}

.balance-their-favor {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 8px;
}

.balance-their-favor .balance-percentage {
    color: #FF9800;
}

.balance-your-favor {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
}

.balance-your-favor .balance-percentage {
    color: #2196F3;
}

/* Deal Actions */
.deal-actions {
    text-align: center;
}

#reset-deal-btn {
    padding: 12px 32px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

#reset-deal-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Card checkbox items (from search results) */
.card-checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.card-checkbox-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-checkbox-item label {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    gap: 10px;
}

.card-checkbox-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.card-checkbox-item .card-image {
    flex-shrink: 0;
}

.card-checkbox-item .card-image img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.card-checkbox-item .card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-checkbox-item .card-name {
    font-weight: 500;
    font-size: 14px;
}

.card-checkbox-item .card-console {
    font-size: 12px;
    color: #666;
}

.card-checkbox-item .card-price {
    font-size: 13px;
    font-weight: 600;
    color: #4CAF50;
}

/* Manual Entry Button */
.add-manual-entry-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.add-manual-entry-btn.green {
    background: #4CAF50;
    color: white;
}

.add-manual-entry-btn.green:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.add-manual-entry-btn.orange {
    background: #FF9800;
    color: white;
}

.add-manual-entry-btn.orange:hover {
    background: #e68900;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

/* Manual Entry Modal */
.manual-entry-modal {
    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;
}

.manual-entry-form {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.manual-entry-form h3 {
    margin: 0 0 24px 0;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.entry-type-selector {
    display: flex;
    gap: 20px;
}

.entry-type-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.entry-type-selector input[type="radio"] {
    cursor: pointer;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #2196F3;
}

.price-helper {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 600;
}

.percentage-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.percentage-btn {
    flex: 1;
    min-width: 90px;
    padding: 10px 8px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.percentage-btn:hover {
    border-color: #2196F3;
    background: #e3f2fd;
}

.percentage-btn.active {
    border-color: #2196F3;
    background: #2196F3;
    color: white;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-add:hover {
    background: #45a049;
}

.btn-cancel {
    background: #666;
    color: white;
}

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

/* Manual Entry Card */
.manual-entry-card {
    background: linear-gradient(135deg, #fff9e6 0%, #ffe9b8 100%) !important;
    border: 2px solid #ffc107;
}

.manual-entry-icon {
    font-size: 48px;
    flex-shrink: 0;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manual-entry-badge {
    position: absolute;
    top: -8px;
    right: 30px;
    background: #ffc107;
    color: #333;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Price Edit UI */
.price-edit-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.price-edit-btn:hover {
    opacity: 1;
    background: #f0f0f0;
}

.price-edit-input {
    width: 100px;
    padding: 6px 10px;
    border: 2px solid #2196F3;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
}

.price-edit-input:focus {
    outline: none;
    border-color: #1976D2;
}

.price-save-btn,
.price-cancel-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 6px;
    transition: all 0.2s;
}

.price-save-btn {
    background: #4CAF50;
    color: white;
}

.price-save-btn:hover {
    background: #45a049;
}

.price-cancel-btn {
    background: #dc3545;
    color: white;
}

.price-cancel-btn:hover {
    background: #c82333;
}

.price-edited {
    color: #2196F3 !important;
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 4px;
}

.price-original-hint {
    font-size: 12px;
    color: #666;
    margin-left: 4px;
    cursor: help;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .deal-sides-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .deal-search-controls {
        flex-direction: column;
    }

    .deal-add-buttons {
        flex-direction: column;
    }

    .balance-percentage {
        font-size: 24px;
    }
}
