/* swap.css - Full & Final Version (updated December 2025)
   - Input tidak overflow (word-break + monospace untuk alamat)
   - Tombol Approve & Swap berdampingan di desktop, stack vertikal di mobile
   - Responsif, clean, dan konsisten dengan tema Namimoto
*/

* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.bg-section {
    background: linear-gradient(180deg, #1C2526 0%, #151923 100%);
    border-radius: 1rem;
    border: 1px solid #2D3748;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.text-bnb-yellow {
    color: #F3BA2F;
}

/* ----- Buttons ----- */
.btn-primary {
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    border-radius: 0.75rem;
    border: none;
    background: linear-gradient(90deg, #F3BA2F 0%, #DAA520 100%);
    color: #0D1117;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(90deg, #DAA520 0%, #F3BA2F 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(243, 186, 47, 0.4);
}

.btn-primary:disabled {
    background: linear-gradient(90deg, #6B7280 0%, #4B5563 100%);
    color: #9CA3AF;
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.btn-remove {
    background: linear-gradient(90deg, #F56565 0%, #E53E3E 100%);
}

.btn-remove:hover:not(:disabled) {
    background: linear-gradient(90deg, #E53E3E 0%, #F56565 100%);
}

/* ----- Form & Input (anti-overflow) ----- */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #E2E8F0;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid #4B5563;
    border-radius: 0.75rem;
    background-color: #111827;
    color: #F3F4F6;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #F3BA2F;
    box-shadow: 0 0 0 3px rgba(243, 186, 47, 0.2);
    background-color: #1F2937;
}

.form-group input:disabled {
    background-color: #1F2937;
    color: #9CA3AF;
    cursor: not-allowed;
}

.form-group input::placeholder {
    color: #6B7280;
    opacity: 0.7;
}

/* Input khusus alamat token (anti-overflow panjang) */
#fromToken,
#toToken {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
    word-break: break-all;
    hyphens: auto;
    line-height: 1.45;
}

/* ----- Button Container (Approve & Swap berdampingan) ----- */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .button-container {
        flex-direction: row;
        gap: 1.25rem;
    }
    
    .btn-primary {
        flex: 1;
    }
}

/* ----- Arrow Separator ----- */
.swap-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.75rem 0;
    color: #F3BA2F;
    font-size: 2.25rem;
}

/* ----- Transaction Log ----- */
#transactionLog {
    background: #0F172A;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.25rem;
    height: 16rem;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    color: #E2E8F0;
}

#transactionLog p {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.action-approve { background: rgba(72, 187, 120, 0.15); color: #86efac; }
.action-swap    { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.action-error   { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* ----- Modal ----- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1C2526;
    border-radius: 1rem;
    width: 90%;
    max-width: 420px;
    padding: 1.75rem;
    border: 1px solid #374151;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.close-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #F3BA2F;
}

/* ----- Responsive Adjustments ----- */
@media (max-width: 640px) {
    .form-group input {
        padding: 0.95rem 1rem;
        font-size: 0.95rem;
    }
    
    .swap-arrow {
        margin: 1.25rem 0;
        font-size: 1.75rem;
    }
    
    .btn-primary {
        padding: 1rem;
        font-size: 1rem;
    }
}