/* SWAP UI SPECIFIC STYLES - Extracted from swap.html */

/* Academic Professional Swap Interface - No rounded corners, monochrome palette */

.grid-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    max-width: 100%;
    overflow-x: hidden;
}

/* MOBILE RESPONSIVE - Comprehensive fixes */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 0 !important;
    }
}

@media (max-width: 768px) {
    .grid-container { grid-template-columns: 1fr !important; gap: 15px; }

    /* Fix back button - make it relative on mobile to prevent overlap */
    .back-button {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        display: block !important; /* Force block to take up full width/line */
        margin: 20px 0 20px 15px !important; /* Add left margin for alignment */
        z-index: 1 !important;
        width: fit-content;
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #000 !important;
        padding: 12px 16px !important;
    }

    /* Hero section mobile spacing */
    .hero {
        margin-top: 30px !important;
        padding: 20px 0 !important;
    }

    .hero .title {
        font-size: 16pt !important;
    }

    .hero .subtitle {
        font-size: 10pt !important;
    }

    /* Security notice mobile */
    .security-notice {
        font-size: 9pt;
        padding: 8px 12px;
    }

    /* Cards mobile */
    .card {
        padding: 12px;
        margin-bottom: 15px;
    }

    .card h2 {
        font-size: 12pt;
        margin-bottom: 10px;
    }

    /* Filter bar - stack vertically */
    .filter-bar {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .filter-bar input {
        width: 100% !important;
    }

    .filter-bar button {
        width: 100% !important;
    }

    /* Offer specs grid mobile */
    .offer-specs {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    /* Wallet buttons mobile - touch friendly */
    .btn-wallet {
        padding: 14px 16px;
        font-size: 11pt;
        min-height: 48px;
    }

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

    /* All buttons touch friendly */
    .btn, .btn-secondary {
        min-height: 48px;
        padding: 14px 16px;
        font-size: 11pt;
    }

    /* Form inputs mobile */
    .form-group input,
    .form-group textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        min-height: 48px;
        padding: 12px;
    }

    /* Filter inputs touch friendly */
    .filter-bar input {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 16px !important;
    }

    /* Swap card mobile */
    .swap-card {
        padding: 10px;
    }

    .swap-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    /* Chat window mobile */
    .chat-window {
        max-height: 150px;
    }

    /* Reply box mobile */
    .reply-box {
        flex-direction: column;
    }

    .reply-box input {
        width: 100%;
    }

    .reply-box button {
        width: 100%;
    }

    /* Action card mobile */
    .action-card {
        padding: 12px;
    }

    .action-card h4 {
        font-size: 11pt;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .offer-specs {
        grid-template-columns: 1fr !important;
    }

    .spec .value {
        font-size: 10pt;
    }

    .spec .label {
        font-size: 8pt;
    }

    .btn {
        font-size: 10pt;
        padding: 8px 12px;
    }

    .badge, .status-badge {
        font-size: 8pt;
        padding: 2px 6px;
    }
}

.card { border: 1px solid #000; padding: 15px; margin-bottom: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 10pt; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 8px;
    font-family: 'IBM Plex Mono', 'Courier New', monospace; /* Updated to IBM Plex Mono */
    border: 1px solid #000;
    background: #fdfdfd;
    font-size: 10pt;
}

/* Buttons - Academic style, no rounded corners */
.btn {
    background: #000;
    color: #fff;
    padding: 10px 15px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 11pt;
    margin-top: 5px;
    width: 100%;
    font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
}
.btn:hover { background: #333; }
.btn-secondary { background: #fff; color: #000; border: 2px solid #000; }
.btn-secondary:hover { background: #f5f5f5; }

/* Wallet buttons - Monochrome academic style */
.btn-wallet {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}
.btn-nostr {
    background: #000;
    border: 2px solid #000;
}
.btn-nostr:hover { background: #333; }
.btn-bitcoin {
    background: #fff;
    color: #000;
    border: 2px solid #000;
}
.btn-bitcoin:hover { background: #f5f5f5; }

#userInfo p, #relayInfo p { margin: 5px 0; font-size: 10pt; }
#userInfo code { font-size: 9pt; word-break: break-all; }
.offer-list, .swap-list { list-style: none; padding: 0; }
.offer-item, .swap-item { border: 1px solid #000; padding: 15px; margin-bottom: 10px; }
.offer-item h3, .swap-item h3 { margin-top: 0; font-size: 13pt; border-bottom: 1px solid #000; padding-bottom: 5px; }

/* Status badges - Academic monochrome */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 9pt;
    margin-left: 10px;
    border: 1px solid #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge.taproot { background: #000; color: #fff; }
.badge.legacy { background: #f5f5f5; color: #666; }
.badge.available { background: #000; color: #fff; }

/* Wallet status indicators */
.wallet-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 10pt;
}
.status-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
}
.status-dot.connected { background: #000; }
.status-dot.disconnected { background: #999; }

/* Chat styles - Academic */
.chat-window {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #000;
    padding: 10px;
    margin-bottom: 15px;
    background: #fafafa;
}
.msg { margin-bottom: 10px; }
.msg .msg-content {
    display: inline-block;
    padding: 5px 10px;
    max-width: 80%;
    word-break: break-word;
    border: 1px solid #ccc;
}
.msg.me { text-align: right; }
.msg.me .msg-content { background: #000; color: #fff; border-color: #000; }
.msg.provider .msg-content { background: #fff; }
.msg-meta { font-size: 8pt; color: #666; margin-top: 2px; }

/* Action cards - Academic style */
.action-card {
    border: 2px solid #000;
    padding: 15px;
    margin: 15px 0;
    background: #fafafa;
}
.action-card h4 { margin-top: 0; font-size: 12pt; text-transform: uppercase; letter-spacing: 0.5px; }
.action-card.warning { border-width: 3px; background: #fff; }
.action-card.success { border-width: 3px; background: #fff; }

/* Code input */
.code-input {
    font-family: 'IBM Plex Mono', 'Courier New', monospace; /* Updated to IBM Plex Mono */
    font-size: 9pt;
    width: 100%;
    padding: 8px;
    border: 1px solid #000;
    background: #fff;
}

/* Reply box */
.reply-box {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.reply-box input { flex: 1; border: 1px solid #000; padding: 8px; }
.reply-box button { width: auto; padding: 8px 15px; }

/* Swap card */
.swap-card {
    border: 1px solid #000;
    padding: 15px;
    margin-bottom: 15px;
}
.swap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.swap-title { font-weight: bold; font-size: 13pt; }

/* Status badges - Academic monochrome */
.status-badge {
    padding: 3px 10px;
    font-size: 9pt;
    font-weight: bold;
    border: 1px solid #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge.negotiating { background: #fff; color: #000; }
.status-badge.premium_due { background: #f5f5f5; color: #000; border-width: 2px; }
.status-badge.waiting_funding { background: #eee; color: #000; }
.status-badge.funded { background: #000; color: #fff; }
.status-badge.claim_pending { background: #333; color: #fff; }

/* Offer specs */
.offer-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 10px 0;
}
.spec { text-align: center; }
.spec .label { display: block; font-size: 9pt; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.spec .value { font-weight: bold; font-size: 11pt; }

.offer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #000;
}
.offer-actions small { color: #666; }
.offer-actions button { width: auto; padding: 8px 15px; }

/* Security notice - Academic style */
.security-notice {
    background: #fff;
    border: 2px solid #000;
    padding: 10px 15px;
    font-size: 10pt;
    margin-bottom: 15px;
}

/* Version badge - Academic style */
.version-badge {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 2px 8px;
    font-size: 9pt;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
