/* frontend/websocket-trade-styles.css - Professional Modal Redesign */

/* ==============================================
   PROFESSIONAL MODAL BASE STYLES
   ============================================== */

.pro-modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 0;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.pro-header {
    background: #2a2a2a;
    padding: 20px 25px;
    border-bottom: 1px solid #333;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pro-title {
    margin: 0;
    font-size: 1.2em;
    color: #ffffff;
    font-weight: 600;
}

.pro-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #333;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pro-close:hover {
    background: #444;
    color: #fff;
}

.pro-body {
    padding: 20px;
}

/* ==============================================
   TRADE ALERT SECTION
   ============================================== */

.trade-alert {
    background: linear-gradient(135deg, rgba(0, 216, 173, 0.1), rgba(0, 216, 173, 0.05));
    border: 1px solid rgba(0, 216, 173, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.alert-message {
    color: #00d8ad;
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 5px;
}

.alert-details {
    color: #ccc;
    font-size: 0.85em;
}

/* Maker alerts use yellow theme */
.maker-notification-modal .trade-alert {
    background: linear-gradient(135deg, rgba(255, 188, 28, 0.1), rgba(255, 188, 28, 0.05));
    border: 1px solid rgba(255, 188, 28, 0.3);
}

.maker-notification-modal .alert-message {
    color: #ffbc1c;
}

/* ==============================================
   INFO GRID
   ============================================== */

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.info-item {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.info-item:hover {
    background: #2a2a2a;
    border-color: #444;
}

.info-label {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 500;
}

.info-value {
    font-size: 1.1em;
    color: #ffffff;
    font-weight: 600;
}

.info-value.price {
    color: #00d8ad;
    font-family: 'Courier New', monospace;
}

.info-value.pair {
    color: #ffbc1c;
    font-weight: 700;
}

/* ==============================================
   COUNTERPARTY INFO
   ============================================== */

.counterparty-info {
    background: #252525;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.counterparty-title {
    color: #ccc;
    font-size: 0.85em;
    margin-bottom: 6px;
    font-weight: 500;
}

.counterparty-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1em;
}

/* ==============================================
   FORM SECTIONS
   ============================================== */

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

.section-title {
    color: #ffffff;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}

.input-group {
    margin-bottom: 15px;
}

.input-label {
    display: block;
    color: #ccc;
    font-size: 0.85em;
    margin-bottom: 6px;
    font-weight: 500;
}

.input-with-symbols {
    position: relative;
    display: flex;
    align-items: center;
}

.input-symbol-left {
    position: absolute;
    left: 10px;
    color: #888;
    font-size: 1em;
    font-weight: 600;
    z-index: 1;
    pointer-events: none;
}

.input-symbol-right {
    position: absolute;
    right: 10px;
    color: #888;
    font-size: 1em;
    font-weight: 600;
    z-index: 1;
    pointer-events: none;
}

.pro-input-with-symbols {
    width: 100%;
    background: #252525;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px 30px;
    color: #ffffff;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: center;
}

.pro-input-with-symbols:focus {
    outline: none;
    border-color: #00d8ad;
    background: #2a2a2a;
    box-shadow: 0 0 0 3px rgba(0, 216, 173, 0.1);
}

.pro-input-with-symbols::placeholder {
    color: #666;
}

.pro-input-with-symbols:disabled {
    background: #1a1a1a;
    color: #666;
    cursor: not-allowed;
}

/* ==============================================
   STATUS SECTION
   ============================================== */

.status-section {
    background: #252525;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #00d8ad;
    margin-bottom: 15px;
}

.status-text {
    color: #ccc;
    font-size: 0.85em;
    line-height: 1.4;
}

/* ==============================================
   AGREEMENT SECTION
   ============================================== */

.agreement-section {
    background: #1a4032;
    border: 1px solid #00d8ad;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.agreement-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.agreement-item {
    text-align: center;
}

.agreement-label {
    color: #888;
    font-size: 0.75em;
    margin-bottom: 4px;
}

.agreement-value {
    color: #00d8ad;
    font-weight: 600;
    font-size: 0.9em;
}

.final-amount {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.final-label {
    color: #888;
    font-size: 0.8em;
    margin-bottom: 4px;
}

.final-value {
    color: #00d8ad;
    font-weight: bold;
    font-size: 1.2em;
}

/* ==============================================
   CREDIT SECTION
   ============================================== */

.credit-section {
    background: #252525;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.credit-title {
    color: #ffffff;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.credit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.credit-item {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.credit-label {
    color: #888;
    font-size: 0.75em;
    margin-bottom: 4px;
}

.credit-status {
    font-weight: 600;
    font-size: 0.85em;
}

.credit-status.confirmed {
    color: #00d8ad;
}

.credit-status.pending {
    color: #ffbc1c;
}

.credit-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.credit-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: #00d8ad;
    background-color: #252525;
    border: 1px solid #444;
}

.credit-checkbox label {
    color: #ccc;
    font-size: 0.85em;
    cursor: pointer;
}

/* ==============================================
   BALANCE SECTION
   ============================================== */

.balance-section {
    background: #3a3a00;
    border: 1px solid #ffbc1c;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.balance-title {
    color: #ffbc1c;
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 10px;
    text-align: center;
}

.balance-amount {
    text-align: center;
    margin-bottom: 12px;
}

.balance-amount-value {
    color: #ffbc1c;
    font-weight: bold;
    font-size: 1.4em;
}

.balance-question {
    color: #ccc;
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 12px;
}

.balance-actions {
    display: flex;
    gap: 8px;
}

.balance-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.balance-btn.offer {
    background: #00d8ad;
    color: black;
}

.balance-btn.bid {
    background: #4054b2;
    color: white;
}

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

.balance-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* ==============================================
   NOTIONAL CHOICE INTERFACE
   ============================================== */

.notional-choice-section {
    margin: 20px 0 !important;
    padding: 20px !important;
    background-color: #1a4032 !important;
    border: 2px solid #00d8ad !important;
    border-radius: 8px !important;
    animation: choiceSlideIn 0.3s ease-out;
}

.notional-choice-section h4 {
    margin: 0 0 20px 0;
    color: #00d8ad;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.choice-amounts {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.choice-amounts > div {
    flex: 1;
    padding: 15px;
    background-color: #252525;
    border-radius: 6px;
    text-align: center;
    border: 2px solid transparent;
}

.choice-amounts > div:first-child {
    border-color: #00d8ad;
}

.choice-amounts > div:last-child {
    border-color: #ffbc1c;
}

.choice-amounts div > div:first-child {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.choice-amounts div > div:last-child {
    font-size: 20px;
    font-weight: bold;
}

.choice-amounts > div:first-child > div:last-child {
    color: #00d8ad;
}

.choice-amounts > div:last-child > div:last-child {
    color: #ffbc1c;
}

.quick-choices {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.quick-choices button {
    flex: 1;
    padding: 18px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
    line-height: 1.3;
}

.quick-choices button:first-child {
    background-color: #00d8ad;
    color: white;
}

.quick-choices button:last-child {
    background-color: #ffbc1c;
    color: black;
}

.custom-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.custom-choice > span {
    color: #ccc;
    font-size: 16px;
    font-weight: 500;
}

.custom-choice > div {
    display: flex;
    align-items: center;
    background-color: #252525;
    border: 2px solid #4054b2;
    border-radius: 8px;
    padding: 12px;
    gap: 8px;
}

.custom-choice input {
    background: none;
    border: none;
    color: white;
    font-weight: bold;
    text-align: center;
    width: 60px;
    outline: none;
    font-size: 18px;
}

.custom-choice button {
    padding: 12px 20px;
    background-color: #4054b2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.choice-info-box {
    text-align: center;
    font-size: 13px;
    color: #888;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 6px;
}

.choice-info-box strong {
    color: #00d8ad;
}

@keyframes choiceSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   BUTTON STYLES
   ============================================== */

.pro-button {
    background: linear-gradient(135deg, #00d8ad, #00c49a);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: #000000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    width: 100%;
}

.pro-button:hover {
    background: linear-gradient(135deg, #00c49a, #00b088);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 216, 173, 0.3);
}

.pro-button:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pro-button.waiting {
    background: #666;
    color: #ccc;
}

.pro-button.ready {
    background: linear-gradient(135deg, #00d8ad, #00c49a);
    color: #000;
    animation: readyPulse 2s infinite;
}

@keyframes readyPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 216, 173, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 216, 173, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 216, 173, 0); }
}

/* ==============================================
   MAKER MODAL COMPATIBILITY
   ============================================== */

.maker-notification-modal .modal-content {
    max-width: 500px;
    width: 90%;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    color: white;
}

.maker-notification-modal .pro-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #ffffff;
    font-weight: 600;
}

/* Backward compatibility for existing button classes */
.notification-ok-btn {
    background: linear-gradient(135deg, #00d8ad, #00c49a);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: #000000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    width: 100%;
}

.notification-ok-btn:hover {
    background: linear-gradient(135deg, #00c49a, #00b088);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 216, 173, 0.3);
}

.notification-ok-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 600px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .choice-amounts {
        flex-direction: column;
        gap: 10px;
    }
    
    .quick-choices {
        flex-direction: column;
        gap: 10px;
    }
    
    .custom-choice {
        flex-direction: column;
        gap: 15px;
    }
    
    .custom-choice > div {
        width: 100%;
        justify-content: center;
    }
    
    .balance-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==============================================
   CREDIT STATUS SPECIFICITY FIX
   ============================================== */

/* Ensure all credit status elements use consistent styling */
.credit-section .credit-status {
    font-weight: 600 !important;
    font-size: 0.85em !important;
}

.credit-section .credit-status.confirmed {
    color: #00d8ad !important;
}

.credit-section .credit-status.pending {
    color: #ffbc1c !important;
}

/* ==============================================
   CREDIT SECTION BACKGROUND FIX
   ============================================== */

/* Ensure taker modal credit section has same background as maker modal */
.credit-section {
    background: #252525 !important;
    border: none !important;
    border-radius: 8px !important;
}

/* Remove any green background styling from credit sections */
.credit-section.ready-state {
    background: #252525 !important;
    border: 1px solid #333 !important;
}

/* ==============================================
   COUNTERPARTY INFO LAYOUT FIX
   ============================================== */

/* Ensure counterparty name appears on new line */
.counterparty-info {
    background: #252525;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: left; /* Ensure left alignment */
}

.counterparty-title {
    color: #ccc;
    font-size: 0.85em;
    margin-bottom: 6px;
    font-weight: 500;
    display: block; /* Force block display */
}

.counterparty-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1em;
    display: block; /* Force block display to ensure new line */
    margin-top: 0; /* Remove any top margin */
}

/* Force counterparty info to display on separate lines, left-aligned */
.counterparty-info {
    background: #252525;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column; /* Force vertical layout */
    align-items: flex-start; /* Left align the content */
}

.counterparty-title {
    color: #ccc;
    font-size: 0.85em;
    margin-bottom: 6px;
    font-weight: 500;
    line-height: 1.2;
}

.counterparty-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1em;
    line-height: 1.2;
    margin: 0;
}

/* ==============================================
   Notional proposal CSS
   ============================================== */

/* Counterparty Proposal Display */
.counterparty-proposal {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 15px;
}

.counterparty-proposal-label {
    color: #aaa;
    font-size: 12px;
    margin-bottom: 5px;
}

.counterparty-proposal-amount {
    color: #4054b2;
    font-size: 16px;
    font-weight: 600;
}